API for configuring and manipulating Motion 2 Click driver.
More...
API for configuring and manipulating Motion 2 Click driver.
◆ motion2_detect_state_t
Enumerator |
---|
MOTION2_NO_DETECT | |
MOTION2_DETECTED | |
◆ motion2_pin_state_t
Enumerator |
---|
MOTION2_PIN_STATE_LOW | |
MOTION2_PIN_STATE_HIGH | |
◆ motion2_cfg_setup()
Config Object Initialization function.
- Parameters
-
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
- Note
- All used pins will be set to unconnected state.
◆ motion2_detect_state()
uint8_t motion2_detect_state |
( |
motion2_t * |
ctx | ) |
|
Get detection state function.
- Returns
- Detection status ( 1 - Detected / 0 - Not detected )
@description This function returns INT pin state.
◆ motion2_enable()
void motion2_enable |
( |
motion2_t * |
ctx, |
|
|
uint8_t |
state |
|
) |
| |
Enable motion sensor function.
- Parameters
-
state | Enable/Disable sensor |
@description This function enables/disables motion sensor by setting EN pin state.
◆ motion2_init()
Initialization function.
- Parameters
-
motion2 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.