RadarSensing high level interface functions.
◆ mtb_radar_sensing_init()
This function allocates a new context of radar.
- Parameters
-
context | Context of radar. |
hw_cfg | HW configuration of radar. |
event_mask | Type 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_func | Function pointer to the malloc function implementation. |
free_func | Function pointer to the free function implementation. |
◆ mtb_radar_sensing_set_parameter()
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 m | Maximum 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 m | The 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 m | The width of the passage or the entrance. |
"radar_counter_sensitivity" | "0.5" | 0.0 - 1.0 | Sensitivity of counter. |
"radar_counter_traffic_light_zone" | "1.0" | 0.0 - 1.0 m | The 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 m | The minimum height of a person that is considered for detection. This is used to filter out pets. |
- Parameters
-
context | Context of radar. |
key | The type of configuration parameter that is to be set (e.g. "radar_presence_range_max"). |
value | The 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()
This function gets the value of a configuration parameter.
- Parameters
-
context | Context of radar. |
key | The type of configuration parameter that is to be read (e.g. "radar_presence_range_max"). |
value | String buffer where the read value will be written to. |
size | Size 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()
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
-
context | Context of radar. |
timestamp | System 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()
This function enables RadarSensing.
- Parameters
-
- Returns
- cy_rslt_t A success or a failure status.
◆ mtb_radar_sensing_disable()
This function disables RadarSensing.
- Parameters
-
- Returns
- cy_rslt_t A success or a failure status.
◆ mtb_radar_sensing_free()
This functions frees up resources used by RadarSensing.
- Parameters
-
- Returns
- cy_rslt_t A success or a failure status.