SMBus Library for MSP430FR5xx_6xx Devices  1.10.00.00
 All Data Structures Functions Variables Enumerations Enumerator Modules Pages
MSP430 PHY layer

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.
 

Detailed Description

Function Documentation

void SMBus_PHY_disable ( SMBus smbus)

Disables the PHY and Data Link layer.

Parameters
*smbusPointer to SMBus structure
Returns
None

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.

Parameters
*smbusPointer to SMBus structure
Returns
None

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.

Parameters
*smbusPointer to SMBus structure
Returns
None

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.

Parameters
*smbusPointer to SMBus structure
Returns
None

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.

  • Resets and then configures the I2C for SMBus support
  • I2C is enabled using Automatic ACK and Slave address is initialized to 0x00
    Parameters
    smbusPointer to SMBus structure
    i2cAddrBase address of I2C module
    busClkSMCLK Frequency (used for eUSCI)
    Returns
    None

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.

Parameters
smbusPointer to SMBus structure
Returns
The new state of master (see SMBus_masterProcessInt())

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.

Parameters
smbusPointer to SMBus structure
Returns
None

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.

Parameters
smbusPointer to SMBus structure
Returns
None

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.

Parameters
smbusPointer to SMBus structure
targetaddrSlave target address
stopFlagIndicates the stop condition
Returns
None

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.

Parameters
smbusPointer to SMBus structure
targetaddrSlave target address
stopFlagIndicates the stop condition
Returns
None

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.

Parameters
*smbusPointer to SMBus structure
Returns
None

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.

Parameters
*smbusPointer to SMBus structure
Returns
None

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.

  • Resets and then configures the I2C for SMBus support
  • I2C is enabled using Automatic ACK and Slave address is initialized to 0x00
  • Call SMBus_slaveSetAddress() in order to set the Slave address
  • Call SMBus_slaveEnableManualACK() in order to enable Manual ACK
    Parameters
    *smbusPointer to SMBus structure
    i2cAddrBase 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.

Parameters
smbusPointer to SMBus structure
Returns
The new state of Slave (see SMBus_slaveProcessInt())

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().


Copyright 2015, Texas Instruments Incorporated