eUSCI Serial Peripheral Interface (SPI) serial communication module. More...
Data Structures | |
struct | _eUSCI_SPI_MasterConfig |
Type definition for _eUSCI_SPI_MasterConfig structure. More... | |
struct | _eUSCI_SPI_SlaveConfig |
Type definition for _eUSCI_SPI_SlaveConfig structure. More... | |
Typedefs | |
typedef struct _eUSCI_SPI_MasterConfig | eUSCI_SPI_MasterConfig |
typedef struct _eUSCI_SPI_SlaveConfig | eUSCI_SPI_SlaveConfig |
Functions | |
bool | SPI_initMaster (uint32_t moduleInstance, const eUSCI_SPI_MasterConfig *config) |
void | SPI_selectFourPinFunctionality (uint32_t moduleInstance, uint_fast8_t select4PinFunctionality) |
void | SPI_changeMasterClock (uint32_t moduleInstance, uint32_t clockSourceFrequency, uint32_t desiredSpiClock) |
bool | SPI_initSlave (uint32_t moduleInstance, const eUSCI_SPI_SlaveConfig *config) |
void | SPI_changeClockPhasePolarity (uint32_t moduleInstance, uint_fast16_t clockPhase, uint_fast16_t clockPolarity) |
void | SPI_transmitData (uint32_t moduleInstance, uint_fast8_t transmitData) |
uint8_t | SPI_receiveData (uint32_t moduleInstance) |
void | SPI_enableModule (uint32_t moduleInstance) |
void | SPI_disableModule (uint32_t moduleInstance) |
uint32_t | SPI_getReceiveBufferAddressForDMA (uint32_t moduleInstance) |
uint32_t | SPI_getTransmitBufferAddressForDMA (uint32_t moduleInstance) |
uint_fast8_t | SPI_isBusy (uint32_t moduleInstance) |
void | SPI_enableInterrupt (uint32_t moduleInstance, uint_fast8_t mask) |
void | SPI_disableInterrupt (uint32_t moduleInstance, uint_fast8_t mask) |
uint_fast8_t | SPI_getInterruptStatus (uint32_t moduleInstance, uint16_t mask) |
uint_fast8_t | SPI_getEnabledInterruptStatus (uint32_t moduleInstance) |
void | SPI_clearInterruptFlag (uint32_t moduleInstance, uint_fast8_t mask) |
void | SPI_registerInterrupt (uint32_t moduleInstance, void(*intHandler)(void)) |
void | SPI_unregisterInterrupt (uint32_t moduleInstance) |
void | EUSCI_A_SPI_select4PinFunctionality (uint32_t baseAddress, uint8_t select4PinFunctionality) |
Selects 4Pin Functionality. More... | |
void | EUSCI_A_SPI_masterChangeClock (uint32_t baseAddress, uint32_t clockSourceFrequency, uint32_t desiredSpiClock) |
Initializes the SPI Master clock. At the end of this function call, SPI module is left enabled. More... | |
bool | EUSCI_A_SPI_slaveInit (uint32_t baseAddress, uint16_t msbFirst, uint16_t clockPhase, uint16_t clockPolarity, uint16_t spiMode) |
Initializes the SPI Slave block. More... | |
void | EUSCI_A_SPI_changeClockPhasePolarity (uint32_t baseAddress, uint16_t clockPhase, uint16_t clockPolarity) |
Changes the SPI colock phase and polarity. At the end of this function call, SPI module is left enabled. More... | |
void | EUSCI_A_SPI_transmitData (uint32_t baseAddress, uint8_t transmitData) |
Transmits a byte from the SPI Module. More... | |
uint8_t | EUSCI_A_SPI_receiveData (uint32_t baseAddress) |
Receives a byte that has been sent to the SPI Module. More... | |
void | EUSCI_A_SPI_enableInterrupt (uint32_t baseAddress, uint8_t mask) |
Enables individual SPI interrupt sources. More... | |
void | EUSCI_A_SPI_disableInterrupt (uint32_t baseAddress, uint8_t mask) |
Disables individual SPI interrupt sources. More... | |
uint8_t | EUSCI_A_SPI_getInterruptStatus (uint32_t baseAddress, uint8_t mask) |
Gets the current SPI interrupt status. More... | |
void | EUSCI_A_SPI_clearInterruptFlag (uint32_t baseAddress, uint8_t mask) |
Clears the selected SPI interrupt status flag. More... | |
void | EUSCI_A_SPI_enable (uint32_t baseAddress) |
Enables the SPI block. More... | |
void | EUSCI_A_SPI_disable (uint32_t baseAddress) |
Disables the SPI block. More... | |
uint32_t | EUSCI_A_SPI_getReceiveBufferAddressForDMA (uint32_t baseAddress) |
Returns the address of the RX Buffer of the SPI for the DMA module. More... | |
uint32_t | EUSCI_A_SPI_getTransmitBufferAddressForDMA (uint32_t baseAddress) |
Returns the address of the TX Buffer of the SPI for the DMA module. More... | |
bool | EUSCI_A_SPI_isBusy (uint32_t baseAddress) |
Indicates whether or not the SPI bus is busy. More... | |
void | EUSCI_B_SPI_select4PinFunctionality (uint32_t baseAddress, uint8_t select4PinFunctionality) |
Selects 4Pin Functionality. More... | |
void | EUSCI_B_SPI_masterChangeClock (uint32_t baseAddress, uint32_t clockSourceFrequency, uint32_t desiredSpiClock) |
Initializes the SPI Master clock. At the end of this function call, SPI module is left enabled. More... | |
bool | EUSCI_B_SPI_slaveInit (uint32_t baseAddress, uint16_t msbFirst, uint16_t clockPhase, uint16_t clockPolarity, uint16_t spiMode) |
Initializes the SPI Slave block. More... | |
void | EUSCI_B_SPI_changeClockPhasePolarity (uint32_t baseAddress, uint16_t clockPhase, uint16_t clockPolarity) |
Changes the SPI colock phase and polarity. At the end of this function call, SPI module is left enabled. More... | |
void | EUSCI_B_SPI_transmitData (uint32_t baseAddress, uint8_t transmitData) |
Transmits a byte from the SPI Module. More... | |
uint8_t | EUSCI_B_SPI_receiveData (uint32_t baseAddress) |
Receives a byte that has been sent to the SPI Module. More... | |
void | EUSCI_B_SPI_enableInterrupt (uint32_t baseAddress, uint8_t mask) |
Enables individual SPI interrupt sources. More... | |
void | EUSCI_B_SPI_disableInterrupt (uint32_t baseAddress, uint8_t mask) |
Disables individual SPI interrupt sources. More... | |
uint8_t | EUSCI_B_SPI_getInterruptStatus (uint32_t baseAddress, uint8_t mask) |
Gets the current SPI interrupt status. More... | |
void | EUSCI_B_SPI_clearInterruptFlag (uint32_t baseAddress, uint8_t mask) |
Clears the selected SPI interrupt status flag. More... | |
void | EUSCI_B_SPI_enable (uint32_t baseAddress) |
Enables the SPI block. More... | |
void | EUSCI_B_SPI_disable (uint32_t baseAddress) |
Disables the SPI block. More... | |
uint32_t | EUSCI_B_SPI_getReceiveBufferAddressForDMA (uint32_t baseAddress) |
Returns the address of the RX Buffer of the SPI for the DMA module. More... | |
uint32_t | EUSCI_B_SPI_getTransmitBufferAddressForDMA (uint32_t baseAddress) |
Returns the address of the TX Buffer of the SPI for the DMA module. More... | |
bool | EUSCI_B_SPI_isBusy (uint32_t baseAddress) |
Indicates whether or not the SPI bus is busy. More... | |
eUSCI Serial Peripheral Interface (SPI) serial communication module.
This library provides the API for handling a 3-wire SPI communication
The SPI module can be configured as either a master or a slave device.
The SPI module also includes a programmable bit rate clock divider and prescaler to generate the output serial clock derived from the SSI module's input clock.
To use the module as a slave, initialization is done using SPI_initSlave and this is followed by enabling the module using SPI_enableModule . Following this, the interrupts may be enabled as needed. When the receive flag is set, data is first transmitted using SPI_transmitData and this is followed by a data reception by SPI_receiveData .
Below is a very brief code example showing how to configure the SPI module in 3wire master mode.
In the code snippet below, the configuration settings for SPI in 3wire master mode can be seen:
In this code snippet, the SPI module is configured and enabled for 3wire SPI operation using the DriverLib APIs:
#define EUSCI_SPI_CLOCKSOURCE_ACLK EUSCI_B_CTLW0_SSEL__ACLK |
#define EUSCI_SPI_CLOCKSOURCE_SMCLK EUSCI_B_CTLW0_SSEL__SMCLK |
#define EUSCI_SPI_MSB_FIRST EUSCI_B_CTLW0_MSB |
#define EUSCI_SPI_LSB_FIRST 0x00 |
#define EUSCI_SPI_BUSY EUSCI_A_STATW_BUSY |
#define EUSCI_SPI_NOT_BUSY 0x00 |
#define EUSCI_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT 0x00 |
#define EUSCI_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT EUSCI_B_CTLW0_CKPH |
#define EUSCI_SPI_3PIN EUSCI_B_CTLW0_MODE_0 |
#define EUSCI_SPI_4PIN_UCxSTE_ACTIVE_HIGH EUSCI_B_CTLW0_MODE_1 |
#define EUSCI_SPI_4PIN_UCxSTE_ACTIVE_LOW EUSCI_B_CTLW0_MODE_2 |
#define EUSCI_SPI_CLOCKPOLARITY_INACTIVITY_HIGH EUSCI_B_CTLW0_CKPL |
#define EUSCI_SPI_CLOCKPOLARITY_INACTIVITY_LOW 0x00 |
#define EUSCI_SPI_TRANSMIT_INTERRUPT EUSCI_B_IE_TXIE_OFS |
Referenced by SPI_getEnabledInterruptStatus().
#define EUSCI_SPI_RECEIVE_INTERRUPT EUSCI_B_IE_RXIE_OFS |
Referenced by SPI_getEnabledInterruptStatus().
#define EUSCI_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE EUSCI_B_CTLW0_STEM |
#define EUSCI_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS 0x00 |
#define EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT 0x00 |
Referenced by EUSCI_B_SPI_changeClockPhasePolarity(), EUSCI_B_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT EUSCI_B_CTLW0_CKPH |
Referenced by EUSCI_B_SPI_changeClockPhasePolarity(), EUSCI_B_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_B_SPI_MSB_FIRST EUSCI_B_CTLW0_MSB |
Referenced by EUSCI_B_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_B_SPI_LSB_FIRST 0x00 |
Referenced by EUSCI_B_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH EUSCI_B_CTLW0_CKPL |
Referenced by EUSCI_B_SPI_changeClockPhasePolarity(), EUSCI_B_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW 0x00 |
Referenced by EUSCI_B_SPI_changeClockPhasePolarity(), EUSCI_B_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_B_SPI_CLOCKSOURCE_ACLK EUSCI_B_CTLW0_SSEL__ACLK |
Referenced by SPI_initMaster().
#define EUSCI_B_SPI_CLOCKSOURCE_SMCLK EUSCI_B_CTLW0_SSEL__SMCLK |
Referenced by SPI_initMaster().
#define EUSCI_B_SPI_3PIN EUSCI_B_CTLW0_MODE_0 |
Referenced by EUSCI_B_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH EUSCI_B_CTLW0_MODE_1 |
Referenced by EUSCI_B_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW EUSCI_B_CTLW0_MODE_2 |
Referenced by EUSCI_B_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_B_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS 0x00 |
Referenced by EUSCI_B_SPI_select4PinFunctionality().
#define EUSCI_B_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE EUSCI_B_CTLW0_STEM |
Referenced by EUSCI_B_SPI_select4PinFunctionality().
#define EUSCI_B_SPI_TRANSMIT_INTERRUPT EUSCI_B_IE_TXIE0 |
#define EUSCI_B_SPI_RECEIVE_INTERRUPT EUSCI_B_IE_RXIE0 |
#define EUSCI_B_SPI_BUSY EUSCI_B_STATW_BBUSY |
#define EUSCI_B_SPI_NOT_BUSY 0x00 |
#define EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT 0x00 |
Referenced by EUSCI_A_SPI_changeClockPhasePolarity(), EUSCI_A_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT EUSCI_A_CTLW0_CKPH |
Referenced by EUSCI_A_SPI_changeClockPhasePolarity(), EUSCI_A_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_A_SPI_MSB_FIRST EUSCI_A_CTLW0_MSB |
Referenced by EUSCI_A_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_A_SPI_LSB_FIRST 0x00 |
Referenced by EUSCI_A_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH EUSCI_A_CTLW0_CKPL |
Referenced by EUSCI_A_SPI_changeClockPhasePolarity(), EUSCI_A_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW 0x00 |
Referenced by EUSCI_A_SPI_changeClockPhasePolarity(), EUSCI_A_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_A_SPI_CLOCKSOURCE_ACLK EUSCI_A_CTLW0_SSEL__ACLK |
Referenced by SPI_initMaster().
#define EUSCI_A_SPI_CLOCKSOURCE_SMCLK EUSCI_A_CTLW0_SSEL__SMCLK |
Referenced by SPI_initMaster().
#define EUSCI_A_SPI_3PIN EUSCI_A_CTLW0_MODE_0 |
Referenced by EUSCI_A_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_HIGH EUSCI_A_CTLW0_MODE_1 |
Referenced by EUSCI_A_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_LOW EUSCI_A_CTLW0_MODE_2 |
Referenced by EUSCI_A_SPI_slaveInit(), SPI_initMaster(), and SPI_initSlave().
#define EUSCI_A_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS 0x00 |
Referenced by EUSCI_A_SPI_select4PinFunctionality().
#define EUSCI_A_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE EUSCI_A_CTLW0_STEM |
Referenced by EUSCI_A_SPI_select4PinFunctionality().
#define EUSCI_A_SPI_TRANSMIT_INTERRUPT EUSCI_A_IE_TXIE |
#define EUSCI_A_SPI_RECEIVE_INTERRUPT EUSCI_A_IE_RXIE |
#define EUSCI_A_SPI_BUSY EUSCI_B_STATW_BBUSY |
#define EUSCI_A_SPI_NOT_BUSY 0x00 |
typedef struct _eUSCI_SPI_MasterConfig eUSCI_SPI_MasterConfig |
typedef struct _eUSCI_SPI_SlaveConfig eUSCI_SPI_SlaveConfig |
bool SPI_initMaster | ( | uint32_t | moduleInstance, |
const eUSCI_SPI_MasterConfig * | config | ||
) |
Initializes the SPI Master block.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
config | Configuration structure for SPI master mode |
Configuration options for eUSCI_SPI_MasterConfig structure.
selectClockSource | selects clock source. Valid values are
|
clockSourceFrequency | is the frequency of the selected clock source |
desiredSpiClock | is the desired clock rate for SPI communication |
msbFirst | controls the direction of the receive and transmit shift register. Valid values are
|
clockPhase | is clock phase select. Valid values are
|
clockPolarity | is clock polarity select. Valid values are
|
spiMode | is SPI mode select. Valid values are
|
Modified bits are UCCKPH, UCCKPL, UC7BIT, UCMSB,UCSSELx, UCSWRST bits of UCAxCTLW0 register
References ASSERT, _eUSCI_SPI_MasterConfig::clockPhase, _eUSCI_SPI_MasterConfig::clockPolarity, _eUSCI_SPI_MasterConfig::clockSourceFrequency, _eUSCI_SPI_MasterConfig::desiredSpiClock, EUSCI_A_CMSIS, EUSCI_A_SPI_3PIN, EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_HIGH, EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_LOW, EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_A_SPI_CLOCKSOURCE_ACLK, EUSCI_A_SPI_CLOCKSOURCE_SMCLK, EUSCI_A_SPI_LSB_FIRST, EUSCI_A_SPI_MSB_FIRST, EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT, EUSCI_B_CMSIS, EUSCI_B_SPI_3PIN, EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH, EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW, EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_B_SPI_CLOCKSOURCE_ACLK, EUSCI_B_SPI_CLOCKSOURCE_SMCLK, EUSCI_B_SPI_LSB_FIRST, EUSCI_B_SPI_MSB_FIRST, EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT, _eUSCI_SPI_MasterConfig::msbFirst, _eUSCI_SPI_MasterConfig::selectClockSource, and _eUSCI_SPI_MasterConfig::spiMode.
void SPI_selectFourPinFunctionality | ( | uint32_t | moduleInstance, |
uint_fast8_t | select4PinFunctionality | ||
) |
Selects 4Pin Functionality
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
select4PinFunctionality | selects Clock source. Valid values are
|
Modified bits are UCSTEM bit of UCAxCTLW0 register
References EUSCI_A_SPI_select4PinFunctionality(), and EUSCI_B_SPI_select4PinFunctionality().
void SPI_changeMasterClock | ( | uint32_t | moduleInstance, |
uint32_t | clockSourceFrequency, | ||
uint32_t | desiredSpiClock | ||
) |
Initializes the SPI Master clock.At the end of this function call, SPI module is left enabled.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
clockSourceFrequency | is the frequency of the selected clock source |
desiredSpiClock | is the desired clock rate for SPI communication. |
Modified bits are UCSWRST bit of UCAxCTLW0 register and UCAxBRW register
References EUSCI_A_SPI_masterChangeClock(), and EUSCI_B_SPI_masterChangeClock().
bool SPI_initSlave | ( | uint32_t | moduleInstance, |
const eUSCI_SPI_SlaveConfig * | config | ||
) |
Initializes the SPI Slave block.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
config | Configuration structure for SPI slave mode |
Configuration options for eUSCI_SPI_SlaveConfig structure.
msbFirst | controls the direction of the receive and transmit shift register. Valid values are
|
clockPhase | is clock phase select. Valid values are
|
clockPolarity | is clock polarity select. Valid values are
|
spiMode | is SPI mode select. Valid values are
|
Modified bits are UCMSB, UC7BIT, UCMST, UCCKPL, UCCKPH, UCMODE, UCSWRST bits of UCAxCTLW0
References ASSERT, _eUSCI_SPI_SlaveConfig::clockPhase, _eUSCI_SPI_SlaveConfig::clockPolarity, EUSCI_A_CMSIS, EUSCI_A_SPI_3PIN, EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_HIGH, EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_LOW, EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_A_SPI_LSB_FIRST, EUSCI_A_SPI_MSB_FIRST, EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT, EUSCI_B_CMSIS, EUSCI_B_SPI_3PIN, EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH, EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW, EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_B_SPI_LSB_FIRST, EUSCI_B_SPI_MSB_FIRST, EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT, _eUSCI_SPI_SlaveConfig::msbFirst, and _eUSCI_SPI_SlaveConfig::spiMode.
void SPI_changeClockPhasePolarity | ( | uint32_t | moduleInstance, |
uint_fast16_t | clockPhase, | ||
uint_fast16_t | clockPolarity | ||
) |
Changes the SPI clock phase and polarity.At the end of this function call, SPI module is left enabled.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
clockPhase | is clock phase select. Valid values are:
|
clockPolarity | is clock polarity select. Valid values are:
|
Modified bits are UCSWRST, UCCKPH, UCCKPL, UCSWRST bits of UCAxCTLW0
References EUSCI_A_SPI_changeClockPhasePolarity(), and EUSCI_B_SPI_changeClockPhasePolarity().
void SPI_transmitData | ( | uint32_t | moduleInstance, |
uint_fast8_t | transmitData | ||
) |
Transmits a byte from the SPI Module.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
transmitData | data to be transmitted from the SPI module |
This function will place the supplied data into SPI transmit data register to start transmission
Modified register is UCAxTXBUF
References EUSCI_A_SPI_transmitData(), and EUSCI_B_SPI_transmitData().
uint8_t SPI_receiveData | ( | uint32_t | moduleInstance | ) |
Receives a byte that has been sent to the SPI Module.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
This function reads a byte of data from the SPI receive data Register.
References EUSCI_A_SPI_receiveData(), and EUSCI_B_SPI_receiveData().
void SPI_enableModule | ( | uint32_t | moduleInstance | ) |
Enables the SPI block.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
This will enable operation of the SPI block. Modified bits are UCSWRST bit of UCAxCTLW0 register.
References EUSCI_A_SPI_enable(), and EUSCI_B_SPI_enable().
void SPI_disableModule | ( | uint32_t | moduleInstance | ) |
Disables the SPI block.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
This will disable operation of the SPI block.
Modified bits are UCSWRST bit of UCAxCTLW0 register.
References EUSCI_A_SPI_disable(), and EUSCI_B_SPI_disable().
uint32_t SPI_getReceiveBufferAddressForDMA | ( | uint32_t | moduleInstance | ) |
Returns the address of the RX Buffer of the SPI for the DMA module.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
Returns the address of the SPI RX Buffer. This can be used in conjunction with the DMA to store the received data directly to memory.
References EUSCI_A_SPI_getReceiveBufferAddressForDMA(), and EUSCI_B_SPI_getReceiveBufferAddressForDMA().
uint32_t SPI_getTransmitBufferAddressForDMA | ( | uint32_t | moduleInstance | ) |
Returns the address of the TX Buffer of the SPI for the DMA module.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
Returns the address of the SPI TX Buffer. This can be used in conjunction with the DMA to obtain transmitted data directly from memory.
References EUSCI_A_SPI_getTransmitBufferAddressForDMA(), and EUSCI_B_SPI_getTransmitBufferAddressForDMA().
uint_fast8_t SPI_isBusy | ( | uint32_t | moduleInstance | ) |
Indicates whether or not the SPI bus is busy.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
This function returns an indication of whether or not the SPI bus is busy.This function checks the status of the bus via UCBBUSY bit
References EUSCI_A_SPI_isBusy(), and EUSCI_B_SPI_isBusy().
void SPI_enableInterrupt | ( | uint32_t | moduleInstance, |
uint_fast8_t | mask | ||
) |
Enables individual SPI interrupt sources.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
mask | is the bit mask of the interrupt sources to be enabled. |
Enables the indicated SPI interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
The mask parameter is the logical OR of any of the following:
Modified registers are UCAxIFG and UCAxIE
References EUSCI_A_SPI_enableInterrupt(), and EUSCI_B_SPI_enableInterrupt().
void SPI_disableInterrupt | ( | uint32_t | moduleInstance, |
uint_fast8_t | mask | ||
) |
Disables individual SPI interrupt sources.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
mask | is the bit mask of the interrupt sources to be disabled. |
Disables the indicated SPI interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
The mask parameter is the logical OR of any of the following:
Modified register is UCAxIE
References EUSCI_A_SPI_disableInterrupt(), and EUSCI_B_SPI_disableInterrupt().
uint_fast8_t SPI_getInterruptStatus | ( | uint32_t | moduleInstance, |
uint16_t | mask | ||
) |
Gets the current SPI interrupt status.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
mask | Mask of interrupt to filter. This can include:
|
Modified registers are UCAxIFG.
References EUSCI_A_SPI_getInterruptStatus(), and EUSCI_B_SPI_getInterruptStatus().
Referenced by SPI_getEnabledInterruptStatus().
uint_fast8_t SPI_getEnabledInterruptStatus | ( | uint32_t | moduleInstance | ) |
Gets the current SPI interrupt status masked with the enabled interrupts. This function is useful to call in ISRs to get a list of pending interrupts that are actually enabled and could have caused the ISR.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
Modified registers are UCAxIFG.
References EUSCI_A_CMSIS, EUSCI_B_CMSIS, EUSCI_SPI_RECEIVE_INTERRUPT, EUSCI_SPI_TRANSMIT_INTERRUPT, and SPI_getInterruptStatus().
void SPI_clearInterruptFlag | ( | uint32_t | moduleInstance, |
uint_fast8_t | mask | ||
) |
Clears the selected SPI interrupt status flag.
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
mask | is the masked interrupt flag to be cleared. |
The mask parameter is the logical OR of any of the following:
References EUSCI_A_SPI_clearInterruptFlag(), and EUSCI_B_SPI_clearInterruptFlag().
void SPI_registerInterrupt | ( | uint32_t | moduleInstance, |
void(*)(void) | intHandler | ||
) |
Registers an interrupt handler for the timer capture compare interrupt.
moduleInstance | is the instance of the eUSCI (SPI) module. Valid parameters vary from part to part, but can include:
|
intHandler | is a pointer to the function to be called when the timer capture compare interrupt occurs. |
This function registers the handler to be called when a timer interrupt occurs. This function enables the global interrupt in the interrupt controller; specific SPI interrupts must be enabled via SPI_enableInterrupt(). It is the interrupt handler's responsibility to clear the interrupt source via SPI_clearInterruptFlag().
References ASSERT, INT_EUSCIA0, INT_EUSCIA1, INT_EUSCIA2, INT_EUSCIA3, INT_EUSCIB0, INT_EUSCIB1, INT_EUSCIB2, INT_EUSCIB3, Interrupt_enableInterrupt(), and Interrupt_registerInterrupt().
void SPI_unregisterInterrupt | ( | uint32_t | moduleInstance | ) |
Unregisters the interrupt handler for the timer
moduleInstance | is the instance of the eUSCI A/B module. Valid parameters vary from part to part, but can include:
|
This function unregisters the handler to be called when timer interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
References ASSERT, INT_EUSCIA0, INT_EUSCIA1, INT_EUSCIA2, INT_EUSCIA3, INT_EUSCIB0, INT_EUSCIB1, INT_EUSCIB2, INT_EUSCIB3, Interrupt_disableInterrupt(), and Interrupt_unregisterInterrupt().
void EUSCI_A_SPI_select4PinFunctionality | ( | uint32_t | baseAddress, |
uint8_t | select4PinFunctionality | ||
) |
Selects 4Pin Functionality.
This function should be invoked only in 4-wire mode. Invoking this function has no effect in 3-wire mode.
baseAddress | is the base address of the EUSCI_A_SPI module. |
select4PinFunctionality | selects 4 pin functionality Valid values are:
|
Modified bits are UCSTEM of UCAxCTLW0 register.
References ASSERT, EUSCI_A_CMSIS, EUSCI_A_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE, and EUSCI_A_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS.
Referenced by SPI_selectFourPinFunctionality().
void EUSCI_A_SPI_masterChangeClock | ( | uint32_t | baseAddress, |
uint32_t | clockSourceFrequency, | ||
uint32_t | desiredSpiClock | ||
) |
Initializes the SPI Master clock. At the end of this function call, SPI module is left enabled.
baseAddress | is the base address of the EUSCI_A_SPI module. |
clockSourceFrequency | is the frequency of the slected clock source |
desiredSpiClock | is the desired clock rate for SPI communication |
Modified bits are UCSWRST of UCAxCTLW0 register.
References EUSCI_A_CMSIS.
Referenced by SPI_changeMasterClock().
bool EUSCI_A_SPI_slaveInit | ( | uint32_t | baseAddress, |
uint16_t | msbFirst, | ||
uint16_t | clockPhase, | ||
uint16_t | clockPolarity, | ||
uint16_t | spiMode | ||
) |
Initializes the SPI Slave block.
Upon successful initialization of the SPI slave block, this function will have initailized the slave block, but the SPI Slave block still remains disabled and must be enabled with EUSCI_A_SPI_enable()
baseAddress | is the base address of the EUSCI_A_SPI Slave module. |
msbFirst | controls the direction of the receive and transmit shift register. Valid values are:
|
clockPhase | is clock phase select. Valid values are:
|
clockPolarity | is clock polarity select Valid values are:
|
spiMode | is SPI mode select Valid values are:
|
Modified bits are EUSCI_A_CTLW0_MSB, EUSCI_A_CTLW0_MST, EUSCI_A_CTLW0_SEVENBIT, EUSCI_A_CTLW0_CKPL, EUSCI_A_CTLW0_CKPH, UCMODE and UCSWRST of UCAxCTLW0 register.
References ASSERT, EUSCI_A_CMSIS, EUSCI_A_SPI_3PIN, EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_HIGH, EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_LOW, EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_A_SPI_LSB_FIRST, EUSCI_A_SPI_MSB_FIRST, EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, and EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT.
void EUSCI_A_SPI_changeClockPhasePolarity | ( | uint32_t | baseAddress, |
uint16_t | clockPhase, | ||
uint16_t | clockPolarity | ||
) |
Changes the SPI colock phase and polarity. At the end of this function call, SPI module is left enabled.
baseAddress | is the base address of the EUSCI_A_SPI module. |
clockPhase | is clock phase select. Valid values are:
|
clockPolarity | is clock polarity select Valid values are:
|
Modified bits are EUSCI_A_CTLW0_CKPL, EUSCI_A_CTLW0_CKPH and UCSWRST of UCAxCTLW0 register.
References ASSERT, EUSCI_A_CMSIS, EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, and EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT.
Referenced by SPI_changeClockPhasePolarity().
void EUSCI_A_SPI_transmitData | ( | uint32_t | baseAddress, |
uint8_t | transmitData | ||
) |
Transmits a byte from the SPI Module.
This function will place the supplied data into SPI trasmit data register to start transmission.
baseAddress | is the base address of the EUSCI_A_SPI module. |
transmitData | data to be transmitted from the SPI module |
References EUSCI_A_CMSIS.
Referenced by SPI_transmitData().
uint8_t EUSCI_A_SPI_receiveData | ( | uint32_t | baseAddress | ) |
Receives a byte that has been sent to the SPI Module.
This function reads a byte of data from the SPI receive data Register.
baseAddress | is the base address of the EUSCI_A_SPI module. |
References EUSCI_A_CMSIS.
Referenced by SPI_receiveData().
void EUSCI_A_SPI_enableInterrupt | ( | uint32_t | baseAddress, |
uint8_t | mask | ||
) |
Enables individual SPI interrupt sources.
Enables the indicated SPI interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. Does not clear interrupt flags.
baseAddress | is the base address of the EUSCI_A_SPI module. |
mask | is the bit mask of the interrupt sources to be enabled. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxIFG register and bits of UCAxIE register.
References ASSERT, EUSCI_A_CMSIS, EUSCI_A_SPI_RECEIVE_INTERRUPT, and EUSCI_A_SPI_TRANSMIT_INTERRUPT.
Referenced by SPI_enableInterrupt().
void EUSCI_A_SPI_disableInterrupt | ( | uint32_t | baseAddress, |
uint8_t | mask | ||
) |
Disables individual SPI interrupt sources.
Disables the indicated SPI interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
baseAddress | is the base address of the EUSCI_A_SPI module. |
mask | is the bit mask of the interrupt sources to be disabled. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxIE register.
References ASSERT, EUSCI_A_CMSIS, EUSCI_A_SPI_RECEIVE_INTERRUPT, and EUSCI_A_SPI_TRANSMIT_INTERRUPT.
Referenced by SPI_disableInterrupt().
uint8_t EUSCI_A_SPI_getInterruptStatus | ( | uint32_t | baseAddress, |
uint8_t | mask | ||
) |
Gets the current SPI interrupt status.
This returns the interrupt status for the SPI module based on which flag is passed.
baseAddress | is the base address of the EUSCI_A_SPI module. |
mask | is the masked interrupt flag status to be returned. Mask value is the logical OR of any of the following:
|
References ASSERT, EUSCI_A_CMSIS, EUSCI_A_SPI_RECEIVE_INTERRUPT, and EUSCI_A_SPI_TRANSMIT_INTERRUPT.
Referenced by SPI_getInterruptStatus().
void EUSCI_A_SPI_clearInterruptFlag | ( | uint32_t | baseAddress, |
uint8_t | mask | ||
) |
Clears the selected SPI interrupt status flag.
baseAddress | is the base address of the EUSCI_A_SPI module. |
mask | is the masked interrupt flag to be cleared. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxIFG register.
References ASSERT, EUSCI_A_CMSIS, EUSCI_A_SPI_RECEIVE_INTERRUPT, and EUSCI_A_SPI_TRANSMIT_INTERRUPT.
Referenced by SPI_clearInterruptFlag().
void EUSCI_A_SPI_enable | ( | uint32_t | baseAddress | ) |
Enables the SPI block.
This will enable operation of the SPI block.
baseAddress | is the base address of the EUSCI_A_SPI module. |
Modified bits are UCSWRST of UCAxCTLW0 register.
References EUSCI_A_CMSIS.
Referenced by SPI_enableModule().
void EUSCI_A_SPI_disable | ( | uint32_t | baseAddress | ) |
Disables the SPI block.
This will disable operation of the SPI block.
baseAddress | is the base address of the EUSCI_A_SPI module. |
Modified bits are UCSWRST of UCAxCTLW0 register.
References EUSCI_A_CMSIS.
Referenced by SPI_disableModule().
uint32_t EUSCI_A_SPI_getReceiveBufferAddressForDMA | ( | uint32_t | baseAddress | ) |
Returns the address of the RX Buffer of the SPI for the DMA module.
Returns the address of the SPI RX Buffer. This can be used in conjunction with the DMA to store the received data directly to memory.
baseAddress | is the base address of the EUSCI_A_SPI module. |
References EUSCI_A_CMSIS.
Referenced by SPI_getReceiveBufferAddressForDMA().
uint32_t EUSCI_A_SPI_getTransmitBufferAddressForDMA | ( | uint32_t | baseAddress | ) |
Returns the address of the TX Buffer of the SPI for the DMA module.
Returns the address of the SPI TX Buffer. This can be used in conjunction with the DMA to obtain transmitted data directly from memory.
baseAddress | is the base address of the EUSCI_A_SPI module. |
References EUSCI_A_CMSIS.
Referenced by SPI_getTransmitBufferAddressForDMA().
bool EUSCI_A_SPI_isBusy | ( | uint32_t | baseAddress | ) |
Indicates whether or not the SPI bus is busy.
This function returns an indication of whether or not the SPI bus is busy.This function checks the status of the bus via UCBBUSY bit
baseAddress | is the base address of the EUSCI_A_SPI module. |
References EUSCI_A_CMSIS.
Referenced by SPI_isBusy().
void EUSCI_B_SPI_select4PinFunctionality | ( | uint32_t | baseAddress, |
uint8_t | select4PinFunctionality | ||
) |
Selects 4Pin Functionality.
This function should be invoked only in 4-wire mode. Invoking this function has no effect in 3-wire mode.
baseAddress | is the base address of the EUSCI_B_SPI module. |
select4PinFunctionality | selects 4 pin functionality Valid values are:
|
Modified bits are UCSTEM of UCAxCTLW0 register.
References ASSERT, EUSCI_B_CMSIS, EUSCI_B_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE, and EUSCI_B_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS.
Referenced by SPI_selectFourPinFunctionality().
void EUSCI_B_SPI_masterChangeClock | ( | uint32_t | baseAddress, |
uint32_t | clockSourceFrequency, | ||
uint32_t | desiredSpiClock | ||
) |
Initializes the SPI Master clock. At the end of this function call, SPI module is left enabled.
baseAddress | is the base address of the EUSCI_B_SPI module. |
clockSourceFrequency | is the frequency of the slected clock source |
desiredSpiClock | is the desired clock rate for SPI communication |
Modified bits are UCSWRST of UCAxCTLW0 register.
References EUSCI_B_CMSIS.
Referenced by SPI_changeMasterClock().
bool EUSCI_B_SPI_slaveInit | ( | uint32_t | baseAddress, |
uint16_t | msbFirst, | ||
uint16_t | clockPhase, | ||
uint16_t | clockPolarity, | ||
uint16_t | spiMode | ||
) |
Initializes the SPI Slave block.
Upon successful initialization of the SPI slave block, this function will have initailized the slave block, but the SPI Slave block still remains disabled and must be enabled with EUSCI_B_SPI_enable()
baseAddress | is the base address of the EUSCI_B_SPI Slave module. |
msbFirst | controls the direction of the receive and transmit shift register. Valid values are:
|
clockPhase | is clock phase select. Valid values are:
|
clockPolarity | is clock polarity select Valid values are:
|
spiMode | is SPI mode select Valid values are:
|
Modified bits are EUSCI_A_CTLW0_MSB, EUSCI_A_CTLW0_MST, EUSCI_A_CTLW0_SEVENBIT, EUSCI_A_CTLW0_CKPL, EUSCI_A_CTLW0_CKPH, UCMODE and UCSWRST of UCAxCTLW0 register.
References ASSERT, EUSCI_B_CMSIS, EUSCI_B_SPI_3PIN, EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH, EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW, EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_B_SPI_LSB_FIRST, EUSCI_B_SPI_MSB_FIRST, EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, and EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT.
void EUSCI_B_SPI_changeClockPhasePolarity | ( | uint32_t | baseAddress, |
uint16_t | clockPhase, | ||
uint16_t | clockPolarity | ||
) |
Changes the SPI colock phase and polarity. At the end of this function call, SPI module is left enabled.
baseAddress | is the base address of the EUSCI_B_SPI module. |
clockPhase | is clock phase select. Valid values are:
|
clockPolarity | is clock polarity select Valid values are:
|
Modified bits are EUSCI_A_CTLW0_CKPL, EUSCI_A_CTLW0_CKPH and UCSWRST of UCAxCTLW0 register.
References ASSERT, EUSCI_B_CMSIS, EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, and EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT.
Referenced by SPI_changeClockPhasePolarity().
void EUSCI_B_SPI_transmitData | ( | uint32_t | baseAddress, |
uint8_t | transmitData | ||
) |
Transmits a byte from the SPI Module.
This function will place the supplied data into SPI trasmit data register to start transmission.
baseAddress | is the base address of the EUSCI_B_SPI module. |
transmitData | data to be transmitted from the SPI module |
References EUSCI_B_CMSIS.
Referenced by SPI_transmitData().
uint8_t EUSCI_B_SPI_receiveData | ( | uint32_t | baseAddress | ) |
Receives a byte that has been sent to the SPI Module.
This function reads a byte of data from the SPI receive data Register.
baseAddress | is the base address of the EUSCI_B_SPI module. |
References EUSCI_B_CMSIS.
Referenced by SPI_receiveData().
void EUSCI_B_SPI_enableInterrupt | ( | uint32_t | baseAddress, |
uint8_t | mask | ||
) |
Enables individual SPI interrupt sources.
Enables the indicated SPI interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. Does not clear interrupt flags.
baseAddress | is the base address of the EUSCI_B_SPI module. |
mask | is the bit mask of the interrupt sources to be enabled. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxIFG register and bits of UCAxIE register.
References ASSERT, EUSCI_B_CMSIS, EUSCI_B_SPI_RECEIVE_INTERRUPT, and EUSCI_B_SPI_TRANSMIT_INTERRUPT.
Referenced by SPI_enableInterrupt().
void EUSCI_B_SPI_disableInterrupt | ( | uint32_t | baseAddress, |
uint8_t | mask | ||
) |
Disables individual SPI interrupt sources.
Disables the indicated SPI interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
baseAddress | is the base address of the EUSCI_B_SPI module. |
mask | is the bit mask of the interrupt sources to be disabled. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxIE register.
References ASSERT, EUSCI_B_CMSIS, EUSCI_B_SPI_RECEIVE_INTERRUPT, and EUSCI_B_SPI_TRANSMIT_INTERRUPT.
Referenced by SPI_disableInterrupt().
uint8_t EUSCI_B_SPI_getInterruptStatus | ( | uint32_t | baseAddress, |
uint8_t | mask | ||
) |
Gets the current SPI interrupt status.
This returns the interrupt status for the SPI module based on which flag is passed.
baseAddress | is the base address of the EUSCI_B_SPI module. |
mask | is the masked interrupt flag status to be returned. Mask value is the logical OR of any of the following:
|
References ASSERT, EUSCI_B_CMSIS, EUSCI_B_SPI_RECEIVE_INTERRUPT, and EUSCI_B_SPI_TRANSMIT_INTERRUPT.
Referenced by SPI_getInterruptStatus().
void EUSCI_B_SPI_clearInterruptFlag | ( | uint32_t | baseAddress, |
uint8_t | mask | ||
) |
Clears the selected SPI interrupt status flag.
baseAddress | is the base address of the EUSCI_B_SPI module. |
mask | is the masked interrupt flag to be cleared. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxIFG register.
References ASSERT, EUSCI_B_CMSIS, EUSCI_B_SPI_RECEIVE_INTERRUPT, and EUSCI_B_SPI_TRANSMIT_INTERRUPT.
Referenced by SPI_clearInterruptFlag().
void EUSCI_B_SPI_enable | ( | uint32_t | baseAddress | ) |
Enables the SPI block.
This will enable operation of the SPI block.
baseAddress | is the base address of the EUSCI_B_SPI module. |
Modified bits are UCSWRST of UCBxCTLW0 register.
References EUSCI_B_CMSIS.
Referenced by SPI_enableModule().
void EUSCI_B_SPI_disable | ( | uint32_t | baseAddress | ) |
Disables the SPI block.
This will disable operation of the SPI block.
baseAddress | is the base address of the EUSCI_B_SPI module. |
Modified bits are UCSWRST of UCBxCTLW0 register.
References EUSCI_B_CMSIS.
Referenced by SPI_disableModule().
uint32_t EUSCI_B_SPI_getReceiveBufferAddressForDMA | ( | uint32_t | baseAddress | ) |
Returns the address of the RX Buffer of the SPI for the DMA module.
Returns the address of the SPI RX Buffer. This can be used in conjunction with the DMA to store the received data directly to memory.
baseAddress | is the base address of the EUSCI_B_SPI module. |
References EUSCI_B_CMSIS.
Referenced by SPI_getReceiveBufferAddressForDMA().
uint32_t EUSCI_B_SPI_getTransmitBufferAddressForDMA | ( | uint32_t | baseAddress | ) |
Returns the address of the TX Buffer of the SPI for the DMA module.
Returns the address of the SPI TX Buffer. This can be used in conjunction with the DMA to obtain transmitted data directly from memory.
baseAddress | is the base address of the EUSCI_B_SPI module. |
References EUSCI_B_CMSIS.
Referenced by SPI_getTransmitBufferAddressForDMA().
bool EUSCI_B_SPI_isBusy | ( | uint32_t | baseAddress | ) |
Indicates whether or not the SPI bus is busy.
This function returns an indication of whether or not the SPI bus is busy.This function checks the status of the bus via UCBBUSY bit
baseAddress | is the base address of the EUSCI_B_SPI module. |
References EUSCI_B_CMSIS.
Referenced by SPI_isBusy().