Skip to content

低レベルI2C

この関数群を通常使うことはありません。TwoWireクラスを利用して呼び出してください。

利用例

メンバー

i2cInit()

i2c_t* i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t clk_speed)

引数

  • uint8_t i2c_num
  • int8_t sda
  • int8_t scl
  • uint32_t clk_speed

戻り値

i2c_t*

i2cRelease()

void i2cRelease(i2c_t *i2c)

引数

  • i2c_t* i2c

戻り値

void

i2cWrite()

i2c_err_t i2cWrite(i2c_t *i2c, uint16_t address, uint8_t *buff, uint16_t size, bool sendStop, uint16_t timeOutMillis)

引数

  • i2c_t* i2c
  • uint16_t address
  • uint8_t * buff
  • uint16_t size
  • bool sendStop
  • uint16_t timeOutMillis

戻り値

i2c_err_t

i2cRead()

i2c_err_t i2cRead(i2c_t *i2c, uint16_t address, uint8_t *buff, uint16_t size, bool sendStop, uint16_t timeOutMillis, uint32_t *readCount)

引数

  • i2c_t* i2c
  • uint16_t address
  • uint8_t * buff
  • uint16_t size
  • bool sendStop
  • uint16_t timeOutMillis
  • uint32_t * readCount

戻り値

i2c_err_t

i2cFlush()

i2c_err_t i2cFlush(i2c_t *i2c)

引数

  • i2c_t* i2c

戻り値

i2c_err_t

i2cSetFrequency()

i2c_err_t i2cSetFrequency(i2c_t *i2c, uint32_t clk_speed)

引数

  • i2c_t* i2c
  • uint32_t clk_speed

戻り値

i2c_err_t

i2cGetFrequency()

uint32_t i2cGetFrequency(i2c_t *i2c)

引数

  • i2c_t* i2c

戻り値

uint32_t

i2cGetStatus()

uint32_t i2cGetStatus(i2c_t *i2c)

引数

  • i2c_t* i2c

戻り値

uint32_t

i2cAttachSCL()

i2c_err_t i2cAttachSCL(i2c_t *i2c, int8_t scl)

引数

  • i2c_t* i2c
  • int8_t scl

戻り値

i2c_err_t

i2cDetachSCL()

i2c_err_t i2cDetachSCL(i2c_t *i2c, int8_t scl)

引数

  • i2c_t* i2c
  • int8_t scl

戻り値

i2c_err_t

i2cAttachSDA()

i2c_err_t i2cAttachSDA(i2c_t *i2c, int8_t sda)

引数

  • i2c_t* i2c
  • int8_t sda

戻り値

i2c_err_t

i2cDetachSDA()

i2c_err_t i2cDetachSDA(i2c_t *i2c, int8_t sda)

引数

  • i2c_t* i2c
  • int8_t sda

戻り値

i2c_err_t

i2cProcQueue()

i2c_err_t i2cProcQueue(i2c_t *i2c, uint32_t *readCount, uint16_t timeOutMillis)

引数

  • i2c_t* i2c
  • uint32_t * readCount
  • uint16_t timeOutMillis

戻り値

i2c_err_t

i2cAddQueueWrite()

i2c_err_t i2cAddQueueWrite(i2c_t *i2c, uint16_t i2cDeviceAddr, uint8_t *dataPtr, uint16_t dataLen, bool SendStop, EventGroupHandle_t event)

引数

  • i2c_t* i2c
  • uint16_t i2cDeviceAddr
  • uint8_t * dataPtr
  • uint16_t dataLen
  • bool SendStop
  • EventGroupHandle_t event

戻り値

i2c_err_t

i2cAddQueueRead()

i2c_err_t i2cAddQueueRead(i2c_t *i2c, uint16_t i2cDeviceAddr, uint8_t *dataPtr, uint16_t dataLen, bool SendStop, EventGroupHandle_t event)

引数

  • i2c_t* i2c
  • uint16_t i2cDeviceAddr
  • uint8_t * dataPtr
  • uint16_t dataLen
  • bool SendStop
  • EventGroupHandle_t event

戻り値

i2c_err_t

i2cDebug()

uint32_t i2cDebug(i2c_t *, uint32_t setBits, uint32_t resetBits)

引数

  • i2c_t* ``
  • uint32_t setBits
  • uint32_t resetBits

戻り値

uint32_t