Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Re200b_pir_sensor_group

Low-level driver for the re200b pir sensor.

This driver provides access to the main features of the re200b pir sensor.

Modules

 

Functions

void re200b_motion_detect_disable (void)
 Disable re200b pir sensor. More...
 
void re200b_motion_detect_enable (void)
 Enable re200b pir sensor. More...
 
e_cmp_res re200b_motion_detect_get_compare_result (void)
 return comparison result More...
 
void re200b_motion_detect_handler (void)
 re200b_motion_detect_handler which allow to know comparison result (CMP_GREATER or CMP_LESS) More...
 
void re200b_motion_detect_init (uint32_t ul_acc_minus, uint32_t ul_acc_plus)
 Initialize re200b sensor in order to detect motion. More...
 
void re200b_motion_detect_reset (void)
 Reset variable used in re200b sensor functions. More...
 
uint32_t re200b_motion_detection (void)
 Allow to know if a motion was detected. More...
 

Variables

static volatile e_cmp_res g_compare_result = CMP_EQUAL
 indicate type of comparison event(CMP_GREATER or CMP_LESS) More...
 
volatile uint32_t g_ul_compare_event_flag = false
 indicate if there's any comparison event triggered More...
 

void re200b_motion_detect_disable ( void  )

Disable re200b pir sensor.

References acc_disable(), and acc_disable_interrupt().

Referenced by main().

void re200b_motion_detect_enable ( void  )

Enable re200b pir sensor.

References acc_enable(), and acc_enable_interrupt().

Referenced by main().

e_cmp_res re200b_motion_detect_get_compare_result ( void  )

return comparison result

References g_compare_result.

void re200b_motion_detect_handler ( void  )

re200b_motion_detect_handler which allow to know comparison result (CMP_GREATER or CMP_LESS)

References acc_get_comparison_result(), acc_get_interrupt_status(), CMP_GREATER, and CMP_LESS.

Referenced by ACC_Handler().

void re200b_motion_detect_init ( uint32_t  ul_acc_minus,
uint32_t  ul_acc_plus 
)

Initialize re200b sensor in order to detect motion.

Parameters
ul_acc_minusACC minus input, use ACC peripheral definition in header.
ul_acc_plusACC plus input, use ACC peripheral definition in header.

References acc_get_interrupt_status(), acc_init(), CMP_EQUAL, and pmc_enable_periph_clk().

Referenced by main().

void re200b_motion_detect_reset ( void  )

Reset variable used in re200b sensor functions.

References CMP_EQUAL.

Referenced by main().

uint32_t re200b_motion_detection ( void  )

Allow to know if a motion was detected.

Returns
1 if motion is detected; 0 otherwise

References CMP_GREATER.

Referenced by main().

volatile e_cmp_res g_compare_result = CMP_EQUAL
static
volatile uint32_t g_ul_compare_event_flag = false

indicate if there's any comparison event triggered