Kamcho Library 02.00.03
lib.kamcho.02.00.03.287
|
Go to the source code of this file.
Data Structures | |
struct | I2C_SFRS_t |
A structure to represent Special Function Registers for I2C. More... | |
Macros | |
#define | I2C_SFRS ((__IO I2C_SFRS_t *) (SDIO_BASE + 0x08)) |
The starting address of I2C SFRS. More... | |
#define | E_I2C_STATUS_BIT_IRBUFOVL ((uint8_t) (1<<0)) |
The enumeration of I2C status. More... | |
#define | E_I2C_STATUS_BIT_IWBUFOVL ((uint8_t) (1<<1)) |
#define | E_I2C_STATUS_BIT_IBUFF ((uint8_t) (1<<2)) |
#define | E_I2C_STATUS_BIT_IRWBUSY ((uint8_t) (1<<3)) |
#define | E_I2C_STATUS_BIT_ISTPR ((uint8_t) (1<<4)) |
#define | E_I2C_STATUS_BIT_ISTRR ((uint8_t) (1<<5)) |
#define | E_I2C_STATUS_BIT_IADDRR ((uint8_t) (1<<6)) |
#define | E_I2C_STATUS_BIT_IACKR ((uint8_t) (1<<7)) |
#define | E_I2C_CTRL1_BIT_ISTRSTRETCH ((uint8_t) (1<<0)) |
The enumeration of I2C control 1 register. More... | |
#define | E_I2C_CTRL1_BIT_ISTPSIZE ((uint8_t) (1<<1)) |
#define | E_I2C_CTRL1_BIT_ISACK ((uint8_t) (1<<2)) |
#define | E_I2C_CTRL1_BIT_ISNACK ((uint8_t) (1<<3)) |
#define | E_I2C_CTRL1_BIT_IRCSTRT ((uint8_t) (1<<4)) |
#define | E_I2C_CTRL1_BIT_IGC ((uint8_t) (1<<5)) |
#define | E_I2C_CTRL1_BIT_ICLKSTR ((uint8_t) (1<<6)) |
#define | E_I2C_CTRL1_BIT_IRSTR ((uint8_t) (1<<7)) |
Functions | |
static __INLINE void | f_I2C_Enable (void) |
Enable I2C Module. More... | |
static __INLINE void | f_I2C_Disable (void) |
Disable I2C Module. More... | |
static __INLINE void | f_I2C_WriteData (uint8_t data) |
Write a byte to I2C module. More... | |
static __INLINE uint8_t | f_I2C_ReadData (void) |
Read a byte from I2C module. More... | |
static __INLINE uint8_t | f_I2C_GetStatus (void) |
Get the status of I2C module. More... | |
static __INLINE void | f_I2C_SlaveClockStretch (void) |
Start clock stretch in I2C slave mode. More... | |
static __INLINE void | f_I2C_SlaveReleaseClock (void) |
Release clock stretch in I2C slave mode. More... | |
static __INLINE void | f_I2C_SlaveEnableGeneralCall (void) |
Enable general call mode in I2C slave mode. More... | |
static __INLINE void | f_I2C_SlaveDisableGeneralCall (void) |
Disable general call mode in I2C slave mode. More... | |
static __INLINE void | f_I2C_SlaveAddreeSizeTen (void) |
Set slave address length. More... | |
static __INLINE void | f_I2C_MasterRepeatStart (void) |
Send Repeat Start bit in I2C master mode. More... | |
static __INLINE void | f_I2C_MasterReceiveStart (void) |
Start to receive data in I2C master mode. More... | |
static __INLINE void | f_I2C_MasterIssueNack (void) |
Issue NACK bit in I2C master mode. More... | |
static __INLINE void | f_I2C_MasterIssueAck (void) |
Issue Ack bit in I2C master mode. More... | |
static __INLINE void | f_I2C_MasterIssueStop (void) |
Issue a Stop bit in I2C master mode. More... | |
static __INLINE void | f_I2C_MasterIssueStart (void) |
Issue a Start bit in I2C master mode. More... | |
static __INLINE void | f_I2C_InitMasterMode (void) |
Initialize I2C module to master mode. More... | |
static __INLINE void | f_I2C_InitSlaveMode (void) |
Initialize I2C module to slave mode. More... | |
static __INLINE uint8_t | f_I2C_IsMasterMode (void) |
Check if I2C module a master mode. More... | |
static __INLINE void | f_I2C_Set7BitSlaveAddr (void) |
Set I2C slave address in 7-bit mode. More... | |
static __INLINE void | f_I2C_Set10BitSlaveAddr (void) |
Set I2C slave address in 10-bit mode. More... | |
static __INLINE void | f_I2C_EnableFilter (void) |
Enable I2C filter. More... | |
static __INLINE void | f_I2C_DisableFilter (void) |
Disable I2C filter. More... | |
static __INLINE void | f_I2C_SetSlaveAddress (uint16_t addr) |
Set I2C address in slave mode. More... | |
static __INLINE void | f_I2C_SetSlaveAddressMask (uint16_t mask) |
Set I2C address mask in slave mode. More... | |
static __INLINE void | f_I2C_SetClockDivider (uint8_t div) |
Set clock divider for I2C module. More... | |
static __INLINE uint8_t | f_I2C_WriteBuffNotEmpty (void) |
Check if I2C write buffer full. More... | |
static __INLINE uint8_t | f_I2C_BuffFull (void) |
Check if I2C buffer full. More... | |
static __INLINE uint8_t | f_I2C_StartBitReceived (void) |
Check if I2C Start bit is received. More... | |
This file is proprietary to Indie Semiconductor. All rights reserved. Reproduction or distribution, in whole or in part, is forbidden except by express written permission of Indie Semiconductor.
#define E_I2C_CTRL1_BIT_ICLKSTR ((uint8_t) (1<<6)) |
Release clock stretch
#define E_I2C_CTRL1_BIT_IGC ((uint8_t) (1<<5)) |
Enable general call
#define E_I2C_CTRL1_BIT_IRCSTRT ((uint8_t) (1<<4)) |
Start receiving
#define E_I2C_CTRL1_BIT_IRSTR ((uint8_t) (1<<7)) |
Send Repeat Start bit
#define E_I2C_CTRL1_BIT_ISACK ((uint8_t) (1<<2)) |
Issue Ack
#define E_I2C_CTRL1_BIT_ISNACK ((uint8_t) (1<<3)) |
Set Ack bit value
#define E_I2C_CTRL1_BIT_ISTPSIZE ((uint8_t) (1<<1)) |
Issue a Stop bit
#define E_I2C_CTRL1_BIT_ISTRSTRETCH ((uint8_t) (1<<0)) |
The enumeration of I2C control 1 register.
Start clock stretch
#define E_I2C_STATUS_BIT_IACKR ((uint8_t) (1<<7)) |
Ack Received
#define E_I2C_STATUS_BIT_IADDRR ((uint8_t) (1<<6)) |
Data or address received in slave mode
#define E_I2C_STATUS_BIT_IBUFF ((uint8_t) (1<<2)) |
Buffer full
#define E_I2C_STATUS_BIT_IRBUFOVL ((uint8_t) (1<<0)) |
The enumeration of I2C status.
Read buffer overflow
#define E_I2C_STATUS_BIT_IRWBUSY ((uint8_t) (1<<3)) |
Read or write busy
#define E_I2C_STATUS_BIT_ISTPR ((uint8_t) (1<<4)) |
Stop bit received in slave mode
#define E_I2C_STATUS_BIT_ISTRR ((uint8_t) (1<<5)) |
Start bit received
#define E_I2C_STATUS_BIT_IWBUFOVL ((uint8_t) (1<<1)) |
Write buffer overflow
#define I2C_SFRS ((__IO I2C_SFRS_t *) (SDIO_BASE + 0x08)) |
The starting address of I2C SFRS.
|
static |
Check if I2C buffer full.
|
static |
Disable I2C Module.
|
static |
Disable I2C filter.
|
static |
Enable I2C Module.
|
static |
Enable I2C filter.
|
static |
Get the status of I2C module.
|
static |
Initialize I2C module to master mode.
|
static |
Initialize I2C module to slave mode.
|
static |
Check if I2C module a master mode.
|
static |
Issue Ack bit in I2C master mode.
|
static |
Issue NACK bit in I2C master mode.
|
static |
Issue a Start bit in I2C master mode.
|
static |
Issue a Stop bit in I2C master mode.
|
static |
Start to receive data in I2C master mode.
|
static |
Send Repeat Start bit in I2C master mode.
|
static |
Read a byte from I2C module.
|
static |
Set I2C slave address in 10-bit mode.
|
static |
Set I2C slave address in 7-bit mode.
|
static |
Set clock divider for I2C module.
div | The divider for I2C clock. |
|
static |
Set I2C address in slave mode.
addr | The slave address. |
|
static |
Set I2C address mask in slave mode.
mask | The slave address mask. |
|
static |
Set slave address length.
|
static |
Start clock stretch in I2C slave mode.
|
static |
Disable general call mode in I2C slave mode.
|
static |
Enable general call mode in I2C slave mode.
|
static |
Release clock stretch in I2C slave mode.
|
static |
Check if I2C Start bit is received.
|
static |
Check if I2C write buffer full.
|
static |
Write a byte to I2C module.