SWRMeter/firmware/globals.h

67 lines
2.4 KiB
C

/*****************************************************************************/
/* Message byte definitions: */
#define MSG_SOM1 0x3c
#define MSG_SOM2 0x3e
#define MSG_EOM1 0x0d
#define MSG_EOM2 0x0a
#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
/*****************************************************************************/
#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
#define CC_CMD_SET_FREQ_STEP 0x05
#define CC_CMD_START_MEASUREMENT 0x06
#define CC_CMD_GET_CONFIG 0x10
/*****************************************************************************/
#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
#define CC_CMD_SET_FREQ_STEP_FUNC &cc_setFreqStep
#define CC_CMD_START_MEASUREMENT_FUNC &cc_startMeasurement
#define CC_CMD_GET_CONFIG_FUNC &cc_getConfig
/*****************************************************************************/
#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
#define CC_CMD_SET_INTERVALL_DATA_TO_READ 2
#define CC_CMD_SET_DRIVE_STRENGTH_DATA_TO_READ 1
#define CC_CMD_SET_FREQ_STEP_DATA_TO_READ 4
#define CC_CMD_START_MEASUREMENT_DATA_TO_READ 0
#define CC_CMD_GET_CONFIG_DATA_TO_READ 0
/*****************************************************************************/
#define CC_READ_DATA_MAX 64
/*****************************************************************************/