speedradar 2.1.0.0
speedradar.h File Reference

This file contains API for Speed Radar Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  speedradar_t
 Speed Radar Click context object. More...
 
struct  speedradar_cfg_t
 Speed Radar Click configuration object. More...
 

Macros

#define SPEEDRADAR_CMD_PREFIX   "$"
 Speed Radar control commands.
 
#define SPEEDRADAR_CMD_ENTER   "\r\n"
 
#define SPEEDRADAR_CMD_RSP_PREFIX_VAL   0x40
 
#define SPEEDRADAR_ASCII_CHAR_0   48
 
#define SPEEDRADAR_NO_DET   0
 
#define SPEEDRADAR_MLP_TENS   10
 
#define SPEEDRADAR_MLP_HUNDREDS   100
 
#define SPEEDRADAR_CMD_SAMPLING_RATE   "S04"
 Speed Radar class S 8-Bit system parameters.
 
#define SPEEDRADAR_CMD_START_UP_LEARN   "S05"
 
#define SPEEDRADAR_CMD_FUN_MISC_OUT   "S06"
 
#define SPEEDRADAR_CMD_THOLD_OFFSET_MIN   "S07"
 
#define SPEEDRADAR_CMD_THOLD_OFFSET_MAX   "S08"
 
#define SPEEDRADAR_CMD_THOLD_NOISE   "S09"
 
#define SPEEDRADAR_CMD_FFT_AVERAGE   "S0A"
 
#define SPEEDRADAR_CMD_SENS_POT   "S0B"
 
#define SPEEDRADAR_CMD_HOLD_TIME_POT   "S0C"
 
#define SPEEDRADAR_CMD_MICRO_DETECTION   "S0D"
 
#define SPEEDRADAR_CMD_HOLD_TIME   "D00"
 Speed Radar class D 8-Bit detection parameters.
 
#define SPEEDRADAR_CMD_SENSITIVITY   "D01"
 
#define SPEEDRADAR_CMD_IMMUNITY   "D02"
 
#define SPEEDRADAR_CMD_DIR_DETECT   "D03"
 
#define SPEEDRADAR_CMD_SPEED_LIM_LOW   "D04"
 
#define SPEEDRADAR_CMD_SPEED_LIM_HIGH   "D05"
 
#define SPEEDRADAR_CMD_THOLD_SPEED_RANGE   "D06"
 
#define SPEEDRADAR_CMD_THOLD_MICRO_DET   "D07"
 
#define SPEEDRADAR_CMD_FFT_FILTER_WIDTH   "D08"
 
#define SPEEDRADAR_CMD_HOLD_TIME_0   "A00"
 Speed Radar class A 16-Bit array parameters.
 
#define SPEEDRADAR_CMD_HOLD_TIME_1   "A01"
 
#define SPEEDRADAR_CMD_HOLD_TIME_2   "A02"
 
#define SPEEDRADAR_CMD_HOLD_TIME_3   "A03"
 
#define SPEEDRADAR_CMD_HOLD_TIME_4   "A04"
 
#define SPEEDRADAR_CMD_HOLD_TIME_5   "A05"
 
#define SPEEDRADAR_CMD_HOLD_TIME_6   "A06"
 
#define SPEEDRADAR_CMD_HOLD_TIME_7   "A07"
 
#define SPEEDRADAR_CMD_HOLD_TIME_8   "A08"
 
#define SPEEDRADAR_CMD_HOLD_TIME_9   "A09"
 
#define SPEEDRADAR_CMD_HOLD_TIME_10   "A10"
 
#define SPEEDRADAR_CMD_HOLD_TIME_11   "A11"
 
#define SPEEDRADAR_CMD_HOLD_TIME_12   "A12"
 
#define SPEEDRADAR_CMD_HOLD_TIME_13   "A13"
 
#define SPEEDRADAR_CMD_HOLD_TIME_14   "A14"
 
#define SPEEDRADAR_CMD_HOLD_TIME_15   "A15"
 
#define SPEEDRADAR_CMD_HOLD_TIME_16   "A16"
 
#define SPEEDRADAR_CMD_HOLD_TIME_17   "A17"
 
#define SPEEDRADAR_CMD_HOLD_TIME_18   "A18"
 
#define SPEEDRADAR_CMD_HOLD_TIME_19   "A19"
 
#define SPEEDRADAR_CMD_HOLD_TIME_20   "A20"
 
#define SPEEDRADAR_CMD_HOLD_TIME_21   "A21"
 
#define SPEEDRADAR_CMD_HOLD_TIME_22   "A22"
 
#define SPEEDRADAR_CMD_HOLD_TIME_23   "A23"
 
#define SPEEDRADAR_CMD_HOLD_TIME_24   "A24"
 
#define SPEEDRADAR_CMD_HOLD_TIME_25   "A25"
 
#define SPEEDRADAR_CMD_HOLD_TIME_26   "A26"
 
#define SPEEDRADAR_CMD_HOLD_TIME_27   "A27"
 
#define SPEEDRADAR_CMD_HOLD_TIME_28   "A28"
 
#define SPEEDRADAR_CMD_HOLD_TIME_29   "A29"
 
#define SPEEDRADAR_CMD_GET_SW_VERSION   "F00"
 Speed Radar class F 16-Bit flash read parameters.
 
#define SPEEDRADAR_CMD_GET_TYPE_OF_DEVICE   "F01"
 
#define SPEEDRADAR_CMD_GET_DET_REG   "R00"
 Speed Radar class R 8-Bit real-time read parameters.
 
