radar 2.0.0.0
Radar Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ radar_cfg_setup()

void radar_cfg_setup ( radar_cfg_t * cfg)

Radar configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See radar_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ radar_default_cfg()

err_t radar_default_cfg ( radar_t * ctx)

Radar default configuration function.

This function executes a default configuration of Radar click board.

Parameters
[in]ctx: Click context object. See radar_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ radar_disable_device()

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.

Parameters
[in]ctx: Click context object. See radar_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ radar_enable_device()

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.

Parameters
[in]ctx: Click context object. See radar_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ radar_float_ieee_to_mchip()

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.

Returns
None.
Note
This is an empty function unless AI for PIC compiler is selected.

◆ radar_float_mchip_to_ieee()

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.

Returns
None.
Note
This is an empty function unless AI for PIC compiler is selected.

◆ radar_generic_read()

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.

Parameters
[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.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ radar_generic_write()

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.

Parameters
[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.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ radar_get_command()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error or Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ radar_get_event()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error or Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ radar_get_gpio0_pin()

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.

Parameters
[in]ctx: Click context object. See radar_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ radar_get_gpio1_pin()

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.

Parameters
[in]ctx: Click context object. See radar_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ radar_get_gpio2_pin()

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.

Parameters
[in]ctx: Click context object. See radar_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ radar_get_temperature()

err_t radar_get_temperature ( radar_t * ctx,
float * temperature )

Radar get temperature function.

This function reads the chip internal temperature.

Parameters
[in]ctx: Click context object. See radar_t object definition for detailed explanation.
[out]temperature: Chip internal temperature in Celsius.
Returns
  • 0 - Success,
  • -1 - Error or Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ radar_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ radar_reset_config()

err_t radar_reset_config ( radar_t * ctx)

Radar reset config function.

This function resets all configuration to default and performs a system reset.

Parameters
[in]ctx: Click context object. See radar_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error or Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ radar_set_command()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error or Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ radar_set_detection_range()

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.

Parameters
[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).
Returns
  • 0 - Success,
  • -1 - Error or Timeout. See #err_t definition for detailed explanation.
Note
None.