API for configuring and manipulating Motion 3 Click driver.
More...
API for configuring and manipulating Motion 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
◆ motion3_detect_state_t
Enumerator |
---|
MOTION3_NO_DETECT | |
MOTION3_DETECTED | |
◆ motion3_pin_state_t
Enumerator |
---|
MOTION3_PIN_STATE_LOW | |
MOTION3_PIN_STATE_HIGH | |
◆ motion3_cfg_setup()
Motion 3 configuration object setup function.
This function initializes click configuration structure to initial values.
- Parameters
-
[out] | cfg | : Click configuration structure. See motion3_cfg_t object definition for detailed explanation. |
- Returns
- Nothing.
- Note
- The all used pins will be set to unconnected state.
◆ motion3_detect_state()
uint8_t motion3_detect_state |
( |
motion3_t * | ctx | ) |
|
Get detection state function.
This function returns INT pin state.
- Parameters
-
[out] | ctx | : Click context object. See motion3_t object definition for detailed explanation. |
- Returns
1
- Detected.
0
- Not detected.
- Note
- None.
◆ motion3_enable()
void motion3_enable |
( |
motion3_t * | ctx, |
|
|
uint8_t | state ) |
Enable motion sensor function.
This function enables/disables motion sensor by setting EN pin state.
- Parameters
-
[out] | ctx | : Click context object. See motion3_t object definition for detailed explanation. |
[in] | state | Enable/Disable sensor |
- Returns
- Nothing.
- Note
- None.
◆ motion3_init()
Motion 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
- Parameters
-
[out] | ctx | : Click context object. See motion3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See motion3_cfg_t object definition for detailed explanation. |
- Returns
-
See #err_t definition for detailed explanation.
- Note
- None.