motion  2.0.0.0
Functions
Public function

Functions

void motion_cfg_setup (motion_cfg_t *cfg)
 Config Object Initialization function. More...
 
MOTION_RETVAL motion_init (motion_t *ctx, motion_cfg_t *cfg)
 Initialization function. More...
 
void motion_default_cfg (motion_t *ctx)
 Click Default Configuration function. More...
 
void motion_set_en_pin (motion_t *ctx, motion_pin_state_t en_state)
 Set states of the enable pin. More...
 
motion_pin_state_t motion_get_detected (motion_t *ctx)
 Motion detected function. More...
 

Detailed Description

Function Documentation

◆ motion_cfg_setup()

void motion_cfg_setup ( motion_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.

◆ motion_default_cfg()

void motion_default_cfg ( motion_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Motion click.

Note
Places the sensor in detection mode.

◆ motion_get_detected()

motion_pin_state_t motion_get_detected ( motion_t ctx)

Motion detected function.

Parameters
ctxClick object.
out_pin_state
  • MOTION_NO_DETECT : motion is not detected.
  • MOTION_DETECTED : motion is detected.

@description Function detect motion and return MOTION_DETECTED ( 1 ) if a motion is detected or MOTION_NO_DETECT ( 0 ) if a motion is not detected.

◆ motion_init()

MOTION_RETVAL motion_init ( motion_t ctx,
motion_cfg_t cfg 
)

Initialization function.

Parameters
motionClick object.
cfgClick configuration structure.

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

◆ motion_set_en_pin()

void motion_set_en_pin ( motion_t ctx,
motion_pin_state_t  en_state 
)

Set states of the enable pin.

Parameters
ctxClick object.
en_state
  • MOTION_PIN_STATE_LOW : disables the sensor.
  • MOTION_PIN_STATE_HIGH : enable, places the sensor in detection mode.

@description This function sets states of the EN ( RST ) pin for Motion click.

Note
 Places the sensor in detection mode.