CC23x0r2DriverLibrary
i2c.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "../inc/hw_types.h"
#include "../inc/hw_ints.h"
#include "../inc/hw_memmap.h"
#include "../inc/hw_i2c.h"
#include "debug.h"
#include "interrupt.h"
#include "cpu.h"
Include dependency graph for i2c.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define I2C_CONTROLLER_CMD_SINGLE_SEND   0x00000007
 
#define I2C_CONTROLLER_CMD_SINGLE_RECEIVE   0x00000007
 
#define I2C_CONTROLLER_CMD_BURST_SEND_START   0x00000003
 
#define I2C_CONTROLLER_CMD_BURST_SEND_CONT   0x00000001
 
#define I2C_CONTROLLER_CMD_BURST_SEND_FINISH   0x00000005
 
#define I2C_CONTROLLER_CMD_BURST_SEND_ERROR_STOP   0x00000004
 
#define I2C_CONTROLLER_CMD_BURST_RECEIVE_START   0x0000000b
 
#define I2C_CONTROLLER_CMD_BURST_RECEIVE_CONT   0x00000009
 
#define I2C_CONTROLLER_CMD_BURST_RECEIVE_FINISH   0x00000005
 
#define I2C_CONTROLLER_CMD_BURST_RECEIVE_ERROR_STOP   0x00000004
 
#define I2C_CONTROLLER_ERR_NONE   0
 
#define I2C_CONTROLLER_ERR_ADDR_ACK   0x00000004
 
#define I2C_CONTROLLER_ERR_DATA_ACK   0x00000008
 
#define I2C_CONTROLLER_ERR_ARB_LOST   0x00000010
 
#define I2C_TARGET_ACT_NONE   0
 
#define I2C_TARGET_ACT_RREQ   0x00000001
 
#define I2C_TARGET_ACT_TREQ   0x00000002
 
#define I2C_TARGET_ACT_RREQ_FBR   0x00000005
 
#define I2C_TARGET_INT_STOP   0x00000004
 
#define I2C_TARGET_INT_START   0x00000002
 
#define I2C_TARGET_INT_DATA   0x00000001
 
#define I2C_CLK_FREQ   48000000
 

Functions

void I2CControllerInitExpClk (uint32_t base, bool fast)
 Initializes the I2C Controller module. More...
 
__STATIC_INLINE void I2CControllerCommand (uint32_t base, uint32_t cmd)
 Controls the state of the I2C Controller module. More...
 
__STATIC_INLINE void I2CControllerSetTargetAddr (uint32_t base, uint8_t targetAddr, bool receive)
 Sets the address that the I2C Controller will place on the bus. More...
 
__STATIC_INLINE void I2CControllerEnable (uint32_t base)
 Enables the I2C Controller module. More...
 
__STATIC_INLINE void I2CControllerDisable (uint32_t base)
 Disables the I2C controller module. More...
 
__STATIC_INLINE bool I2CControllerBusy (uint32_t base)
 Indicates whether or not the I2C Controller is busy. More...
 
__STATIC_INLINE bool I2CControllerBusBusy (uint32_t base)
 Indicates whether or not the I2C bus is busy. More...
 
__STATIC_INLINE uint32_t I2CControllerGetData (uint32_t base)
 Receives a byte that has been sent to the I2C Controller. More...
 
__STATIC_INLINE void I2CControllerPutData (uint32_t base, uint8_t data)
 Transmits a byte from the I2C Controller. More...
 
uint32_t I2CControllerError (uint32_t base)
 Gets the error status of the I2C Controller module. More...
 
__STATIC_INLINE void I2CControllerEnableInt (uint32_t base)
 Enables the I2C Controller interrupt. More...
 
__STATIC_INLINE void I2CControllerDisableInt (uint32_t base)
 Disables the I2C Controller interrupt. More...
 
__STATIC_INLINE void I2CControllerClearInt (uint32_t base)
 Clears I2C Controller interrupt sources. More...
 
__STATIC_INLINE bool I2CControllerIntStatus (uint32_t base, bool masked)
 Gets the current I2C Controller interrupt status. More...
 
__STATIC_INLINE void I2CTargetEnable (uint32_t base)
 Enables the I2C Target module. More...
 
__STATIC_INLINE void I2CTargetInit (uint32_t base, uint8_t targetAddr)
 Initializes the I2C Target module. More...
 
__STATIC_INLINE void I2CTargetSetAddress (uint32_t base, uint8_t targetAddr)
 Sets the I2C target address. More...
 
__STATIC_INLINE void I2CTargetDisable (uint32_t base)
 Disables the I2C target module. More...
 
__STATIC_INLINE uint32_t I2CTargetStatus (uint32_t base)
 Gets the I2C Target module status. More...
 
__STATIC_INLINE uint32_t I2CTargetGetData (uint32_t base)
 Receives a byte that has been sent to the I2C Target. More...
 
__STATIC_INLINE void I2CTargetPutData (uint32_t base, uint8_t data)
 Transmits a byte from the I2C Target. More...
 
__STATIC_INLINE void I2CTargetEnableInt (uint32_t base, uint32_t intFlags)
 Enables individual I2C Target interrupt sources. More...
 
__STATIC_INLINE void I2CTargetDisableInt (uint32_t base, uint32_t intFlags)
 Disables individual I2C Target interrupt sources. More...
 
__STATIC_INLINE void I2CTargetClearInt (uint32_t base, uint32_t intFlags)
 Clears I2C Target interrupt sources. More...
 
__STATIC_INLINE uint32_t I2CTargetIntStatus (uint32_t base, bool masked)
 Gets the current I2C Target interrupt status. More...