50 #if 1 // Maxim-specific 52 #include "mxc_delay.h" 55 #include "mxc_config.h" 61 #define I2C_MASTER MXC_I2C0 62 #define I2C_MASTER_IDX 0 63 #define I2C_SLAVE_ADDR (DS2485_I2C_7BIT_ADDRESS << 1) 68 int DS2485_ExecuteCommand(
const uint8_t *packet,
int packetSize,
int delay_uSec, uint8_t *response,
int responseSize)
71 const sys_cfg_i2c_t sys_i2c_cfg = NULL;
74 I2C_Shutdown(I2C_MASTER);
75 if((error = I2C_Init(I2C_MASTER, I2C_STD_MODE, &sys_i2c_cfg)) != E_NO_ERROR) {
79 if((error = I2C_MasterWrite(MXC_I2C0, I2C_SLAVE_ADDR, packet, packetSize, 0)) != packetSize) {
83 mxc_delay(MXC_DELAY_MSEC(delay_uSec));
86 if((error = I2C_MasterRead(MXC_I2C0, I2C_SLAVE_ADDR, response, responseSize, 0)) != responseSize) {
int DS2485_ExecuteCommand(const uint8_t *packet, int packetSize, int delay_uSec, uint8_t *response, int responseSize)
Platform-specific I2C command interface implemented in DS2485_port_xxxx.c Returns 'error' (0 if compl...
General library for the DS2485, supporting the higher-level one_wire.c/.h API.