24 *value = rd[0] | ( rd[1] << 8 ) | ( rd[2] << 16 );
41 wr[1] = (value >> 8) & 0xff;
42 wr[2] = (value >> 16) & 0xff;
Structure defines OpenCores I2C Device.
OCReg
Octopus CPLD registers.
bool i2cReadReg(I2C_Device *dev, i2cAddr addr, uint8_t regNo, uint8_t *rd, int rdLen)
Reads from the I2C device register.
#define E_INVARGUMENT
Generic error: invalid argument.
bool i2cWriteReg(I2C_Device *dev, i2cAddr addr, uint8_t regNo, uint8_t *wr, int wrLen)
Writes to the I2C device register.
bool ocWrite(I2C_Device *dev, uint8_t addr, OCReg reg, uint32_t value)
Writes one of the CPLD registers.
static bool errRebase(const char *name)
Rebases the cause of the error message.
bool ocRead(I2C_Device *dev, uint8_t addr, OCReg reg, uint32_t *value)
Reads one of the CPLD registers.
This driver encapsulates the functionality of the CPLD on the octopus board.
bool errSet(uint32_t code, const char *error, const char *name)
Sets an error.
#define ERROR(CODE,...)
Expands an error code to an error code with a description (if ERROR_W_DESCR is declared).