xensiv-radar-sensing
All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
High Level

General Description

RadarSensing high level interface functions.


Functions

cy_rslt_t mtb_radar_sensing_init (mtb_radar_sensing_context_t *context, const mtb_radar_sensing_hw_cfg_t *hw_cfg, mtb_radar_sensing_mask_t event_mask)
 This function allocates a new context of radar. More...
 
void mtb_radar_sensing_platform_set_malloc_free (void *(*malloc_func)(size_t), void(*free_func)(void *))
 This function sets the memory-managment functions used by the library. More...
 
cy_rslt_t mtb_radar_sensing_set_parameter (const mtb_radar_sensing_context_t *context, const char *key, const char *value)
 This function sets the value for a configuration parameter. More...
 
cy_rslt_t mtb_radar_sensing_get_parameter (const mtb_radar_sensing_context_t *context, const char *key, char *value, size_t size)
 This function gets the value of a configuration parameter. More...
 
cy_rslt_t mtb_radar_sensing_process (const mtb_radar_sensing_context_t *context, mtb_radar_sensing_timestamp_t timestamp)
 This function processes time domain data acquired from radar. More...
 
cy_rslt_t mtb_radar_sensing_enable (const mtb_radar_sensing_context_t *context)
 This function enables RadarSensing. More...
 
cy_rslt_t mtb_radar_sensing_disable (const mtb_radar_sensing_context_t *context)
 This function disables RadarSensing. More...
 
cy_rslt_t mtb_radar_sensing_free (mtb_radar_sensing_context_t *context)
 This functions frees up resources used by RadarSensing. More...
 

Function Documentation

◆ mtb_radar_sensing_init()

cy_rslt_t mtb_radar_sensing_init ( mtb_radar_sensing_context_t context,
const mtb_radar_sensing_hw_cfg_t hw_cfg,
mtb_radar_sensing_mask_t  event_mask 
)

This function allocates a new context of radar.

Parameters
contextContext of radar.
hw_cfgHW configuration of radar.
event_maskType of application events: mtb_radar_sensing_presence_events or mtb_radar_sensing_counter_events.
Returns
cy_rslt_t A success or a failure status.

This function allocates a new context of radar.

◆ mtb_radar_sensing_platform_set_malloc_free()

void mtb_radar_sensing_platform_set_malloc_free ( void *(*)(size_t)  malloc_func,
void(*)(void *)  free_func 
)

This function sets the memory-managment functions used by the library.

If your environment provides an alternative to the libc allocator functions, you can set them with function

Note
Must be called before mtb_radar_sensing_init
Parameters
malloc_funcFunction pointer to the malloc function implementation.
free_funcFunction pointer to the free function implementation.

◆ mtb_radar_sensing_set_parameter()

cy_rslt_t mtb_radar_sensing_set_parameter ( const mtb_radar_sensing_context_t context,
const char *  key,
const char *  value 
)

This function sets the value for a configuration parameter.

Note
It is not thread-safe to make calls to mtb_radar_sensing_set_parameter() while mtb_radar_sensing_process() is still active. A workaround in FreeRTOS would be to use each function in a different task and synchronize access via a mutex.

Supported keys and values for presence detection:

key default value valid values description
"radar_presence_range_max""2.0"0.66 - 10.2 mMaximum detection range. It is the maximum distance within which a target is detected.
"radar_presence_sensitivity""medium""low", "medium", "high"Adjusts the threshold values used in macro and micro movement detection.
High sensitivity would mean higher responsiveness towards macro and micro movements.

Supported keys and values for entrance counter:

key default value valid values/range description
"radar_counter_installation""side""ceiling", "side"The location of sensor installation.
"radar_counter_orientation""portrait""portrait", "landscape"The orientation of sensor.
"radar_counter_ceiling_height""2.5"0.0 - 3.0 mThe height at which the sensor is mounted. This parameter is only effective for a "ceiling" installation.
"radar_counter_entrance_width""1.0"0.0 - 3.0 mThe width of the passage or the entrance.
"radar_counter_sensitivity""0.5"0.0 - 1.0Sensitivity of counter.
"radar_counter_traffic_light_zone""1.0"0.0 - 1.0 mThe width of radar field of view that represents the detection zone.
"radar_counter_reverse""false""true", "false"Option to reverse directionality of counter.
"radar_counter_min_person_height""1.0"0.0 - 2.0 mThe minimum height of a person that is considered for detection. This is used to filter out pets.
Parameters
contextContext of radar.
keyThe type of configuration parameter that is to be set (e.g. "radar_presence_range_max").
valueThe value of the configuration parameter that is to be set as character string (e.g. "1.0").
Returns
cy_rslt_t A success or a failure status.

◆ mtb_radar_sensing_get_parameter()

cy_rslt_t mtb_radar_sensing_get_parameter ( const mtb_radar_sensing_context_t context,
const char *  key,
char *  value,
size_t  size 
)

This function gets the value of a configuration parameter.

Parameters
contextContext of radar.
keyThe type of configuration parameter that is to be read (e.g. "radar_presence_range_max").
valueString buffer where the read value will be written to.
sizeSize of the string buffer. If size of the string buffer is not large enough a failure status is returned.
Returns
cy_rslt_t A success or a failure status.

◆ mtb_radar_sensing_process()

cy_rslt_t mtb_radar_sensing_process ( const mtb_radar_sensing_context_t context,
mtb_radar_sensing_timestamp_t  timestamp 
)

This function processes time domain data acquired from radar.

mtb_radar_sensing_enable must be called prior to using this function. Must be called periodically from your main loop.

Parameters
contextContext of radar.
timestampSystem timestamp that will be used to approximate event timestamps in milliseconds.
Returns
cy_rslt_t A success or a failure status.

◆ mtb_radar_sensing_enable()

cy_rslt_t mtb_radar_sensing_enable ( const mtb_radar_sensing_context_t context)

This function enables RadarSensing.

Parameters
contextContext of radar.
Returns
cy_rslt_t A success or a failure status.

◆ mtb_radar_sensing_disable()

cy_rslt_t mtb_radar_sensing_disable ( const mtb_radar_sensing_context_t context)

This function disables RadarSensing.

Parameters
contextContext of radar.
Returns
cy_rslt_t A success or a failure status.

◆ mtb_radar_sensing_free()

cy_rslt_t mtb_radar_sensing_free ( mtb_radar_sensing_context_t context)

This functions frees up resources used by RadarSensing.

Parameters
contextContext of radar.
Returns
cy_rslt_t A success or a failure status.