Data Structures | Macros | Functions
i2c.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <ti/devices/msp432p4xx/inc/msp.h>
#include <ti/devices/msp432p4xx/driverlib/eusci.h>

Go to the source code of this file.

Data Structures

struct  eUSCI_I2C_MasterConfig
 

Macros

#define EUSCI_B_I2C_NO_AUTO_STOP   EUSCI_B_CTLW1_ASTP_0
 
#define EUSCI_B_I2C_SET_BYTECOUNT_THRESHOLD_FLAG   EUSCI_B_CTLW1_ASTP_1
 
#define EUSCI_B_I2C_SEND_STOP_AUTOMATICALLY_ON_BYTECOUNT_THRESHOLD   EUSCI_B_CTLW1_ASTP_2
 
#define EUSCI_B_I2C_SET_DATA_RATE_1MBPS   1000000
 
#define EUSCI_B_I2C_SET_DATA_RATE_400KBPS   400000
 
#define EUSCI_B_I2C_SET_DATA_RATE_100KBPS   100000
 
#define EUSCI_B_I2C_CLOCKSOURCE_ACLK   EUSCI_B_CTLW0_SSEL__ACLK
 
#define EUSCI_B_I2C_CLOCKSOURCE_SMCLK   EUSCI_B_CTLW0_SSEL__SMCLK
 
#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET0   0x00
 
#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET1   0x02
 
#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET2   0x04
 
#define EUSCI_B_I2C_OWN_ADDRESS_OFFSET3   0x06
 
#define EUSCI_B_I2C_OWN_ADDRESS_DISABLE   0x00
 
#define EUSCI_B_I2C_OWN_ADDRESS_ENABLE   EUSCI_B_I2COA0_OAEN
 
#define EUSCI_B_I2C_TRANSMIT_MODE   EUSCI_B_CTLW0_TR
 
#define EUSCI_B_I2C_RECEIVE_MODE   0x00
 
#define EUSCI_B_I2C_TIMEOUT_DISABLE   EUSCI_B_CTLW1_CLTO_0
 
#define EUSCI_B_I2C_TIMEOUT_28_MS   EUSCI_B_CTLW1_CLTO_1
 
#define EUSCI_B_I2C_TIMEOUT_31_MS   EUSCI_B_CTLW1_CLTO_2
 
#define EUSCI_B_I2C_TIMEOUT_34_MS   EUSCI_B_CTLW1_CLTO_3
 
#define EUSCI_B_I2C_NAK_INTERRUPT   EUSCI_B_IE_NACKIE
 
#define EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT   EUSCI_B_IE_ALIE
 
#define EUSCI_B_I2C_STOP_INTERRUPT   EUSCI_B_IE_STPIE
 
#define EUSCI_B_I2C_START_INTERRUPT   EUSCI_B_IE_STTIE
 
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT0   EUSCI_B_IE_TXIE0
 
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT1   EUSCI_B_IE_TXIE1
 
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT2   EUSCI_B_IE_TXIE2
 
#define EUSCI_B_I2C_TRANSMIT_INTERRUPT3   EUSCI_B_IE_TXIE3
 
#define EUSCI_B_I2C_RECEIVE_INTERRUPT0   EUSCI_B_IE_RXIE0
 
#define EUSCI_B_I2C_RECEIVE_INTERRUPT1   EUSCI_B_IE_RXIE1
 
#define EUSCI_B_I2C_RECEIVE_INTERRUPT2   EUSCI_B_IE_RXIE2
 
#define EUSCI_B_I2C_RECEIVE_INTERRUPT3   EUSCI_B_IE_RXIE3
 
#define EUSCI_B_I2C_BIT9_POSITION_INTERRUPT   EUSCI_B_IE_BIT9IE
 
#define EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT   EUSCI_B_IE_CLTOIE
 
#define EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT   EUSCI_B_IE_BCNTIE
 
#define EUSCI_B_I2C_BUS_BUSY   EUSCI_B_STATW_BBUSY
 
#define EUSCI_B_I2C_BUS_NOT_BUSY   0x00
 
#define EUSCI_B_I2C_STOP_SEND_COMPLETE   0x00
 
#define EUSCI_B_I2C_SENDING_STOP   EUSCI_B_CTLW0_TXSTP
 
