64 WRITE_SEQUENCER = 0x11,
65 READ_SEQUENCER = 0x22,
67 WRITE_CONFIGURATION = 0x55,
68 READ_CONFIGURATION = 0x6A,
69 WRITE_GPIO_CONFIGURATION = 0x83,
70 READ_GPIO_CONFIGURATION = 0x7C,
72 } DS28E18_device_function_commands_T;
80 OVERDRIVE_SKIP = 0x3C,
88 I2C_WRITE_DATA = 0xE3,
90 I2C_READ_DATA_W_NACK_END = 0xD3,
93 SPI_WRITE_READ_BYTE = 0xC0,
94 SPI_WRITE_READ_BIT = 0xB0,
100 UTILITY_SENS_VDD_ON = 0xCC,
101 UTILITY_SENS_VDD_OFF = 0xBB,
102 UTILITY_GPIO_BUF_WRITE = 0xD1,
103 UTILITY_GPIO_BUF_READ = 0x1D,
104 UTILITY_GPIO_CNTL_WRITE = 0xE2,
105 UTILITY_GPIO_CNTL_READ = 0x2E,
106 } DS28E18_sequencer_commands_T;
110 EXECUTION_ERROR = 0x55,
111 INVALID_PARAMETER = 0x77,
114 } DS28E18_result_byte_T;
121 } DS28E18_protocol_speed_T;
126 } DS28E18_ignore_nack_T;
131 } DS28E18_protocol_T;
136 } DS28E18_spi_mode_T;
141 } DS28E18_target_configuration_register_T;
161 DELAY_16384msec = 14,
162 DELAY_32768msec = 15,
166 uint8_t sequenceData[512];
168 unsigned int totalSequencerDelayTime;
187 bool DS28E18_WriteSequencer(
unsigned short nineBitStartingAddress,
const uint8_t *txData,
int txDataSize);
188 bool DS28E18_ReadSequencer(
unsigned short nineBitStartingAddress, uint8_t *rxData,
unsigned short readLength);
190 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_BuildPacket_I2C_WriteData(const uint8_t *i2cData, uint8_t i2cDataSize)
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_BuildPacket_SPI_SlaveSelectLow(void)
void DS28E18_BuildPacket_Utility_GpioBufferWrite(uint8_t GPIO_BUF)
unsigned short DS28E18_BuildPacket_SPI_WriteReadBit(const uint8_t *spiWriteData, uint8_t spiWriteDataSize, int writeBits, int readBits)
void DS28E18_BuildPacket_Append(const uint8_t *sequencerCmds, size_t length)
Append commands to locally constructed command sequencer packet.
unsigned short DS28E18_BuildPacket_SPI_WriteReadByte(const uint8_t *spiWriteData, uint8_t spiWriteDataSize, int readBytes, bool fullDuplex)
bool DS28E18_WriteGpioConfiguration(DS28E18_target_configuration_register_T CFG_REG_TARGET, uint8_t GPIO_HI, uint8_t GPIO_LO)
DS28E18_one_wire_rom_commands_T DS28E18_GetRomCommand(void)
Return the value of 'current_ROM_command'.
void DS28E18_BuildPacket_Utility_Delay(DS28E18_utility_delay_T delayTimeInMsExponent)
unsigned short DS28E18_BuildPacket_I2C_ReadData(int readBytes)
void DS28E18_BuildPacket_I2C_Start(void)
void DS28E18_BuildPacket_Utility_SensVddOff(void)
unsigned short DS28E18_BuildPacket_I2C_ReadDataWithNackEnd(int readBytes)
can only be used if there is a single slave on the bus
unsigned short DS28E18_GetLastSequenceLength(void)
Retrieve length of constructed sequence, for use in DS28E18_RerunLastSequence(length) ...
unsigned short DS28E18_BuildPacket_Utility_GpioControlRead(void)
bool DS28E18_BuildPacket_WriteAndRun(void)
unsigned short DS28E18_BuildPacket_Utility_GpioBufferRead(void)
OneWire_ROM_ID_T type stores a 1-Wire address.
void DS28E18_SetRomCommand(DS28E18_one_wire_rom_commands_T rom_cmd)
bool DS28E18_ReadGpioConfiguration(uint8_t CFG_REG_TARGET, uint8_t *rxData)
bool DS28E18_ReadConfiguration(uint8_t *rxData)
void DS28E18_BuildPacket_I2C_Stop(void)
OneWire_ROM_ID_T current_DS28E18_ROM_ID
DS28E18 device addressed for current operations (may be one of many on 1-Wire bus) ...
uint8_t * DS28E18_BuildPacket_GetSequencerPacket(void)
Get address of locally constructed command sequencer packet's data.
selected (matched ROM ID) slave goes into overdrive
void DS28E18_BuildPacket_ClearSequencerPacket(void)
Reset local command sequencer packet under construction.
int DS28E18_SetOnewireSpeed(one_wire_speeds spd)
don't use ROM ID (applicable only when there is only 1 slave on the bus)
void DS28E18_BuildPacket_SPI_SlaveSelectHigh(void)
void DS28E18_BuildPacket_Utility_GpioControlWrite(uint8_t GPIO_CRTL_HI, uint8_t GPIO_CRTL_LO)
bool DS28E18_DeviceStatus(uint8_t *rxData)
DS28E18_one_wire_rom_commands_T
bool DS28E18_RunSequencer(unsigned short nineBitStartingAddress, unsigned short runLength)
enumeration of all slaves on bus
int DS28E18_BuildPacket_GetSequencerPacketSize(void)
Get length of locally constructed command sequencer packet.
bool DS28E18_WriteSequencer(unsigned short nineBitStartingAddress, const uint8_t *txData, int txDataSize)
void DS28E18_BuildPacket_Utility_SensVddOn(void)
bool DS28E18_RerunLastSequence(unsigned int length)
address a specific slave by ROM ID
General 1-Wire API using the DS2485 1-Wire master.
bool DS28E18_ReadSequencer(unsigned short nineBitStartingAddress, uint8_t *rxData, unsigned short readLength)