![]() |
The foxBMS secondary mcu API documentation
|
Driver for the serial peripheral interface module (encapsulation of some HAL functions) More...
Functions | |
void | SPI_Wait (void) |
STD_RETURN_TYPE_e | SPI_SendDummyByte (uint8_t busID, SPI_HandleType_s *hspi) |
void | SPI_Init (SPI_HandleType_s *hspi) |
initializes the SPI module. More... | |
void | HAL_SPI_TxRxCpltCallback (SPI_HandleType_s *hspi) |
callback SPI transmit and receive complete from SPI-Interrupt More... | |
void | HAL_SPI_TxCpltCallback (SPI_HandleType_s *hspi) |
callback SPI transmit complete from SPI-Interrupt More... | |
void | SPI_SetCS (uint8_t busID) |
sets Chip Select low to start SPI transmission. More... | |
void | SPI_UnsetCS (uint8_t busID) |
sets Chip Select high to end SPI transmission. More... | |
STD_RETURN_TYPE_e | SPI_Transmit (SPI_HandleType_s *hspi, uint8_t *pData, uint16_t Size) |
transmits through SPI without receiving data. More... | |
STD_RETURN_TYPE_e | SPI_TransmitReceive (SPI_HandleType_s *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) |
transmits and receives data through SPI. More... | |
STD_RETURN_TYPE_e | SPI_IsTransmitOngoing (void) |
gets the SPI transmit status. More... | |
void | SPI_SetTransmitOngoing (void) |
sets the SPI transmit status. More... | |
Variables | |
static SPI_STATE_s | spi_state |
const uint8_t | spi_cmdDummy [1] ={0x00} |
Driver for the serial peripheral interface module (encapsulation of some HAL functions)
BSD 3-Clause License Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
″This product uses parts of foxBMS®″
″This product includes parts of foxBMS®″
″This product is derived from foxBMS®″
void HAL_SPI_TxCpltCallback | ( | SPI_HandleType_s * | hspi | ) |
callback SPI transmit complete from SPI-Interrupt
hspi | pointer to SPI hardware handle |
void HAL_SPI_TxRxCpltCallback | ( | SPI_HandleType_s * | hspi | ) |
callback SPI transmit and receive complete from SPI-Interrupt
hspi | pointer to SPI hardware handle |
void SPI_Init | ( | SPI_HandleType_s * | hspi | ) |
initializes the SPI module.
This function initializes the SPI channels according to the configuration given as parameter.
*hspi | pointer to the spi configuration |
STD_RETURN_TYPE_e SPI_IsTransmitOngoing | ( | void | ) |
gets the SPI transmit status.
STD_RETURN_TYPE_e SPI_SendDummyByte | ( | uint8_t | busID, |
SPI_HandleType_s * | hspi | ||
) |
sends a dummy byte on SPI.
busID | selects which CS pin has to be set high |
*hspi | pointer to SPI hardware handle |
void SPI_SetCS | ( | uint8_t | busID | ) |
sets Chip Select low to start SPI transmission.
This function sets CS low in case CS is driven by software.
busID | selects which CS pin has to be set low |
void SPI_SetTransmitOngoing | ( | void | ) |
sets the SPI transmit status.
STD_RETURN_TYPE_e SPI_Transmit | ( | SPI_HandleType_s * | hspi, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
transmits through SPI without receiving data.
*hspi | pointer to SPI hardware handle |
*pData | data to be sent |
Size | size of the data to be sent |
STD_RETURN_TYPE_e SPI_TransmitReceive | ( | SPI_HandleType_s * | hspi, |
uint8_t * | pTxData, | ||
uint8_t * | pRxData, | ||
uint16_t | Size | ||
) |
transmits and receives data through SPI.
*hspi | pointer to SPI hardware handle |
*pTxData | data to be sent |
*pRxData | data to be received |
Size | size of the data to be sent/received |
void SPI_UnsetCS | ( | uint8_t | busID | ) |
sets Chip Select high to end SPI transmission.
This function sets CS high in case CS is driven by software. It is typically called in the callback routine of SPI transmission.
busID | selects which CS pin has to be set high |
void SPI_Wait | ( | void | ) |
waits a defined time.
const uint8_t spi_cmdDummy[1] ={0x00} |
|
static |