Macros | |
#define | I2C_WRITE 0 |
R/W state when write is received. | |
#define | I2C_READ 1 |
R/W state when read is received. | |
Functions | |
void | SMBus_PHY_disable (SMBus *smbus) |
Disables the PHY and Data Link layer. More... | |
void | SMBus_PHY_enable (SMBus *smbus) |
Enables the PHY and Data Link layer. More... | |
void | SMBus_PHY_slaveEnable (SMBus *smbus) |
Enables the PHY and Data Link layer for slave operation. More... | |
void | SMBus_PHY_slaveEnableInt (SMBus *smbus) |
Enables the I2C interrupts. More... | |
void | SMBus_PHY_slaveInit (SMBus *smbus, uint16_t i2cAddr) |
Initializes the I2C Slave module supporting SMBus functionality. More... | |
SMBus_State | SMBus_PHY_slaveProcessInt (SMBus *smbus) |
I2C Interrupt Service routine. More... | |
SMBus_State | SMBus_PHY_slaveProcessTimeoutInt (SMBus *smbus) |
This function is not used in the MSP430FR5xx_6xx implementation. | |
void | SMBus_PHY_masterEnable (SMBus *smbus) |
Enables the PHY and Data Link layer. More... | |
void | SMBus_PHY_masterEnableInt (SMBus *smbus) |
Enables the I2C interrupts. More... | |
void | SMBus_PHY_masterInit (SMBus *smbus, uint16_t i2cAddr, uint32_t busClk) |
Initializes the I2C Master module supporting SMBus functionality. More... | |
void | SMBus_PHY_masterSendStop (SMBus *smbus) |
Generate Stop condition if it hasn't been sent. More... | |
void | SMBus_PHY_masterSendPreStop (SMBus *smbus) |
Prepare to send stop at next byte. More... | |
void | SMBus_PHY_masterStartTx (SMBus *smbus, uint8_t targetaddr, SMBus_Stop stopFlag) |
Start a TX transfer. More... | |
void | SMBus_PHY_masterStartRx (SMBus *smbus, uint8_t targetaddr, SMBus_Stop stopFlag) |
Start a RX transfer. More... | |
SMBus_State | SMBus_PHY_masterProcessInt (SMBus *smbus) |
I2C Interrupt Service routine. More... | |
SMBus_State | SMBus_PHY_masterProcessTimeoutInt (SMBus *smbus) |
This function is not used in the MSP430FR5xx_6xx implementation. | |
void SMBus_PHY_disable | ( | SMBus * | smbus | ) |
Disables the PHY and Data Link layer.
*smbus | Pointer to SMBus structure |
References SMBus_Ctrl::bits, SMBus::ctrl, and SMBus_Ctrl::phyEn.
Referenced by SMBus_NWK_masterReset(), SMBus_NWK_slaveProcessTimeout(), SMBus_PHY_masterEnable(), and SMBus_PHY_slaveEnable().
void SMBus_PHY_enable | ( | SMBus * | smbus | ) |
Enables the PHY and Data Link layer.
*smbus | Pointer to SMBus structure |
References SMBus_Ctrl::bits, SMBus::ctrl, SMBus_Ctrl::master, SMBus_PHY_masterEnable(), and SMBus_PHY_slaveEnable().
Referenced by SMBus_slaveSetAddress().
void SMBus_PHY_masterEnable | ( | SMBus * | smbus | ) |
Enables the PHY and Data Link layer.
*smbus | Pointer to SMBus structure |
References SMBus_Ctrl::bits, SMBus::ctrl, SMBus_Ctrl::intEn, SMBus::ownSlaveAddr, SMBus_Ctrl::phyEn, SMBus_masterEnableInt(), and SMBus_PHY_disable().
Referenced by SMBus_NWK_masterReset(), SMBus_PHY_enable(), and SMBus_PHY_masterInit().
void SMBus_PHY_masterEnableInt | ( | SMBus * | smbus | ) |
Enables the I2C interrupts.
This function enables the eUSCI Start,Stop, RX,TX, Timeout interrupts. If Manual_ACK is enabled, it enables DMA to handle the RX SMBus_PHY_slaveInit() must be called before this function.
*smbus | Pointer to SMBus structure |
References SMBus_Ctrl::bits, SMBus::ctrl, and SMBus_Ctrl::intEn.
Referenced by SMBus_masterEnableInt().
void SMBus_PHY_masterInit | ( | SMBus * | smbus, |
uint16_t | i2cAddr, | ||
uint32_t | busClk | ||
) |
Initializes the I2C Master module supporting SMBus functionality.
smbus | Pointer to SMBus structure |
i2cAddr | Base address of I2C module |
busClk | SMCLK Frequency (used for eUSCI) |
References SMBus::ownSlaveAddr, SMBus_PHY_masterEnable(), and SMBus_Phy::SMBus_Phy_stop.
Referenced by SMBus_masterInit().
SMBus_State SMBus_PHY_masterProcessInt | ( | SMBus * | smbus | ) |
I2C Interrupt Service routine.
Handles the interrupts from eUSCI module and passes the information to the network layer. Should be called by application when an eUSCI interrupt is detected.
smbus | Pointer to SMBus structure |
References SMBus_NWK_masterProcessNACK(), SMBus_NWK_masterProcessRx(), SMBus_NWK_masterProcessStop(), SMBus_NWK_masterProcessTimeout(), SMBus_NWK_masterProcessTx(), SMBus_Phy::SMBus_Phy_stop, SMBus_Stop_PreRead, and SMBus_Stop_Sent.
Referenced by SMBus_masterProcessInt().
void SMBus_PHY_masterSendPreStop | ( | SMBus * | smbus | ) |
Prepare to send stop at next byte.
smbus | Pointer to SMBus structure |
References SMBus_Phy::SMBus_Phy_stop, and SMBus_Stop_PreRead.
Referenced by SMBus_NWK_masterProcessRx().
void SMBus_PHY_masterSendStop | ( | SMBus * | smbus | ) |
Generate Stop condition if it hasn't been sent.
smbus | Pointer to SMBus structure |
References SMBus_Phy::SMBus_Phy_stop, and SMBus_Stop_Sent.
Referenced by SMBus_NWK_masterProcessNACK(), SMBus_NWK_masterProcessRx(), and SMBus_NWK_masterProcessTx().
void SMBus_PHY_masterStartRx | ( | SMBus * | smbus, |
uint8_t | targetaddr, | ||
SMBus_Stop | stopFlag | ||
) |
Start a RX transfer.
smbus | Pointer to SMBus structure |
targetaddr | Slave target address |
stopFlag | Indicates the stop condition |
References SMBus_Phy::SMBus_Phy_stop, SMBus_Stop_Addr, SMBus_Stop_Immediate, SMBus_Stop_PreRead, and SMBus_Stop_Sent.
Referenced by SMBus_NWK_startRxTransfer().
void SMBus_PHY_masterStartTx | ( | SMBus * | smbus, |
uint8_t | targetaddr, | ||
SMBus_Stop | stopFlag | ||
) |
Start a TX transfer.
smbus | Pointer to SMBus structure |
targetaddr | Slave target address |
stopFlag | Indicates the stop condition |
References SMBus_Phy::SMBus_Phy_stop, SMBus_Stop_Immediate, and SMBus_Stop_Sent.
Referenced by SMBus_NWK_startTxTransfer().
void SMBus_PHY_slaveEnable | ( | SMBus * | smbus | ) |
Enables the PHY and Data Link layer for slave operation.
*smbus | Pointer to SMBus structure |
References SMBus_Ctrl::bits, SMBus::ctrl, SMBus_Ctrl::intEn, SMBus::ownSlaveAddr, SMBus_Ctrl::phyEn, SMBus_PHY_disable(), SMBus_slaveEnableInt(), and SMBus_Ctrl::swackEn.
Referenced by SMBus_NWK_slaveProcessTimeout(), SMBus_PHY_enable(), and SMBus_PHY_slaveInit().
void SMBus_PHY_slaveEnableInt | ( | SMBus * | smbus | ) |
Enables the I2C interrupts.
This function enables the eUSCI Start,Stop, RX,TX, Timeout interrupts. If Manual_ACK is enabled, it enables DMA to handle the RX SMBus_PHY_slaveInit() must be called before this function.
*smbus | Pointer to SMBus structure |
References SMBus_Ctrl::bits, SMBus::ctrl, SMBus_Ctrl::intEn, and SMBus_Ctrl::swackEn.
Referenced by SMBus_slaveEnableInt().
void SMBus_PHY_slaveInit | ( | SMBus * | smbus, |
uint16_t | i2cAddr | ||
) |
Initializes the I2C Slave module supporting SMBus functionality.
*smbus | Pointer to SMBus structure |
i2cAddr | Base address of I2C module |
References SMBus::ownSlaveAddr, and SMBus_PHY_slaveEnable().
Referenced by SMBus_slaveInit().
SMBus_State SMBus_PHY_slaveProcessInt | ( | SMBus * | smbus | ) |
I2C Interrupt Service routine.
Handles the interrupts from eUSCI module and passes the information to the network layer. Should be called by application when an eUSCI interrupt is detected.
smbus | Pointer to SMBus structure |
References I2C_READ, SMBus_NWK_slaveProcessRx(), SMBus_NWK_slaveProcessStart(), SMBus_NWK_slaveProcessStop(), SMBus_NWK_slaveProcessTimeout(), SMBus_NWK_slaveProcessTx(), and SMBus_State_Slave_NTR.
Referenced by SMBus_slaveProcessInt().