speedradar
2.1.0.0
|
API for configuring and manipulating Speed Radar Click driver. More...
Modules | |
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. More... | |
err_t | speedradar_init (speedradar_t *ctx, speedradar_cfg_t *cfg) |
Speed Radar initialization function. More... | |
err_t | speedradar_default_cfg (speedradar_t *ctx) |
Speed Radar default configuration function. More... | |
err_t | speedradar_generic_write (speedradar_t *ctx, uint8_t *data_in, uint16_t len) |
Speed Radar data writing function. More... | |
err_t | speedradar_generic_read (speedradar_t *ctx, uint8_t *data_out, uint16_t len) |
Speed Radar data reading function. More... | |
err_t | speedradar_send_command (speedradar_t *ctx, uint8_t *cmd) |
Speed Radar send command function. More... | |
err_t | speedradar_send_command_value (speedradar_t *ctx, uint8_t *cmd, uint8_t *cmd_value) |
Speed Radar send command function. More... | |
uint8_t | speedradar_get_direction (speedradar_t *ctx) |
Speed Radar get direction function. More... | |
uint8_t | speedradar_get_detection (speedradar_t *ctx) |
Speed Radar get detection function. More... | |
API for configuring and manipulating Speed Radar Click driver.
void speedradar_cfg_setup | ( | speedradar_cfg_t * | cfg | ) |
Speed Radar configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See speedradar_cfg_t object definition for detailed explanation. |
err_t speedradar_default_cfg | ( | speedradar_t * | ctx | ) |
Speed Radar default configuration function.
This function executes a default configuration of Speed Radar click board.
[in] | ctx | : Click context object. See speedradar_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. 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.
[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. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. 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™.
[in] | ctx | : Click context object. See speedradar_t object definition for detailed explanation. |
0
- No detection, 1
- Valid detection. 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™.
[in] | ctx | : Click context object. See speedradar_t object definition for detailed explanation. |
0
- Backward/receding movement, 1
- Forward/approaching movement. Detection
, Direction
, Range
, Micro-Detection
. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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™.
[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. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. 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™.
[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]. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation.