Emulates a mouse using one of the nRF51's timer peripherals.
More...
Enumerator |
---|
MOUSE_SENSOR_SAMPLE_PERIOD_4_MS |
Generate new mouse sample every 4 ms.
|
MOUSE_SENSOR_SAMPLE_PERIOD_8_MS |
Generate new mouse sample every 8 ms.
|
- Parameters
-
sample_period | specifies the mouse sensor sample period. |
- Return values
-
true | If initialization succeeded. |
false | If initialization failed. |
void mouse_sensor_enable |
( |
void |
| ) |
|
When enabled, the mouse sensor will start generating mouse movement samples at the rate given by mouse_sensor_init(void).
bool mouse_sensor_data_is_ready |
( |
void |
| ) |
|
- Return values
-
true | If there is data available for reading. |
false | If no data is available for reading. |
- See Also
- mouse_sensor_read(void)
bool mouse_sensor_read |
( |
uint8_t * |
out_mouse_packet | ) |
|
The mouse sensor will generate a new sample at a rate given by mouse_sensor_init(). If multiple samples are generated by the mouse sensor between each call of this function, the samples will be accumulated. Thus, the mouse packet returned by this function will tell the relative movement of the mouse since the previous time this function was called. The internal accumulator is cleared whenever the mouse sensor is read.
- Parameters
-
out_mouse_packet | returns an assembled mouse movement packet (no buttons) as specified in "nrfdvl_params.h" . |
The length of the mouse packet is given by NRFR_MOUSE_MOV_PACKET_LENGTH.
- Return values
-
true | If a new packet was written to out_mouse_packet *. |
false | If no new mouse data was available. |