radar 2.0.0.0
|
API for configuring and manipulating Radar Click driver. More...
Topics | |
Radar Device Settings | |
Settings for registers of Radar Click driver. | |
Radar MikroBUS Map | |
MikroBUS pin mapping of Radar Click driver. | |
Functions | |
void | radar_cfg_setup (radar_cfg_t *cfg) |
Radar configuration object setup function. | |
err_t | radar_init (radar_t *ctx, radar_cfg_t *cfg) |
Radar initialization function. | |
err_t | radar_default_cfg (radar_t *ctx) |
Radar default configuration function. | |
err_t | radar_generic_write (radar_t *ctx, uint8_t *data_buf, uint16_t len) |
Radar data writing function. | |
err_t | radar_generic_read (radar_t *ctx, uint8_t *data_buf, uint16_t max_len) |
Radar data reading function. | |
void | radar_enable_device (radar_t *ctx) |
Radar enable device function. | |
void | radar_disable_device (radar_t *ctx) |
Radar disable device function. | |
uint8_t | radar_get_gpio2_pin (radar_t *ctx) |
Radar get gpio 2 pin function. | |
uint8_t | radar_get_gpio1_pin (radar_t *ctx) |
Radar get gpio 1 pin function. | |
uint8_t | radar_get_gpio0_pin (radar_t *ctx) |
Radar get gpio 0 pin function. | |
err_t | radar_set_command (radar_t *ctx, uint8_t cmd_id, uint8_t *payload, uint8_t payload_size) |
Radar set command function. | |
err_t | radar_get_command (radar_t *ctx, uint8_t cmd_id, uint8_t *payload, uint8_t *payload_size) |
Radar get command function. | |
err_t | radar_get_event (radar_t *ctx, uint8_t *evt_id, uint8_t *payload, uint8_t *payload_size) |
Radar get event function. | |
err_t | radar_get_temperature (radar_t *ctx, float *temperature) |
Radar get temperature function. | |
err_t | radar_set_detection_range (radar_t *ctx, float min, float max) |
Radar set detection range function. | |
err_t | radar_reset_config (radar_t *ctx) |
Radar reset config function. | |
void | radar_float_ieee_to_mchip (float *f_data) |
Radar float ieee to mchip function. | |
void | radar_float_mchip_to_ieee (float *f_data) |
Radar float ieee to mchip function. | |
API for configuring and manipulating Radar Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void radar_cfg_setup | ( | radar_cfg_t * | cfg | ) |
Radar configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See radar_cfg_t object definition for detailed explanation. |
err_t radar_default_cfg | ( | radar_t * | ctx | ) |
Radar default configuration function.
This function executes a default configuration of Radar click board.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void radar_disable_device | ( | radar_t * | ctx | ) |
Radar disable device function.
This function disables the device by setting the RST pin to high logic state.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
void radar_enable_device | ( | radar_t * | ctx | ) |
Radar enable device function.
This function enables the device by setting the RST pin to low logic state.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
void radar_float_ieee_to_mchip | ( | float * | f_data | ) |
Radar float ieee to mchip function.
This function converts the float IEEE-754 to Microchip representation.
void radar_float_mchip_to_ieee | ( | float * | f_data | ) |
Radar float ieee to mchip function.
This function converts the float IEEE-754 to Microchip representation.
err_t radar_generic_read | ( | radar_t * | ctx, |
uint8_t * | data_buf, | ||
uint16_t | max_len ) |
Radar data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
[out] | data_buf | : Output read data. |
[in] | max_len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. err_t radar_generic_write | ( | radar_t * | ctx, |
uint8_t * | data_buf, | ||
uint16_t | len ) |
Radar data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
[in] | data_buf | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t radar_get_command | ( | radar_t * | ctx, |
uint8_t | cmd_id, | ||
uint8_t * | payload, | ||
uint8_t * | payload_size ) |
Radar get command function.
This function sends a desired get command to the module and waits for a response.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
[in] | cmd_id | : Get command ID. |
[out] | payload | : Command payload content. |
[out] | payload_size | : Command payload size in bytes. |
0
- Success, -1
- Error or Timeout. See #err_t definition for detailed explanation. err_t radar_get_event | ( | radar_t * | ctx, |
uint8_t * | evt_id, | ||
uint8_t * | payload, | ||
uint8_t * | payload_size ) |
Radar get event function.
This function waits for an IN/OUT event or ACK command response.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
[out] | evt_id | : Event ID. |
[out] | payload | : Event payload content. |
[out] | payload_size | : Event payload size in bytes. |
0
- Success, -1
- Error or Timeout. See #err_t definition for detailed explanation. uint8_t radar_get_gpio0_pin | ( | radar_t * | ctx | ) |
Radar get gpio 0 pin function.
This function returns the GPIO 0 (no presence indication) pin logic state.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
uint8_t radar_get_gpio1_pin | ( | radar_t * | ctx | ) |
Radar get gpio 1 pin function.
This function returns the GPIO 1 (presence detected indication) pin logic state.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
uint8_t radar_get_gpio2_pin | ( | radar_t * | ctx | ) |
Radar get gpio 2 pin function.
This function returns the GPIO 2 (bootloader mode indication) pin logic state.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
err_t radar_get_temperature | ( | radar_t * | ctx, |
float * | temperature ) |
Radar get temperature function.
This function reads the chip internal temperature.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
[out] | temperature | : Chip internal temperature in Celsius. |
0
- Success, -1
- Error or Timeout. See #err_t definition for detailed explanation. err_t radar_init | ( | radar_t * | ctx, |
radar_cfg_t * | cfg ) |
Radar initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See radar_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t radar_reset_config | ( | radar_t * | ctx | ) |
Radar reset config function.
This function resets all configuration to default and performs a system reset.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
0
- Success, -1
- Error or Timeout. See #err_t definition for detailed explanation. err_t radar_set_command | ( | radar_t * | ctx, |
uint8_t | cmd_id, | ||
uint8_t * | payload, | ||
uint8_t | payload_size ) |
Radar set command function.
This function sends a desired set command with payload to the module and waits for an ACK response.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
[in] | cmd_id | : Set command ID. |
[in] | payload | : Command payload content. |
[in] | payload_size | : Command payload size in bytes. |
0
- Success, -1
- Error or Timeout. See #err_t definition for detailed explanation. err_t radar_set_detection_range | ( | radar_t * | ctx, |
float | min, | ||
float | max ) |
Radar set detection range function.
This function sets the min and max presence detection values.
[in] | ctx | : Click context object. See radar_t object definition for detailed explanation. |
[in] | min | : Minimal detection level in meters [0.0 - 10.0]. |
[in] | max | : Maximal detection level in meters [0.2 - 10.0] (Must be >= min). |
0
- Success, -1
- Error or Timeout. See #err_t definition for detailed explanation.