2016-09-18 08:05:46 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
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-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-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-18 11:41:59 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#define CC_READ_DATA_MAX 64
|
2016-09-18 08:05:46 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|