motion2 2.0.0.0
Motion 2 Click Driver

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

Topics

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

Enumerations

enum  motion2_detect_state_t { MOTION2_NO_DETECT = 0 , MOTION2_DETECTED }
 
enum  motion2_pin_state_t { MOTION2_PIN_STATE_LOW = 0 , MOTION2_PIN_STATE_HIGH }
 

Functions

void motion2_cfg_setup (motion2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t motion2_init (motion2_t *ctx, motion2_cfg_t *cfg)
 Initialization function.
 
void motion2_enable (motion2_t *ctx, uint8_t state)
 Enable motion sensor function.
 
uint8_t motion2_detect_state (motion2_t *ctx)
 Get detection state function.
 

Detailed Description

API for configuring and manipulating Motion 2 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

◆ motion2_detect_state_t

Enumerator
MOTION2_NO_DETECT 
MOTION2_DETECTED 

◆ motion2_pin_state_t

Enumerator
MOTION2_PIN_STATE_LOW 
MOTION2_PIN_STATE_HIGH 

Function Documentation

◆ motion2_cfg_setup()

void motion2_cfg_setup ( motion2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick 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
stateEnable/Disable sensor

@description This function enables/disables motion sensor by setting EN pin state.

◆ motion2_init()

err_t motion2_init ( motion2_t * ctx,
motion2_cfg_t * cfg )

Initialization function.

Parameters
motion2Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.