speedradar 2.1.0.0
Speed Radar Click Driver

API for configuring and manipulating Speed Radar Click driver. More...

Topics

 Speed Radar Device Settings
 Settings for command of Speed Radar Click driver.
 
 Speed Radar MikroBUS Map
 MikroBUS pin mapping of Speed Radar Click driver.
 

Functions

void speedradar_cfg_setup (speedradar_cfg_t *cfg)
 Speed Radar configuration object setup function.
 
err_t speedradar_init (speedradar_t *ctx, speedradar_cfg_t *cfg)
 Speed Radar initialization function.
 
err_t speedradar_default_cfg (speedradar_t *ctx)
 Speed Radar default configuration function.
 
err_t speedradar_generic_write (speedradar_t *ctx, uint8_t *data_in, uint16_t len)
 Speed Radar data writing function.
 
err_t speedradar_generic_read (speedradar_t *ctx, uint8_t *data_out, uint16_t len)
 Speed Radar data reading function.
 
err_t speedradar_send_command (speedradar_t *ctx, uint8_t *cmd)
 Speed Radar send command function.
 
err_t speedradar_send_command_value (speedradar_t *ctx, uint8_t *cmd, uint8_t *cmd_value)
 Speed Radar send command function.
 
uint8_t speedradar_get_direction (speedradar_t *ctx)
 Speed Radar get direction function.
 
uint8_t speedradar_get_detection (speedradar_t *ctx)
 Speed Radar get detection function.
 

Detailed Description

API for configuring and manipulating Speed 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

◆ speedradar_cfg_setup()

void speedradar_cfg_setup ( speedradar_cfg_t * cfg)

Speed Radar configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ speedradar_default_cfg()

err_t speedradar_default_cfg ( speedradar_t * ctx)

Speed Radar default configuration function.

This function executes a default configuration of Speed Radar click board.

Parameters
[in]ctx: Click context object. See speedradar_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.

◆ speedradar_generic_read()

err_t speedradar_generic_read ( speedradar_t * ctx,
uint8_t * data_out,
uint16_t len )

Speed 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 speedradar_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]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.

◆ speedradar_generic_write()

err_t speedradar_generic_write ( speedradar_t * ctx,
uint8_t * data_in,
uint16_t len )

Speed 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 speedradar_t object definition for detailed explanation.
[in]data_in: 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.

◆ speedradar_get_detection()

uint8_t speedradar_get_detection ( speedradar_t * ctx)

Speed Radar get detection function.

This function return state of the detection of a movement of the K-LD2, radar transceiver on the Speed Radar click board™.

Parameters
[in]ctx: Click context object. See speedradar_t object definition for detailed explanation.
Returns
  • 0 - No detection,
  • 1 - Valid detection.
Note
None.

◆ speedradar_get_direction()

uint8_t speedradar_get_direction ( speedradar_t * ctx)

Speed Radar get direction function.

This function return state of the direction of a movement of the K-LD2, radar transceiver on the Speed Radar click board™.

Parameters
[in]ctx: Click context object. See speedradar_t object definition for detailed explanation.
Returns
  • 0 - Backward/receding movement,
  • 1 - Forward/approaching movement.
Note
Detection of the direction of a movement is default configuration of the miscellaneous output pin. Supported configurations:
  • Detection,
  • Direction,
  • Range,
  • Micro-Detection.

◆ speedradar_init()

err_t speedradar_init ( speedradar_t * ctx,
speedradar_cfg_t * cfg )

Speed Radar initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See speedradar_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See speedradar_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ speedradar_send_command()

err_t speedradar_send_command ( speedradar_t * ctx,
uint8_t * cmd )

Speed Radar send command function.

This function sends a desired command of the K-LD2, radar transceiver on the Speed Radar click board™.

Parameters
[in]ctx: Click context object. See speedradar_t object definition for detailed explanation.
[in]cmd: Command data array. See #speedradar_cmd definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ speedradar_send_command_value()

err_t speedradar_send_command_value ( speedradar_t * ctx,
uint8_t * cmd,
uint8_t * cmd_value )

Speed Radar send command function.

This function sends a desired command of the K-LD2, radar transceiver on the Speed Radar click board™.

Parameters
[in]ctx: Click context object. See speedradar_t object definition for detailed explanation.
[in]cmd: Command data array. See #speedradar_cmd definition for detailed explanation.
[in]cmd_value: Command value data [(Hex) 8-Bit or 16-Bit wide].
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.