Functions | |
bool | USCI_A_SPI_initMaster (uint16_t baseAddress, USCI_A_SPI_initMasterParam *param) |
Initializes the SPI Master block. More... | |
void | USCI_A_SPI_changeMasterClock (uint16_t baseAddress, USCI_A_SPI_changeMasterClockParam *param) |
Initializes the SPI Master clock.At the end of this function call, SPI module is left enabled. More... | |
bool | USCI_A_SPI_initSlave (uint16_t baseAddress, uint8_t msbFirst, uint8_t clockPhase, uint8_t clockPolarity) |
Initializes the SPI Slave block. More... | |
void | USCI_A_SPI_changeClockPhasePolarity (uint16_t baseAddress, uint8_t clockPhase, uint8_t clockPolarity) |
Changes the SPI clock phase and polarity.At the end of this function call, SPI module is left enabled. More... | |
void | USCI_A_SPI_transmitData (uint16_t baseAddress, uint8_t transmitData) |
Transmits a byte from the SPI Module. More... | |
uint8_t | USCI_A_SPI_receiveData (uint16_t baseAddress) |
Receives a byte that has been sent to the SPI Module. More... | |
void | USCI_A_SPI_enableInterrupt (uint16_t baseAddress, uint8_t mask) |
Enables individual SPI interrupt sources. More... | |
void | USCI_A_SPI_disableInterrupt (uint16_t baseAddress, uint8_t mask) |
Disables individual SPI interrupt sources. More... | |
uint8_t | USCI_A_SPI_getInterruptStatus (uint16_t baseAddress, uint8_t mask) |
Gets the current SPI interrupt status. More... | |
void | USCI_A_SPI_clearInterrupt (uint16_t baseAddress, uint8_t mask) |
Clears the selected SPI interrupt status flag. More... | |
void | USCI_A_SPI_enable (uint16_t baseAddress) |
Enables the SPI block. More... | |
void | USCI_A_SPI_disable (uint16_t baseAddress) |
Disables the SPI block. More... | |
uint32_t | USCI_A_SPI_getReceiveBufferAddressForDMA (uint16_t baseAddress) |
Returns the address of the RX Buffer of the SPI for the DMA module. More... | |
uint32_t | USCI_A_SPI_getTransmitBufferAddressForDMA (uint16_t baseAddress) |
Returns the address of the TX Buffer of the SPI for the DMA module. More... | |
uint8_t | USCI_A_SPI_isBusy (uint16_t baseAddress) |
Indicates whether or not the SPI bus is busy. More... | |
void USCI_A_SPI_changeClockPhasePolarity | ( | uint16_t | baseAddress, |
uint8_t | clockPhase, | ||
uint8_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 I2C Master module. |
clockPhase | is clock phase select. Valid values are:
|
clockPolarity | Valid values are:
|
Modified bits are UCCKPL and UCCKPH of UCAxCTL0 register.
void USCI_A_SPI_changeMasterClock | ( | uint16_t | baseAddress, |
USCI_A_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 I2C Master module. |
param | is the pointer to struct for master clock setting. |
Modified bits of UCAxBRW register.
References USCI_A_SPI_changeMasterClockParam::clockSourceFrequency, and USCI_A_SPI_changeMasterClockParam::desiredSpiClock.
void USCI_A_SPI_clearInterrupt | ( | uint16_t | baseAddress, |
uint8_t | mask | ||
) |
Clears the selected SPI interrupt status flag.
baseAddress | is the base address of the 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 USCI_A_SPI_disable | ( | uint16_t | baseAddress | ) |
Disables the SPI block.
This will disable operation of the SPI block.
baseAddress | is the base address of the USCI SPI module. |
Modified bits are UCSWRST of UCAxCTL1 register.
void USCI_A_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 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 USCI_A_SPI_enable | ( | uint16_t | baseAddress | ) |
Enables the SPI block.
This will enable operation of the SPI block.
baseAddress | is the base address of the USCI SPI module. |
Modified bits are UCSWRST of UCAxCTL1 register.
void USCI_A_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 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 UCAxIE register.
uint8_t USCI_A_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 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 USCI_A_SPI_getReceiveBufferAddressForDMA | ( | 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 SPI module. |
uint32_t USCI_A_SPI_getTransmitBufferAddressForDMA | ( | 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 SPI module. |
bool USCI_A_SPI_initMaster | ( | uint16_t | baseAddress, |
USCI_A_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 USCI_A_SPI_enable()
baseAddress | is the base address of the I2C Master module. |
param | is the pointer to struct for master initialization. |
Modified bits are UCCKPH, UCCKPL, UC7BIT and UCMSB of UCAxCTL0 register; bits UCSSELx and UCSWRST of UCAxCTL1 register.
References USCI_A_SPI_initMasterParam::clockPhase, USCI_A_SPI_initMasterParam::clockPolarity, USCI_A_SPI_initMasterParam::clockSourceFrequency, USCI_A_SPI_initMasterParam::desiredSpiClock, USCI_A_SPI_initMasterParam::msbFirst, and USCI_A_SPI_initMasterParam::selectClockSource.
bool USCI_A_SPI_initSlave | ( | uint16_t | baseAddress, |
uint8_t | msbFirst, | ||
uint8_t | clockPhase, | ||
uint8_t | clockPolarity | ||
) |
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 USCI_A_SPI_enable()
baseAddress | is the base address of the 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 | Valid values are:
|
Modified bits are UCMSB, UCMST, UC7BIT, UCCKPL, UCCKPH and UCMODE of UCAxCTL0 register; bits UCSWRST of UCAxCTL1 register.
uint8_t USCI_A_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 SPI module. |
uint8_t USCI_A_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 SPI module. |
void USCI_A_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 SPI module. |
transmitData | data to be transmitted from the SPI module |