66 #ifdef USE_MAXIM_DEFINITIONS // Maxim 67 #include "mxc_delay.h" 70 #define DELAY_MSEC(msec_) mxc_delay(MXC_DELAY_MSEC(msec_)) 74 #define DELAY_MSEC(msec_) vTaskDelay(pdMS_TO_TICKS(msec_)) 77 #ifdef DS28E18_ENABLE_PRINTF_DEBUGGING 78 #define PRINTF(...) printf("DS28E18: " __VA_ARGS__) 80 #define PRINTF(...) {} 101 static inline void appendToSequencerPacket(
const uint8_t* sequencerCmds,
int length) {
102 memcpy(&localPacket.sequenceData[localPacket.sequenceIdx], sequencerCmds, length);
103 localPacket.sequenceIdx += length;
106 #define APPEND_TO_PACKET(s_) { appendToSequencerPacket(s_, sizeof(s_)); } 108 #define SPU_Delay_tOP_msec 1 // say what? what is this delay? 124 int devicesFound = 0;
127 PRINTF(
"-- Populate unique ROM ID of **ALL** devices on 1-Wire line --\n");
128 PRINTF(
"-- .. using Write GPIO Configuration command (ignore result) --\n");
138 PRINTF(
"-- Search and initialize every device found on the 1-Wire line --\n");
140 OneWire_ROM_ID_T temp_rom_id = { .ID = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}};
141 bool last_device_found =
false;
142 while ( !last_device_found )
145 bool startNewSearch = (devicesFound==0);
146 int searchError =
OneWire_Search(&temp_rom_id, startNewSearch, &last_device_found);
147 if(searchError)
break;
150 PRINTF(
"Found ROM ID: x");
151 #ifdef DS28E18_ENABLE_PRINTF_DEBUGGING 152 for(uint8_t i = 0; i <
sizeof(temp_rom_id.ID); i++)
154 printf(
"%02X", temp_rom_id.ID[i]);
160 current_DS28E18_ROM_ID = temp_rom_id;
162 PRINTF(
"-- Write GPIO Configuration so the voltage on GPIO ports is known --\n");
168 PRINTF(
"-- Read Device Status information (clears POR status bit) --\n");
169 uint8_t status[4] = {0xFF, 0xFF, 0xFF, 0xFF};
176 PRINTF(
"-- Status: ");
177 #ifdef DS28E18_ENABLE_PRINTF_DEBUGGING 178 for(uint8_t i = 0; i <
sizeof(status); i++)
180 printf(
"%02X.", status[i]);
189 return devicesFound>0;
203 PRINTF(
"STANDARD*\n");
205 error = OneWire_Set_OneWireMasterSpeed(STANDARD);
208 error = OneWire_ResetPulse();
211 PRINTF(
"OVERDRIVE*\n");
213 error = OneWire_ResetPulse();
215 error = OneWire_WriteByte(OVERDRIVE_SKIP);
219 error = OneWire_Set_OneWireMasterSpeed(OVERDRIVE);
222 error = OneWire_ResetPulse();
235 current_ROM_command = rom_cmd;
240 return current_ROM_command;
243 static unsigned int calculateCrc16Byte(uint8_t data,
unsigned int crc)
245 const uint8_t oddparity[] = {0, 1, 1, 0, 1, 0, 0, 1,
246 1, 0, 0, 1, 0, 1, 1, 0};
248 unsigned int data16 = (data ^ crc) & 0xff;
249 crc = (crc >> 8) & 0xff;
251 if (oddparity[data16 & 0xf] ^ oddparity[data16 >> 4]) {
262 static unsigned int calculateCrc16Block(uint8_t *data,
int dataSize,
unsigned int crc)
264 for (
int i = 0; i < dataSize; i++)
266 crc = calculateCrc16Byte(data[i], crc);
272 static bool run_command(DS28E18_device_function_commands_T command, uint8_t *parameters,
int parameters_size,
int delay_msec, uint8_t *result_data)
275 uint8_t tx_packet[3 + parameters_size];
276 uint8_t tx_packet_CRC16[2];
277 unsigned int expectedCrc = 0;
278 uint8_t headerResponse[2];
279 int result_data_length;
280 uint8_t rx_packet_CRC16[2];
283 tx_packet[0] = COMMAND_START;
284 tx_packet[1] = 1 + parameters_size;
285 tx_packet[2] = command;
288 memcpy(&tx_packet[3], parameters, parameters_size);
292 error = OneWire_ResetPulse();
293 if(error)
return false;
296 switch(current_ROM_command)
299 PRINTF(
"Error: Not appropriate use of Read ROM \n");
304 if(error)
return false;
305 error = OneWire_WriteBlock(ROMID.ID, 8);
306 if(error)
return false;
309 PRINTF(
"Error: Not appropriate use of Search ROM \n");
312 error = OneWire_WriteByte(
SKIP_ROM);
313 if(error)
return false;
316 error = OneWire_WriteByte(RESUME);
317 if(error)
return false;
320 error = OneWire_WriteByte(OVERDRIVE_SKIP);
321 if(error)
return false;
326 if(error)
return false;
327 error = OneWire_WriteBlock(ROMID.ID, 8);
328 if(error)
return false;
331 PRINTF(
"Error: 1-Wire Communication Error\n");
336 error = OneWire_WriteBlock(tx_packet,
sizeof(tx_packet));
337 if(error)
return false;
340 error = OneWire_ReadBlock(tx_packet_CRC16,
sizeof(tx_packet_CRC16));
341 if(error)
return false;
344 expectedCrc = calculateCrc16Block(tx_packet,
sizeof(tx_packet), expectedCrc);
345 expectedCrc ^= 0xFFFFU;
346 if (expectedCrc != (
unsigned int)((tx_packet_CRC16[1] << 8) | tx_packet_CRC16[0]))
348 PRINTF(
"Error: Invalid CRC16\n");
353 error = OneWire_WriteBytePower(OneWire_Release_Byte_xAA);
354 if(error)
return false;
357 DELAY_MSEC(delay_msec);
363 error = OneWire_ReadBlock(headerResponse,
sizeof(headerResponse));
364 if(error)
return false;
365 result_data_length = headerResponse[1];
367 if (result_data_length == 0xFF)
369 PRINTF(
"Error: 1-Wire Communication Error\n");
374 error = OneWire_ReadBlock(result_data, result_data_length);
375 if(error)
return false;
378 error = OneWire_ReadBlock(rx_packet_CRC16,
sizeof(rx_packet_CRC16));
379 if(error)
return false;
383 expectedCrc = calculateCrc16Block(&headerResponse[1],
sizeof(headerResponse) - 1, expectedCrc);
384 expectedCrc = calculateCrc16Block(result_data, result_data_length, expectedCrc);
385 expectedCrc ^= 0xFFFFU;
386 if (expectedCrc != (
unsigned int)((rx_packet_CRC16[1] << 8) | rx_packet_CRC16[0]))
388 PRINTF(
"Error: Invalid CRC16\n");
399 static bool returnDeviceResponseResult(DS28E18_result_byte_T r) {
403 case INVALID_PARAMETER:
404 PRINTF(
"Error: Invalid input or parameter\n");
407 PRINTF(
"Error: 1-Wire Communication Error\n");
425 uint8_t parameters[2 + txDataSize];
427 uint8_t addressLow = nineBitStartingAddress & 0xFF;
428 uint8_t addressHigh = (nineBitStartingAddress >> 8) & 0x01;
429 parameters[0] = addressLow;
430 parameters[1] = addressHigh;
431 memcpy(¶meters[2], &txData[0], txDataSize);
433 if (!run_command(WRITE_SEQUENCER, parameters,
sizeof(parameters), SPU_Delay_tOP_msec, response))
437 return returnDeviceResponseResult(response[0]);
451 uint8_t parameters[2];
452 int response_length = 1 + readLength;
453 uint8_t response[response_length];
457 if (readLength == 128)
462 addressLow = nineBitStartingAddress & 0xFF;
463 addressHigh = (nineBitStartingAddress >> 8) & 0x01;
465 parameters[0] = addressLow;
466 parameters[1] = (readLength << 1) | addressHigh;
468 if (!run_command(READ_SEQUENCER, parameters,
sizeof(parameters), SPU_Delay_tOP_msec, response))
473 memcpy(rxData, &response[1], response_length - 1);
476 switch (response[0]) {
481 case INVALID_PARAMETER:
482 PRINTF(
"Error: Invalid input or parameter\n");
486 PRINTF(
"Error: 1-Wire Communication Error\n");
503 uint8_t parameters[3];
504 int response_length = 3;
505 uint8_t response[response_length];
508 uint8_t sequencerLengthLow;
509 uint8_t sequencerLengthHigh;
510 int totalSequencerCommunicationTime = 0;
513 unsigned short nackOffset;
515 if (runLength == 512)
520 addressLow = nineBitStartingAddress & 0xFF;
521 addressHigh = (nineBitStartingAddress >> 8) & 0x01;
522 sequencerLengthLow = ((runLength & 0x7F) << 1);
523 sequencerLengthHigh = ((runLength >> 7) & 0x03);
525 parameters[0] = addressLow;
526 parameters[1] = sequencerLengthLow | addressHigh;
527 parameters[2] = sequencerLengthHigh;
529 #if 0 // Replace stunningly INSANE looping and floating-point coding 530 for (
float i = 0; i < (runLength / 10); i++)
532 totalSequencerCommunicationTime += 1;
534 localPacket.totalSequencerDelayTime += localPacket.totalSequencerDelayTime * 0.05;
536 totalSequencerCommunicationTime += (runLength / 10);
537 localPacket.totalSequencerDelayTime += localPacket.totalSequencerDelayTime / 20;
540 int run_sequencer_delay_msec = SPU_Delay_tOP_msec + localPacket.totalSequencerDelayTime + totalSequencerCommunicationTime;
542 if (!run_command(RUN_SEQUENCER, parameters,
sizeof(parameters), run_sequencer_delay_msec, response))
548 switch (response[0]) {
551 PRINTF(
"Error: POR occurred resulting in the command sequencer memory being set to zero\n");
554 case EXECUTION_ERROR:
555 PRINTF(
"Error: Execution Error (Sequencer Command packet or packets incorrectly formed)\n");
559 snackLo = response[1];
560 snackHi = response[2];
561 nackOffset = snackLo + (snackHi << 8);
566 PRINTF(
"Error: RunSequencer NACK occurred at sequencer byte index: %d\n", nackOffset);
573 return returnDeviceResponseResult(response[0]);
586 bool DS28E18_WriteConfiguration(DS28E18_protocol_speed_T SPD, DS28E18_ignore_nack_T INACK, DS28E18_protocol_T PROT, DS28E18_spi_mode_T SPI_MODE)
588 uint8_t parameters[1];
591 parameters[0] = (SPI_MODE << 4) | (PROT << 3) | (INACK << 2) | SPD;
593 if (!run_command(WRITE_CONFIGURATION, parameters,
sizeof(parameters), SPU_Delay_tOP_msec, response))
598 return returnDeviceResponseResult(response[0]);
610 uint8_t parameters[0];
611 int response_length = 2;
612 uint8_t response[response_length];
614 if (!run_command(READ_CONFIGURATION, parameters, 0, SPU_Delay_tOP_msec, response))
619 memcpy(rxData, &response[1], response_length - 1);
621 return returnDeviceResponseResult(response[0]);
637 uint8_t parameters[4];
640 parameters[0] = CFG_REG_TARGET;
641 parameters[1] = 0x03;
642 parameters[2] = GPIO_HI;
643 parameters[3] = GPIO_LO;
645 if (!run_command(WRITE_GPIO_CONFIGURATION, parameters,
sizeof(parameters), SPU_Delay_tOP_msec, response))
649 return returnDeviceResponseResult(response[0]);
662 uint8_t parameters[2];
663 const int response_length = 3;
664 uint8_t response[response_length];
666 parameters[0] = CFG_REG_TARGET;
667 parameters[1] = 0x03;
669 if (!run_command(READ_GPIO_CONFIGURATION, parameters,
sizeof(parameters), SPU_Delay_tOP_msec, response))
674 memcpy(rxData, &response[1], response_length - 1);
675 return returnDeviceResponseResult(response[0]);
687 uint8_t parameters[0];
688 const int response_length = 5;
689 uint8_t response[response_length];
691 if (!run_command(DEVICE_STATUS, parameters, 0, SPU_Delay_tOP_msec, response))
696 memcpy(rxData, &response[1], response_length - 1);
697 return returnDeviceResponseResult(response[0]);
708 memset(localPacket.sequenceData, 0x00,
sizeof(localPacket.sequenceData));
709 localPacket.sequenceIdx = 0;
710 localPacket.totalSequencerDelayTime = 0;
715 return localPacket.sequenceData;
720 return localPacket.sequenceIdx;
725 appendToSequencerPacket(sequencerCmds,length);
741 {
return localPacket.sequenceIdx; };
757 static const uint8_t i2c_start[1] = { I2C_START };
758 APPEND_TO_PACKET(i2c_start);
767 static const uint8_t i2c_stop[1] = { I2C_STOP };
768 APPEND_TO_PACKET(i2c_stop);
780 uint8_t i2c_write_data[2 + i2cDataSize];
781 i2c_write_data[0] = I2C_WRITE_DATA;
782 i2c_write_data[1] = i2cDataSize;
783 memcpy(&i2c_write_data[2], i2cData, i2cDataSize);
784 APPEND_TO_PACKET(i2c_write_data);
797 unsigned short readArrayFFhStartingAddress = localPacket.sequenceIdx + 2;
798 uint8_t i2c_read_data[2 + readBytes];
800 i2c_read_data[0] = I2C_READ_DATA;
801 if (readBytes == 256)
803 i2c_read_data[1] = 0;
807 i2c_read_data[1] = readBytes;
809 memset(&i2c_read_data[2], 0xFF, readBytes);
810 APPEND_TO_PACKET(i2c_read_data);
811 return readArrayFFhStartingAddress;
824 unsigned short readArrayFFhStartingAddress = localPacket.sequenceIdx + 2;
825 uint8_t i2c_read_data_with_nack_end[2 + readBytes];
826 i2c_read_data_with_nack_end[0] = I2C_READ_DATA_W_NACK_END;
827 if (readBytes == 256)
829 i2c_read_data_with_nack_end[1] = 0;
833 i2c_read_data_with_nack_end[1] = readBytes;
835 memset(&i2c_read_data_with_nack_end[2], 0xFF, readBytes);
836 APPEND_TO_PACKET(i2c_read_data_with_nack_end);
837 return readArrayFFhStartingAddress;
853 unsigned short readArrayFFhStartingAddress = 0;
854 uint8_t spi_write_read_data_byte[255];
858 spi_write_read_data_byte[idx++] = SPI_WRITE_READ_BYTE;
860 if (spiWriteDataSize != 0 && readBytes != 0)
863 spi_write_read_data_byte[idx++] = spiWriteDataSize;
866 spi_write_read_data_byte[idx] = readBytes;
869 spi_write_read_data_byte[idx] += spiWriteDataSize;
874 for (
int i = 0; i < spiWriteDataSize; i++)
876 spi_write_read_data_byte[idx++] = spiWriteData[i];
882 memset(&spi_write_read_data_byte[idx], 0xFF, spiWriteDataSize);
883 idx += spiWriteDataSize;
885 readArrayFFhStartingAddress = idx;
886 memset(&spi_write_read_data_byte[idx], 0xFF, readBytes);
890 else if(spiWriteDataSize != 0 && readBytes == 0)
893 spi_write_read_data_byte[idx++] = spiWriteDataSize;
896 spi_write_read_data_byte[idx++] = 0;
899 for (
int i = 0; i < spiWriteDataSize; i++)
901 spi_write_read_data_byte[idx++] = spiWriteData[i];
908 else if(spiWriteDataSize == 0 && readBytes != 0)
911 spi_write_read_data_byte[idx++] = 0;
914 spi_write_read_data_byte[idx++] = readBytes;
920 readArrayFFhStartingAddress = idx;
921 memset(&spi_write_read_data_byte[idx], 0xFF, readBytes);
928 spi_write_read_data_byte[idx++] = 0;
931 spi_write_read_data_byte[idx++] = 0;
939 readArrayFFhStartingAddress += localPacket.sequenceIdx;
940 appendToSequencerPacket(spi_write_read_data_byte, idx);
941 return readArrayFFhStartingAddress;
957 uint8_t readBitsInBytes = 0;
958 unsigned short readArrayFFhStartingAddress = 0;
959 uint8_t spi_write_read_data_bit[255];
962 if (readBits > 0 && readBits < 9)
966 else if (readBits >= 9 && readBits < 17)
970 else if (readBits >= 17 && readBits < 25)
974 else if (readBits >= 25 && readBits < 33)
978 else if (readBits >= 33 && readBits < 41)
982 else if (readBits >= 41 && readBits < 49)
986 else if (readBits >= 49 && readBits < 57)
990 else if (readBits >= 57 && readBits < 65)
996 spi_write_read_data_bit[idx++] = SPI_WRITE_READ_BIT;
998 if (writeBits != 0 && readBits != 0)
1001 spi_write_read_data_bit[idx++] = writeBits;
1004 spi_write_read_data_bit[idx++] = readBits;
1007 for (
int i = 0; i < spiWriteDataSize; i++)
1009 spi_write_read_data_bit[idx++] = spiWriteData[i];
1013 readArrayFFhStartingAddress = idx;
1014 memset(&spi_write_read_data_bit[idx], 0xFF, readBitsInBytes);
1015 idx += readBitsInBytes;
1018 else if(writeBits != 0 && readBits == 0)
1021 spi_write_read_data_bit[idx++] = writeBits;
1024 spi_write_read_data_bit[idx++] = 0;
1027 for (
int i = 0; i < spiWriteDataSize; i++)
1029 spi_write_read_data_bit[idx++] = spiWriteData[i];
1036 else if(writeBits == 0 && readBits != 0)
1039 spi_write_read_data_bit[idx++] = 0;
1042 spi_write_read_data_bit[idx++] = readBits;
1048 readArrayFFhStartingAddress = idx;
1049 memset(&spi_write_read_data_bit[idx], 0xFF, readBitsInBytes);
1050 idx += readBitsInBytes;
1056 spi_write_read_data_bit[idx++] = 0;
1059 spi_write_read_data_bit[idx++] = 0;
1068 readArrayFFhStartingAddress += localPacket.sequenceIdx;
1069 appendToSequencerPacket(spi_write_read_data_bit,idx);
1071 return readArrayFFhStartingAddress;
1080 static const uint8_t spi_slave_select_high[1] = { SPI_SS_HIGH };
1081 APPEND_TO_PACKET(spi_slave_select_high);
1090 static const uint8_t spi_slave_select_low[1] = { SPI_SS_LOW };
1091 APPEND_TO_PACKET(spi_slave_select_low);
1100 uint16_t delayTimeInMs = 1U << (uint16_t)delayTimeInMsExponent;
1101 localPacket.totalSequencerDelayTime += delayTimeInMs;
1102 uint8_t utility_delay_sequence[2] = { UTILITY_DELAY, delayTimeInMsExponent };
1103 APPEND_TO_PACKET(utility_delay_sequence);
1112 static const uint8_t utility_sens_vdd_on[1] = { UTILITY_SENS_VDD_ON };
1113 APPEND_TO_PACKET(utility_sens_vdd_on);
1122 static const uint8_t utility_sens_vdd_off[1] = { UTILITY_SENS_VDD_OFF };
1123 APPEND_TO_PACKET(utility_sens_vdd_off);
1134 uint8_t utility_gpio_buff_write[2] = { UTILITY_GPIO_BUF_WRITE, GPIO_BUF };
1135 APPEND_TO_PACKET(utility_gpio_buff_write);
1146 unsigned short readArrayFFhStartingAddress = localPacket.sequenceIdx + 1;
1147 static const uint8_t utility_gpio_buff_read[2] = { UTILITY_GPIO_BUF_READ, 0xFF };
1148 APPEND_TO_PACKET(utility_gpio_buff_read);
1149 return readArrayFFhStartingAddress;
1161 uint8_t utility_gpio_cntl_write[3] = { UTILITY_GPIO_CNTL_WRITE, GPIO_CRTL_HI, GPIO_CRTL_LO };
1162 APPEND_TO_PACKET(utility_gpio_cntl_write);
1173 unsigned short readArrayFFhStartingAddress = localPacket.sequenceIdx + 1;
1174 static const uint8_t utility_gpio_cntl_read[3] = { UTILITY_GPIO_CNTL_READ, 0xFF, 0xFF };
1175 APPEND_TO_PACKET(utility_gpio_cntl_read);
1176 return readArrayFFhStartingAddress;
void DS28E18_BuildPacket_Utility_GpioBufferWrite(uint8_t GPIO_BUF)
bool DS28E18_WriteGpioConfiguration(DS28E18_target_configuration_register_T CFG_REG_TARGET, uint8_t GPIO_HI, uint8_t GPIO_LO)
void DS28E18_BuildPacket_Append(const uint8_t *sequencerCmds, size_t length)
Append commands to locally constructed command sequencer packet.
bool DS28E18_DeviceStatus(uint8_t *rxData)
int DS28E18_BuildPacket_GetSequencerPacketSize()
Get length of locally constructed command sequencer packet.
unsigned short DS28E18_BuildPacket_SPI_WriteReadBit(const uint8_t *spiWriteData, uint8_t spiWriteDataSize, int writeBits, int readBits)
uint8_t * DS28E18_BuildPacket_GetSequencerPacket()
Get address of locally constructed command sequencer packet's data.
OneWire_ROM_ID_T current_DS28E18_ROM_ID
DS28E18 device addressed for current operations (may be one of many on 1-Wire bus) ...
void DS28E18_BuildPacket_ClearSequencerPacket()
Reset local command sequencer packet under construction.
can only be used if there is a single slave on the bus
void DS28E18_BuildPacket_SPI_SlaveSelectLow()
void DS28E18_BuildPacket_Utility_Delay(DS28E18_utility_delay_T delayTimeInMsExponent)
unsigned short DS28E18_BuildPacket_Utility_GpioBufferRead()
unsigned short DS28E18_BuildPacket_SPI_WriteReadByte(const uint8_t *spiWriteData, uint8_t spiWriteDataSize, int readBytes, bool fullDuplex)
bool DS28E18_BuildPacket_WriteAndRun()
OneWire_ROM_ID_T type stores a 1-Wire address.
int OneWire_Search(OneWire_ROM_ID_T *romid, bool search_reset, bool *last_device_found)
void DS28E18_BuildPacket_I2C_WriteData(const uint8_t *i2cData, uint8_t i2cDataSize)
unsigned short DS28E18_BuildPacket_I2C_ReadDataWithNackEnd(int readBytes)
void DS28E18_BuildPacket_SPI_SlaveSelectHigh()
void DS28E18_BuildPacket_Utility_SensVddOn()
Driver for a DS28E18 slave on a 1-Wire bus.
bool DS28E18_ReadGpioConfiguration(uint8_t CFG_REG_TARGET, uint8_t *rxData)
unsigned short DS28E18_GetLastSequenceLength()
Retrieve length of constructed sequence, for use in DS28E18_RerunLastSequence(length) ...
void DS28E18_BuildPacket_Utility_GpioControlWrite(uint8_t GPIO_CRTL_HI, uint8_t GPIO_CRTL_LO)
selected (matched ROM ID) slave goes into overdrive
void DS28E18_BuildPacket_Utility_SensVddOff()
DS28E18_one_wire_rom_commands_T DS28E18_GetRomCommand()
Return the value of 'current_ROM_command'.
bool DS28E18_WriteConfiguration(DS28E18_protocol_speed_T SPD, DS28E18_ignore_nack_T INACK, DS28E18_protocol_T PROT, DS28E18_spi_mode_T SPI_MODE)
void DS28E18_SetRomCommand(DS28E18_one_wire_rom_commands_T rom_cmd)
don't use ROM ID (applicable only when there is only 1 slave on the bus)
unsigned short DS28E18_BuildPacket_Utility_GpioControlRead()
bool DS28E18_WriteSequencer(unsigned short nineBitStartingAddress, const uint8_t *txData, int txDataSize)
int DS28E18_SetOnewireSpeed(one_wire_speeds spd)
DS28E18_one_wire_rom_commands_T
unsigned short DS28E18_BuildPacket_I2C_ReadData(int readBytes)
void DS28E18_BuildPacket_I2C_Start()
enumeration of all slaves on bus
void DS28E18_BuildPacket_I2C_Stop()
bool DS28E18_ReadSequencer(unsigned short nineBitStartingAddress, uint8_t *rxData, unsigned short readLength)
bool DS28E18_RunSequencer(unsigned short nineBitStartingAddress, unsigned short runLength)
bool DS28E18_RerunLastSequence(unsigned int length)
address a specific slave by ROM ID
bool DS28E18_ReadConfiguration(uint8_t *rxData)