32 static inline void ioexpSleep(
void)
45 static inline void ioexpWake(
void)
64 static int i2cReadReg(uint8_t addr, uint8_t *value)
104 static int i2cWriteReg(uint8_t addr, uint8_t value)
138 uint32_t ioexpGetDeviceId(
void)
143 pU8 = (uint8_t*)&result;
145 ioexpReadReg(BSP_IOEXP_REG_DEVICE_ID0, pU8++);
146 ioexpReadReg(BSP_IOEXP_REG_DEVICE_ID1, pU8++);
147 ioexpReadReg(BSP_IOEXP_REG_DEVICE_ID2, pU8++);
148 ioexpReadReg(BSP_IOEXP_REG_DEVICE_ID3, pU8++);
166 int ioexpReadReg(uint8_t reg, uint8_t *result)
171 status = i2cReadReg(reg, result);
192 int ioexpRegBitsSet(uint8_t addr,
bool set, uint8_t bitMask)
199 status = i2cReadReg(addr, &value);
214 status = i2cWriteReg(addr, value);
234 int ioexpWriteReg(uint8_t reg, uint8_t value)
239 status = i2cWriteReg(reg, value);
249 void ioexpDisable(
void)
253 i2cWriteReg(BSP_IOEXP_REG_VCOM_CTRL, 1);
254 i2cWriteReg(BSP_IOEXP_REG_DISP_CTRL, 0);
255 i2cWriteReg(BSP_IOEXP_REG_SENSOR_CTRL, 0);
256 i2cWriteReg(BSP_IOEXP_REG_LED_CTRL, 0);
264 int ioexpEnable(
void)
279 if (ioexpGetDeviceId() != BSP_IOEXP_DEVICE_ID)
286 i2cWriteReg(BSP_IOEXP_REG_VCOM_CTRL, 1);
287 i2cWriteReg(BSP_IOEXP_REG_DISP_CTRL, 0);
288 i2cWriteReg(BSP_IOEXP_REG_SENSOR_CTRL, 0);
289 i2cWriteReg(BSP_IOEXP_REG_LED_CTRL, 0);
Clock management unit (CMU) API.
Board support package API definitions.
I2C_TransferReturn_TypeDef I2CSPM_Transfer(I2C_TypeDef *i2c, I2C_TransferSeq_TypeDef *seq)
Perform I2C transfer.
Board support package API implementation for STK's.
void I2CSPM_Init(I2CSPM_Init_TypeDef *init)
Initalize I2C peripheral.
#define BSP_STATUS_IOEXP_FAILURE
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
I2C_TransferReturn_TypeDef
void GPIO_PinModeSet(GPIO_Port_TypeDef port, unsigned int pin, GPIO_Mode_TypeDef mode, unsigned int out)
Set the mode for a GPIO pin.
General Purpose IO (GPIO) peripheral API.
I2C simple poll-based master mode driver for the DK/STK.
#define I2CSPM_INIT_DEFAULT
__STATIC_INLINE void GPIO_PinOutSet(GPIO_Port_TypeDef port, unsigned int pin)
Set a single pin in GPIO data out register to 1.
struct I2C_TransferSeq_TypeDef::@0 buf[2]
void CMU_ClockEnable(CMU_Clock_TypeDef clock, bool enable)
Enable/disable a clock.
Master mode transfer message structure used to define a complete I2C transfer sequence (from start to...
#define I2C_FLAG_WRITE_WRITE
Indicate write sequence using two buffers: S+ADDR(W)+DATA0+DATA1+P.
#define I2C_FLAG_WRITE_READ
Indicate combined write/read sequence: S+ADDR(W)+DATA0+Sr+ADDR(R)+DATA1+P.
__STATIC_INLINE void GPIO_PinOutClear(GPIO_Port_TypeDef port, unsigned int pin)
Set a single pin in GPIO data out port register to 0.
uint16_t addr
Address to use after (repeated) start.