40 #if !defined(__AVR_MEGA__) 41 # pragma pack(push, 1) // exact fit - no padding 61 #define FRAME_START_FLAG 0x69 62 #define FRAME_END_FLAG 0x96 110 template <
typename Payload>
126 DATALEN(sizeof(Payload)),
139 const uint8_t *
data =
reinterpret_cast<const uint8_t*
>(&
payload);
141 for (
unsigned int i=0;i<len;i++) ret+=*data++;
160 uint8_t flag_enable_timeout : 1;
162 dac_index(0), dac_value_HI(0), dac_value_LO(0),flag_enable_timeout(0)
204 int8_t active_channels[8];
209 measure_period_ms(200),
210 use_internal_refvolt(0)
212 for (
int i=0;i<8;i++) {
213 active_channels[i]=-1;
240 uint8_t flag_enable_timeout : 1;
244 flag_enable_timeout(0)
259 uint16_t adc_data[8];
272 static const uint8_t NUM_ENCODERS = 2;
277 int8_t encA_pin[NUM_ENCODERS], encB_pin[NUM_ENCODERS], encZ_pin[NUM_ENCODERS];
281 sampling_period_ms(250)
283 for (uint8_t i=0;i<NUM_ENCODERS;i++) {
284 encA_pin[i]=encB_pin[i]=encZ_pin[i]=0;
342 sampling_period_ms(50)
344 ENCODER_ABS_CS=ENCODER_ABS_CLK=ENCODER_ABS_DO=0;
368 #if !defined(__AVR_MEGA__) uint8_t calc_checksum() const
void calc_and_update_checksum()
TFrameCMD_SET_PWM_payload_t()
uint16_t enc_pos
Absolute value read from the encoder (10 bits resolution)
uint8_t analog_value
0-255 maps to 0% to 100% duty cycle
uint16_t sampling_period_ms
TFrame_ENCODER_ABS_reading()
TFrameCMD_EMS22A_start_payload_t()
uint8_t enc_status
See EMS22A datasheet for the bit map.
TFrameCMD_SetDAC_payload_t()
TFrame_ENCODERS_readings()
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
TFrameCMD_ENCODERS_start()
TFrameCMD_ENCODERS_start_payload_t()
TBaseFrame(uint8_t opcode)
uint16_t sampling_period_ms
uint8_t use_internal_refvolt
0 or 1. Default=0
uint16_t measure_period_ms
Default = 200.
TFrameCMD_ENCODERS_stop()
TFrameCMD_ADC_start_payload_t()