motion4 2.0.0.0
Motion 4 Click Driver

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

Topics

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

Enumerations

enum  motion4_detect_state_t { MOTION4_NO_DETECT = 0 , MOTION4_DETECTED }
 
enum  motion4_pin_state_t { MOTION4_PIN_STATE_LOW = 0 , MOTION4_PIN_STATE_HIGH }
 

Functions

void motion4_cfg_setup (motion4_cfg_t *cfg)
 Motion 4 configuration object setup function.
 
err_t motion4_init (motion4_t *ctx, motion4_cfg_t *cfg)
 Motion 4 initialization function.
 
void motion4_enable (motion4_t *ctx, uint8_t state)
 Enable motion sensor function.
 
uint8_t motion4_detect_state (motion4_t *ctx)
 Get detection state function.
 

Detailed Description

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

◆ motion4_detect_state_t

Enumerator
MOTION4_NO_DETECT 
MOTION4_DETECTED 

◆ motion4_pin_state_t

Enumerator
MOTION4_PIN_STATE_LOW 
MOTION4_PIN_STATE_HIGH 

Function Documentation

◆ motion4_cfg_setup()

void motion4_cfg_setup ( motion4_cfg_t * cfg)

Motion 4 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See motion4_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ motion4_detect_state()

uint8_t motion4_detect_state ( motion4_t * ctx)

Get detection state function.

This function returns INT pin state.

Parameters
[out]ctx: Click context object. See motion4_t object definition for detailed explanation.
Returns
  • 1 - Detected.
  • 0 - Not detected.
Note
None.

◆ motion4_enable()

void motion4_enable ( motion4_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 motion4_t object definition for detailed explanation.
[in]stateEnable/Disable sensor
Returns
Nothing.
Note
None.

◆ motion4_init()

err_t motion4_init ( motion4_t * ctx,
motion4_cfg_t * cfg )

Motion 4 initialization function.

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

Parameters
[out]ctx: Click context object. See motion4_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See motion4_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.