#define EUSCI_B_I2C_START_SEND_COMPLETE   0x00
 
#define EUSCI_B_I2C_SENDING_START   EUSCI_B_CTLW0_TXSTT
 
#define EUSCI_B_I2C_slaveInit   I2C_initSlave
 
#define EUSCI_B_I2C_enable   I2C_enableModule
 
#define EUSCI_B_I2C_disable   I2C_disableModule
 
#define EUSCI_B_I2C_setSlaveAddress   I2C_setSlaveAddress
 
#define EUSCI_B_I2C_setMode   I2C_setMode
 
#define EUSCI_B_I2C_getMode   I2C_getMode
 
#define EUSCI_B_I2C_slaveDataPut   I2C_slavePutData
 
#define EUSCI_B_I2C_slaveDataGet   I2C_slaveGetData
 
#define EUSCI_B_I2C_isBusBusy   I2C_isBusBusy
 
#define EUSCI_B_I2C_masterIsStopSent   I2C_masterIsStopSent
 
#define EUSCI_B_I2C_masterIsStartSent   I2C_masterIsStartSent
 
#define EUSCI_B_I2C_enableInterrupt   I2C_enableInterrupt
 
#define EUSCI_B_I2C_disableInterrupt   I2C_disableInterrupt
 
#define EUSCI_B_I2C_clearInterruptFlag   I2C_clearInterruptFlag
 
#define EUSCI_B_I2C_getInterruptStatus   I2C_getEnabledInterruptStatus
 
#define EUSCI_B_I2C_masterSendSingleByte   I2C_masterSendSingleByte
 
#define EUSCI_B_I2C_masterReceiveSingleByte   I2C_masterReceiveSingleByte
 
#define EUSCI_B_I2C_masterSendSingleByteWithTimeout   I2C_masterSendSingleByteWithTimeout
 
#define EUSCI_B_I2C_masterMultiByteSendStart   I2C_masterSendMultiByteStart
 
#define EUSCI_B_I2C_masterMultiByteSendStartWithTimeout   I2C_masterSendMultiByteStartWithTimeout
 
#define EUSCI_B_I2C_masterMultiByteSendNext   I2C_masterSendMultiByteNext
 
#define EUSCI_B_I2C_masterMultiByteSendNextWithTimeout   I2C_masterSendMultiByteNextWithTimeout
 
#define EUSCI_B_I2C_masterMultiByteSendFinish   I2C_masterSendMultiByteFinish
 
#define EUSCI_B_I2C_masterMultiByteSendFinishWithTimeout   I2C_masterSendMultiByteFinishWithTimeout
 
#define EUSCI_B_I2C_masterSendStart   I2C_masterSendStart
 
#define EUSCI_B_I2C_masterMultiByteSendStop   I2C_masterSendMultiByteStop
 
#define EUSCI_B_I2C_masterMultiByteSendStopWithTimeout   I2C_masterSendMultiByteStopWithTimeout
 
#define EUSCI_B_I2C_masterReceiveStart   I2C_masterReceiveStart
 
#define EUSCI_B_I2C_masterMultiByteReceiveNext   I2C_masterReceiveMultiByteNext
 
#define EUSCI_B_I2C_masterMultiByteReceiveFinish   I2C_masterReceiveMultiByteFinish
 
#define EUSCI_B_I2C_masterMultiByteReceiveFinishWithTimeout   I2C_masterReceiveMultiByteFinishWithTimeout
 
#define EUSCI_B_I2C_masterMultiByteReceiveStop   I2C_masterReceiveMultiByteStop
 
#define EUSCI_B_I2C_enableMultiMasterMode   I2C_enableMultiMasterMode
 
#define EUSCI_B_I2C_disableMultiMasterMode   I2C_disableMultiMasterMode
 
#define EUSCI_B_I2C_masterSingleReceive   I2C_masterReceiveSingle
 
#define EUSCI_B_I2C_getReceiveBufferAddressForDMA   I2C_getReceiveBufferAddressForDMA
 
#define EUSCI_B_I2C_getTransmitBufferAddressForDMA   I2C_getTransmitBufferAddressForDMA
 

Functions

void I2C_initMaster (uint32_t moduleInstance, const eUSCI_I2C_MasterConfig *config)
 
