Functions | |
void | EUSCI_B_SPI_initMaster (uint16_t baseAddress, EUSCI_B_SPI_initMasterParam *param) |
Initializes the SPI Master block. More... | |
void | EUSCI_B_SPI_select4PinFunctionality (uint16_t baseAddress, uint8_t select4PinFunctionality) |
Selects 4Pin Functionality. More... | |
void | EUSCI_B_SPI_changeMasterClock (uint16_t baseAddress, EUSCI_B_SPI_changeMasterClockParam *param) |
Initializes the SPI Master clock. At the end of this function call, SPI module is left enabled. More... | |
void | EUSCI_B_SPI_initSlave (uint16_t baseAddress, EUSCI_B_SPI_initSlaveParam *param) |
Initializes the SPI Slave block. More... | |
void | EUSCI_B_SPI_changeClockPhasePolarity (uint16_t baseAddress, uint16_t clockPhase, uint16_t clockPolarity) |
Changes the SPI clock phase and polarity. At the end of this function call, SPI module is left enabled. More... | |
void | EUSCI_B_SPI_transmitData (uint16_t baseAddress, uint8_t transmitData) |
Transmits a byte from the SPI Module. More... | |
uint8_t | EUSCI_B_SPI_receiveData (uint16_t baseAddress) |
Receives a byte that has been sent to the SPI Module. More... | |
void | EUSCI_B_SPI_enableInterrupt (uint16_t baseAddress, uint8_t mask) |
Enables individual SPI interrupt sources. More... | |
void | EUSCI_B_SPI_disableInterrupt (uint16_t baseAddress, uint8_t mask) |
Disables individual SPI interrupt sources. More... | |
uint8_t | EUSCI_B_SPI_getInterruptStatus (uint16_t baseAddress, uint8_t mask) |
Gets the current SPI interrupt status. More... | |
void | EUSCI_B_SPI_clearInterrupt (uint16_t baseAddress, uint8_t mask) |
Clears the selected SPI interrupt status flag. More... | |
void | EUSCI_B_SPI_enable (uint16_t baseAddress) |
Enables the SPI block. More... | |
void | EUSCI_B_SPI_disable (uint16_t baseAddress) |
Disables the SPI block. More... | |
uint32_t | EUSCI_B_SPI_getReceiveBufferAddress (uint16_t baseAddress) |
Returns the address of the RX Buffer of the SPI for the DMA module. More... | |
uint32_t | EUSCI_B_SPI_getTransmitBufferAddress (uint16_t baseAddress) |
Returns the address of the TX Buffer of the SPI for the DMA module. More... | |
uint16_t | EUSCI_B_SPI_isBusy (uint16_t baseAddress) |
Indicates whether or not the SPI bus is busy. More... | |
void EUSCI_B_SPI_changeClockPhasePolarity | ( | uint16_t | baseAddress, |
uint16_t | clockPhase, | ||
uint16_t | clockPolarity | ||
) |
Changes the SPI clock 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 UCCKPL, UCCKPH and UCSWRST of UCAxCTLW0 register.
void EUSCI_B_SPI_changeMasterClock | ( | uint16_t | baseAddress, |
EUSCI_B_SPI_changeMasterClockParam * | param | ||
) |
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. |
param | is the pointer to struct for master clock setting. |
Modified bits are UCSWRST of UCAxCTLW0 register.
References EUSCI_B_SPI_changeMasterClockParam::clockSourceFrequency, and EUSCI_B_SPI_changeMasterClockParam::desiredSpiClock.
void EUSCI_B_SPI_clearInterrupt | ( | uint16_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.
void EUSCI_B_SPI_disable | ( | uint16_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 UCAxCTLW0 register.
void EUSCI_B_SPI_disableInterrupt | ( | uint16_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.
void EUSCI_B_SPI_enable | ( | uint16_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 UCAxCTLW0 register.
void EUSCI_B_SPI_enableInterrupt | ( | uint16_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.
uint8_t EUSCI_B_SPI_getInterruptStatus | ( | uint16_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:
|
uint32_t EUSCI_B_SPI_getReceiveBufferAddress | ( | uint16_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. |
uint32_t EUSCI_B_SPI_getTransmitBufferAddress | ( | uint16_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. |
void EUSCI_B_SPI_initMaster | ( | uint16_t | baseAddress, |
EUSCI_B_SPI_initMasterParam * | param | ||
) |
Initializes the SPI Master block.
Upon successful initialization of the SPI master block, this function will have set the bus speed for the master, but the SPI Master block still remains disabled and must be enabled with EUSCI_B_SPI_enable()
baseAddress | is the base address of the EUSCI_B_SPI Master module. |
param | is the pointer to struct for master initialization. |
Modified bits are UCCKPH, UCCKPL, UC7BIT, UCMSB, UCSSELx and UCSWRST of UCAxCTLW0 register.
References EUSCI_B_SPI_initMasterParam::clockPhase, EUSCI_B_SPI_initMasterParam::clockPolarity, EUSCI_B_SPI_initMasterParam::clockSourceFrequency, EUSCI_B_SPI_initMasterParam::desiredSpiClock, EUSCI_B_SPI_initMasterParam::msbFirst, EUSCI_B_SPI_initMasterParam::selectClockSource, and EUSCI_B_SPI_initMasterParam::spiMode.
void EUSCI_B_SPI_initSlave | ( | uint16_t | baseAddress, |
EUSCI_B_SPI_initSlaveParam * | param | ||
) |
Initializes the SPI Slave block.
Upon successful initialization of the SPI slave block, this function will have initialized 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. |
param | is the pointer to struct for slave initialization. |
Modified bits are UCMSB, UCMST, UC7BIT, UCCKPL, UCCKPH, UCMODE and UCSWRST of UCAxCTLW0 register.
References EUSCI_B_SPI_initSlaveParam::clockPhase, EUSCI_B_SPI_initSlaveParam::clockPolarity, EUSCI_B_SPI_initSlaveParam::msbFirst, and EUSCI_B_SPI_initSlaveParam::spiMode.
uint16_t EUSCI_B_SPI_isBusy | ( | uint16_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. |
uint8_t EUSCI_B_SPI_receiveData | ( | uint16_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. |
void EUSCI_B_SPI_select4PinFunctionality | ( | uint16_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.
void EUSCI_B_SPI_transmitData | ( | uint16_t | baseAddress, |
uint8_t | transmitData | ||
) |
Transmits a byte from the SPI Module.
This function will place the supplied data into SPI transmit 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 |