2016-09-18 08:05:46 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
2016-09-27 16:30:52 +02:00
|
|
|
#define MEAS_LOOP_CNT 20
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
2016-09-18 11:41:59 +02:00
|
|
|
/* Message byte definitions: */
|
|
|
|
#define MSG_SOM1 0x3c
|
|
|
|
#define MSG_SOM2 0x3e
|
|
|
|
#define MSG_EOM1 0x0d
|
|
|
|
#define MSG_EOM2 0x0a
|
|
|
|
|
2016-09-19 21:09:21 +02:00
|
|
|
#define MSG_TYPE_ANSWER_OK 0x01
|
|
|
|
#define MSG_TYPE_ANSWER_NOK 0x02
|
|
|
|
#define MSG_TYPE_MEAS_FREQ_INFO 0x03
|
|
|
|
#define MSG_TYPE_MEAS_END_INFO 0x04
|
|
|
|
#define MSG_TYPE_CONFIG 0x05
|
2016-09-18 11:41:59 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#define CC_STATE_READ_SOM1 20
|
|
|
|
#define CC_STATE_READ_SOM2 30
|
|
|
|
#define CC_STATE_READ_CMD 40
|
|
|
|
#define CC_STATE_READ_DATA 50
|
|
|
|
#define CC_STATE_READ_EOM1 60
|
|
|
|
#define CC_STATE_READ_EOM2 70
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#define CC_CMD_NO_CMD 0
|
|
|
|
|
|
|
|
#define MSG_INCOMPLETE 10
|
|
|
|
#define MSG_COMPLETE 20
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#define CC_CMD_SET_START_FREQ 0x01
|
|
|
|
#define CC_CMD_SET_END_FREQ 0x02
|
|
|
|
#define CC_CMD_SET_INTERVALL 0x03
|
|
|
|
#define CC_CMD_SET_DRIVE_STRENGTH 0x04
|
2016-09-19 21:09:21 +02:00
|
|
|
#define CC_CMD_SET_FREQ_STEP 0x05
|
|
|
|
#define CC_CMD_START_MEASUREMENT 0x06
|
|
|
|
#define CC_CMD_GET_CONFIG 0x10
|
2016-09-28 14:43:05 +02:00
|
|
|
#define CC_CMD_EN_CLK 0x20
|
|
|
|
#define CC_CMD_DIS_CLK 0x21
|
|
|
|
#define CC_CMD_SAV_DFLT 0x22
|
2016-10-12 20:32:46 +02:00
|
|
|
#define CC_CMD_SET_CLK_CORR 0x23
|
|
|
|
#define CC_CMD_GET_CLK_CORR 0x24
|
2016-09-18 11:41:59 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#define CC_CMD_SET_START_FREQ_FUNC &cc_setStartFreq
|
|
|
|
#define CC_CMD_SET_END_FREQ_FUNC &cc_setEndFreq
|
|
|
|
#define CC_CMD_SET_INTERVALL_FUNC &cc_setIntervall
|
|
|
|
#define CC_CMD_SET_DRIVE_STRENGTH_FUNC &cc_setDriveStrength
|
2016-09-19 21:09:21 +02:00
|
|
|
#define CC_CMD_SET_FREQ_STEP_FUNC &cc_setFreqStep
|
2016-09-18 11:41:59 +02:00
|
|
|
#define CC_CMD_START_MEASUREMENT_FUNC &cc_startMeasurement
|
2016-09-19 21:09:21 +02:00
|
|
|
#define CC_CMD_GET_CONFIG_FUNC &cc_getConfig
|
2016-09-28 14:43:05 +02:00
|
|
|
#define CC_CMD_EN_CLK_FUNC &cc_enableClk
|
|
|
|
#define CC_CMD_DIS_CLK_FUNC &cc_disableClk
|
|
|
|
#define CC_CMD_SAV_DFLT_FUNC &cc_saveDefaults
|
2016-10-12 20:32:46 +02:00
|
|
|
#define CC_CMD_SET_CLK_CORR_FUNC &cc_setClkCorrection
|
|
|
|
#define CC_CMD_GET_CLK_CORR_FUNC &cc_getClkCorrection
|
2016-09-18 11:41:59 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#define CC_CMD_SET_START_FREQ_DATA_TO_READ 4 // up to 32 bit = 4 byte => 2 ** 32 = >500000000Hz
|
|
|
|
#define CC_CMD_SET_END_FREQ_DATA_TO_READ 4 // up to 32 bit = 4 byte => 2 ** 32 = >500000000Hz
|
2016-09-19 21:09:21 +02:00
|
|
|
#define CC_CMD_SET_INTERVALL_DATA_TO_READ 2
|
2016-09-18 11:41:59 +02:00
|
|
|
#define CC_CMD_SET_DRIVE_STRENGTH_DATA_TO_READ 1
|
2016-09-19 21:09:21 +02:00
|
|
|
#define CC_CMD_SET_FREQ_STEP_DATA_TO_READ 4
|
2016-09-18 11:41:59 +02:00
|
|
|
#define CC_CMD_START_MEASUREMENT_DATA_TO_READ 0
|
2016-09-19 21:09:21 +02:00
|
|
|
#define CC_CMD_GET_CONFIG_DATA_TO_READ 0
|
2016-09-28 14:43:05 +02:00
|
|
|
#define CC_CMD_EN_CLK_DATA_TO_READ 1
|
|
|
|
#define CC_CMD_DIS_CLK_DATA_TO_READ 1
|
|
|
|
#define CC_CMD_SAV_DFLT_DATA_TO_READ 0
|
2016-10-12 20:32:46 +02:00
|
|
|
#define CC_CMD_SET_CLK_CORR_DATA_TO_READ 4
|
|
|
|
#define CC_CMD_GET_CLK_CORR_DATA_TO_READ 0
|
2016-09-18 11:41:59 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#define CC_READ_DATA_MAX 64
|
2016-09-18 08:05:46 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
2016-10-12 20:32:46 +02:00
|
|
|
|