void I2C_initSlave (uint32_t moduleInstance, uint_fast16_t slaveAddress, uint_fast8_t slaveAddressOffset, uint32_t slaveOwnAddressEnable)
 
void I2C_enableModule (uint32_t moduleInstance)
 
void I2C_disableModule (uint32_t moduleInstance)
 
void I2C_setSlaveAddress (uint32_t moduleInstance, uint_fast16_t slaveAddress)
 
void I2C_setMode (uint32_t moduleInstance, uint_fast8_t mode)
 
void I2C_setTimeout (uint32_t moduleInstance, uint_fast16_t timeout)
 
uint_fast8_t I2C_getMode (uint32_t moduleInstance)
 Gets the mode of the I2C device. More...
 
void I2C_slavePutData (uint32_t moduleInstance, uint8_t transmitData)
 
uint8_t I2C_slaveGetData (uint32_t moduleInstance)
 
uint8_t I2C_isBusBusy (uint32_t moduleInstance)
 
void I2C_masterSendSingleByte (uint32_t moduleInstance, uint8_t txData)
 
bool I2C_masterSendSingleByteWithTimeout (uint32_t moduleInstance, uint8_t txData, uint32_t timeout)
 
void I2C_masterSendMultiByteStart (uint32_t moduleInstance, uint8_t txData)
 
bool I2C_masterSendMultiByteStartWithTimeout (uint32_t moduleInstance, uint8_t txData, uint32_t timeout)
 
void I2C_masterSendMultiByteNext (uint32_t moduleInstance, uint8_t txData)
 
bool I2C_masterSendMultiByteNextWithTimeout (uint32_t moduleInstance, uint8_t txData, uint32_t timeout)
 
bool I2C_masterSendMultiByteFinish (uint32_t moduleInstance, uint8_t txData)
 
bool I2C_masterSendMultiByteFinishWithTimeout (uint32_t moduleInstance, uint8_t txData, uint32_t timeout)
 
void I2C_masterSendMultiByteStop (uint32_t moduleInstance)
 
bool I2C_masterSendMultiByteStopWithTimeout (uint32_t moduleInstance, uint32_t timeout)
 
void I2C_masterReceiveStart (uint32_t moduleInstance)
 
uint8_t I2C_masterReceiveMultiByteNext (uint32_t moduleInstance)
 
uint8_t I2C_masterReceiveMultiByteFinish (uint32_t moduleInstance)
 
bool I2C_masterReceiveMultiByteFinishWithTimeout (uint32_t moduleInstance, uint8_t *txData, uint32_t timeout)
 
void I2C_masterReceiveMultiByteStop (uint32_t moduleInstance)
 
uint8_t I2C_masterReceiveSingleByte (uint32_t moduleInstance)
 
uint8_t I2C_masterReceiveSingle (uint32_t moduleInstance)
 
uint32_t I2C_getReceiveBufferAddressForDMA (uint32_t moduleInstance)
 
uint32_t I2C_getTransmitBufferAddressForDMA (uint32_t moduleInstance)
 
uint8_t I2C_masterIsStopSent (uint32_t moduleInstance)
 
bool I2C_masterIsStartSent (uint32_t moduleInstance)
 
void I2C_masterSendStart (uint32_t moduleInstance)
 
void I2C_enableMultiMasterMode (uint32_t moduleInstance)
 
void I2C_disableMultiMasterMode (uint32_t moduleInstance)
 
void I2C_enableInterrupt (uint32_t moduleInstance, uint_fast16_t mask)
 
void I2C_disableInterrupt (uint32_t moduleInstance, uint_fast16_t mask)
 
void I2C_clearInterruptFlag (uint32_t moduleInstance, uint_fast16_t mask)
 
uint_fast16_t I2C_getInterruptStatus (uint32_t moduleInstance, uint16_t mask)
 
uint_fast16_t I2C_getEnabledInterruptStatus (uint32_t moduleInstance)
 
void I2C_registerInterrupt (uint32_t moduleInstance, void(*intHandler)(void))
 
void I2C_unregisterInterrupt (uint32_t moduleInstance)
 
void I2C_slaveSendNAK (uint32_t moduleInstance)
 

Copyright 2018, Texas Instruments Incorporated