|
Contiki 3.x
|
One of the buttons can be configured as general purpose or as an on/off key. More...
Files | |
| file | button-sensor.c |
| Driver for the Sensortag-CC26xx buttons. | |
| file | button-sensor.h |
| Header file for the Sensortag-CC26xx Button Driver. | |
Functions | |
| static void | button_press_handler (uint8_t ioid) |
| Handler for Sensortag-CC26XX button presses. | |
| static void | config_buttons (int type, int c, uint32_t key) |
| Configuration function for the button sensor for all buttons. More... | |
| static int | config_left (int type, int value) |
| Configuration function for the left button. More... | |
| static int | config_right (int type, int value) |
| Configuration function for the right button. More... | |
| static int | status (int type, uint32_t key_io_id) |
| Status function for all buttons. More... | |
| static int | status_left (int type) |
| Status function for the left button. More... | |
| static int | status_right (int type) |
| Status function for the right button. More... | |
Variables | |
| const struct sensors_sensor | button_left_sensor |
| Exports a global symbol to be used by the sensor API. | |
One of the buttons can be configured as general purpose or as an on/off key.
|
static |
Configuration function for the button sensor for all buttons.
| type | This function does nothing unless type == SENSORS_ACTIVE |
| c | 0: disable the button, non-zero: enable |
| key | One of BOARD_KEY_LEFT, BOARD_KEY_RIGHT etc |
Definition at line 131 of file button-sensor.c.
References button_press_handler(), and gpio_interrupt_register_handler().
Referenced by config_left(), and config_right().
|
static |
Configuration function for the left button.
Parameters are passed onto config_buttons, which does the actual configuration Parameters are ignored. They have been included because the prototype is dictated by the core sensor API. The return value is also required by the API but otherwise ignored.
| type | passed to config_buttons as-is |
| value | passed to config_buttons as-is |
Definition at line 170 of file button-sensor.c.
References config_buttons().
|
static |
Configuration function for the right button.
Parameters are passed onto config_buttons, which does the actual configuration Parameters are ignored. They have been included because the prototype is dictated by the core sensor api. The return value is also required by the API but otherwise ignored.
| type | passed to config_buttons as-is |
| value | passed to config_buttons as-is |
Definition at line 192 of file button-sensor.c.
References config_buttons().
|
static |
Status function for all buttons.
| type | SENSORS_ACTIVE or SENSORS_READY |
| key_io_id | BOARD_IOID_KEY_LEFT, BOARD_IOID_KEY_RIGHT etc |
This function will only be called by status_left, status_right and the called will pass the correct key_io_id
Definition at line 209 of file button-sensor.c.
Referenced by status_left(), and status_right().
|
static |
Status function for the left button.
| type | SENSORS_ACTIVE or SENSORS_READY |
This function will call status. It will pass type verbatim and it will also pass the correct key_io_id
Definition at line 257 of file button-sensor.c.
References status().
|
static |
Status function for the right button.
| type | SENSORS_ACTIVE or SENSORS_READY |
This function will call status. It will pass type verbatim and it will also pass the correct key_io_id
Definition at line 271 of file button-sensor.c.
References status().
1.8.6