motion3 2.0.0.0
Motion 3 Click Driver

API for configuring and manipulating Motion 3 Click driver. More...

Topics

 Motion 3 MikroBUS Map
 MikroBUS pin mapping of Motion 3 Click driver.
 
 Motion 3 MikroBUS Map
 MikroBUS pin mapping of Motion 3 Click driver.
 

Enumerations

enum  motion3_detect_state_t { MOTION3_NO_DETECT = 0 , MOTION3_DETECTED }
 
enum  motion3_pin_state_t { MOTION3_PIN_STATE_LOW = 0 , MOTION3_PIN_STATE_HIGH }
 

Functions

void motion3_cfg_setup (motion3_cfg_t *cfg)
 Motion 3 configuration object setup function.
 
err_t motion3_init (motion3_t *ctx, motion3_cfg_t *cfg)
 Motion 3 initialization function.
 
void motion3_enable (motion3_t *ctx, uint8_t state)
 Enable motion sensor function.
 
uint8_t motion3_detect_state (motion3_t *ctx)
 Get detection state function.
 

Detailed Description

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.

Enumeration Type Documentation

◆ motion3_detect_state_t

Enumerator
MOTION3_NO_DETECT 
MOTION3_DETECTED 

◆ motion3_pin_state_t

Enumerator
MOTION3_PIN_STATE_LOW 
MOTION3_PIN_STATE_HIGH 

Function Documentation

◆ motion3_cfg_setup()

void motion3_cfg_setup ( motion3_cfg_t * cfg)

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]stateEnable/Disable sensor
Returns
Nothing.
Note
None.

◆ motion3_init()

err_t motion3_init ( motion3_t * ctx,
motion3_cfg_t * cfg )

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
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.