#define SPEEDRADAR_CMD_GET_DET_SPEED   "R01"
 
#define SPEEDRADAR_CMD_GET_DET_MAG   "R02"
 
#define SPEEDRADAR_CMD_GET_NOISE_LVL   "R03"
 
#define SPEEDRADAR_CMD_GET_OP_STATE   "R04"
 
#define SPEEDRADAR_CMD_GET_H_TIME_POT_IDX   "R05"
 
#define SPEEDRADAR_CMD_GET_SENS_POT_IDX   "R06"
 
#define SPEEDRADAR_CMD_RESET_PROCESSOR   "W00"
 Speed Radar class W 8-Bit basic write parameters.
 
#define SPEEDRADAR_CMD_RST_FAC_STG   "W01"
 
#define SPEEDRADAR_CMD_SET_UART_BAUD_RATE   "W02"
 
#define SPEEDRADAR_CMD_GET_DETECTION_STR   "C00"
 Speed Radar class C variable length complex read parameters.
 
#define SPEEDRADAR_CMD_GET_TARGET_STR   "C01"
 
#define SPEEDRADAR_CMD_GET_EEPROM   "C02"
 
#define SPEEDRADAR_CMD_GET_FFT_SPECTRUM   "C03"
 
#define SPEEDRADAR_CMD_GET_ADC_IQ   "C04"
 
#define SPEEDRADAR_CMD_GET_ADC_IQ_ADD_PARAM   "C05"
 
#define SPEEDRADAR_CMD_GET_ALL_DATA   "C06"
 
#define SPEEDRADAR_CMD_ACT_TEST_MODE   "T00"
 Speed Radar class T 8-Bit testing parameters.
 
#define SPEEDRADAR_CMD_FORCE_DET_OUT   "T01"
 
#define SPEEDRADAR_CMD_FORCE_MISC_OUT   "T02"
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X1   "01"
 Speed Radar sampling rate parameters.
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X2   "02"
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X3   "03"
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X4   "04"
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X5   "05"
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X6   "06"
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X7   "07"
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X8   "08"
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X9   "09"
 
#define SPEEDRADAR_SET_SAMPLING_RATE_X10   "0A"
 
#define SPEEDRADAR_SAMPLING_RATE_1280_HZ   1280.0f
 Speed Radar sampling rate values.
 
#define SPEEDRADAR_SAMPLING_RATE_2560_HZ   2560.0f
 
#define SPEEDRADAR_SAMPLING_RATE_3840_HZ   3840.0f
 
#define SPEEDRADAR_SAMPLING_RATE_5120_HZ   5120.0f
 
#define SPEEDRADAR_SAMPLING_RATE_6400_HZ   6400.0f
 
#define SPEEDRADAR_SAMPLING_RATE_7680_HZ   7680.0f
 
#define SPEEDRADAR_SAMPLING_RATE_8960_HZ   8960.0f
 
#define SPEEDRADAR_SAMPLING_RATE_10240_HZ   10240.0f
 
#define SPEEDRADAR_SAMPLING_RATE_11520_HZ   11520.0f
 
#define SPEEDRADAR_SAMPLING_RATE_12800_HZ   12800.0f
 
#define SPEEDRADAR_SET_MISC_OUT_DET   "00"
 Speed Radar miscellaneous output parameters.
 
#define SPEEDRADAR_SET_MISC_OUT_DIR   "01"
 
#define SPEEDRADAR_SET_MISC_OUT_RNG   "02"
 
#define SPEEDRADAR_SET_MISC_OUT_MDET   "03"
 
#define SPEEDRADAR_R00_DET_NO   0x00
 Speed Radar class R 8-Bit real-time read parameters, respond values bit mask.
 
#define SPEEDRADAR_R00_DET_VALID   0x01
 
#define SPEEDRADAR_R00_DIR_BACKWARD   0x00
 
#define SPEEDRADAR_R00_DIR_FORWARD   0x02
 
#define SPEEDRADAR_R00_RANGE_LOW_SPEED   0x00
 
#define SPEEDRADAR_R00_RANGE_HIGH_SPEED   0x04
 
#define SPEEDRADAR_R00_MICRO_DET_NO   0x00
 
#define SPEEDRADAR_R00_MICRO_DET_VALID   0x08
 
#define SPEEDRADAR_ERR_MSG   "@E0"
 Speed Radar error messages parameters.
 
#define SPEEDRADAR_ERR_VAL_OUT_LIM   "@E01"
 
#define SPEEDRADAR_ERR_PAR_NUM_NOT_EXIST   "@E02"
 
#define SPEEDRADAR_ERR_CMD_NOT_EXIST   "@E03"
 
#define SPEEDRADAR_ERR_WR_EEPROM   "@E04"
 
#define SPEEDRADAR_ERR_CMD_FORMAT   "@E05"
 
#define SPEEDRADAR_ERR_UART_COMM   "@E06"
 
#define SPEEDRADAR_TX_DRV_BUFFER_SIZE   100
 Speed Radar driver buffer size.
 
#define SPEEDRADAR_RX_DRV_BUFFER_SIZE   200
 
#define SPEEDRADAR_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  speedradar_return_value_t { SPEEDRADAR_OK = 0 , SPEEDRADAR_ERROR = -1 }
 Speed Radar Click return value data. More...
 

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

This file contains API for Speed Radar Click Driver.

Enumeration Type Documentation

◆ speedradar_return_value_t

Speed Radar Click return value data.

Predefined enum values for driver return values.

Enumerator
SPEEDRADAR_OK 
SPEEDRADAR_ERROR