Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

BF51x/otI2cBus.h File Reference

I2C Library. More...

#include "otdefs.h"

Functions

void I2cBusFrequency (int frequency, int dutyCycle)
 Set the bus frequency Set the bus frequency and clock duty cycle.
void I2cBusReset ()
 Reset the interface Reset the bus interface.
bool I2cBusClrSclSda ()
 Restores control of the interface Restore (after a bus error) the control of the interface.
void I2cBusSclSdaControls (bool scl, bool sda)
 Control of SDA and SCL lines as a port.
bool I2cBusWrite (U8 DeviceAddr, U8 *TWI_Data_Pointer, U16 TWI_Length)
 Do a master mode write Write (as master) a sequence of bytes at the specified address.
bool I2cBusWriteReg (U8 DeviceAddr, U8 regId, U8 *TWI_Data_Pointer, U16 TWI_Length)
 Do a master mode write Write (as master) a sequence of bytes at the specified address.
bool I2cBusWriteReg16 (U8 DeviceAddr, U16 regId, U16 *TWI_Data_Pointer, U16 TWI_Length)
 Do a master mode write Write (as master) a sequence of words at the specified address.
void I2cBusRead (U8 DeviceAddr, U8 *TWI_Data_Pointer, U16 Count)
 Do a master mode read Read (as master) a sequence of bytes from a specified address.
void I2cBusRead16 (U8 DeviceAddr, U16 *TWI_Data_Pointer, U16 Count)
 Do a master mode read Read (as master) a sequence of words from a specified address.
bool I2cBusWriteByte (U8 address, U8 regId, U8 data)
 Write a byte Write a byte to the specified register (address) of a device at address.
U8 I2cBusReadByte (U8 address, U8 regId, U8 *ok)
 Read a byte Read a byte from the specified register (regID) of a device at address.
bool I2cBusReadBytes (U8 address, U8 regId, U16 count, U8 *dest)
 Read n bytes Read bytes from the specified regId of a device at address.
bool I2cBusWrite8_16 (U8 address, U8 regId, U16 value)
 Write a word Write a word to the specified register at address of the device.
bool I2cBusWrite8_32 (U8 address, U8 regId, U32 value)
 Write a double word Write a double word to the specified register at address of the device.
bool I2cBusWrite16_8 (U8 address, U16 regId, U8 value)
 Write a word Write a word to the specified register at address of the device.
bool I2cBusWrite16_16 (U8 address, U16 regId, U16 value)
 Write a word Write a word (16bit) to a specified register with 16 bit address.
bool I2cBusReadReg8_16 (U8 address, U8 regId, U16 *regDat)
 Read a word Read a a word (16bit) from a specified 16 bit register located by a 8bit address.
bool I2cBusReadReg8_32 (U8 address, U8 regID, U32 *regDat)
 Read a double word Read a a double word (32bit) from a specified 32 bit register located by a 8bit address.
bool I2cBusReadReg16_8 (U8 address, U16 regId, U8 *regDat)
 Read a byte Read a byte from a specified register located by a 16bit address.
bool I2cBusReadReg16_16 (U8 address, U16 regId, U16 *regDat)
 Read a word Read a word (16bit) from a specified register located by a 16bit address.
bool I2cBusReadReg16_16N (U8 address, U16 regID, U16 *regDat, U16 wordCount)
bool I2cBusWriteStart (U8 DeviceAddr, U16 num)
bool I2cBusWriteData (U8 data)
bool I2cBusWriteEnd ()
void I2cBusReadStart (U8 DeviceAddr, U16 count)
U8 I2cBusReadData ()
void I2cBusReadEnd ()


Detailed Description

Version:
1.0.0
Author:
Manuele Turini
footer
otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0