|
foxBMS-UnitTests
1.0.0
The foxBMS Unit Tests API Documentation
|
Go to the documentation of this file.
65 #define SPI_FLAG_REGISTER_TRANSMISSION_ERRORS (0x5Fu)
79 uint16_t spi_cmdDummy[1] = {0x00};
85 spiTransmitData(pSpiInterface->
pNode, ((spiDAT1_t *)pSpiInterface->
pConfig), 1u, spi_cmdDummy);
107 spiTransmitData(pSpiInterface->
pNode, ((spiDAT1_t *)pSpiInterface->
pConfig), frameLength, pTxBuff);
125 uint32_t frameLength) {
142 uint32 frameLength) {
166 uint32 frameLength) {
169 uint32_t spiRetval = spiTransmitAndReceiveData(
170 pSpiInterface->
pNode, ((spiDAT1_t *)pSpiInterface->
pConfig), frameLength, pTxBuff, pRxBuff);
183 uint32_t frameLength) {
205 (frameLength << 16U) | 1U;
212 (frameLength << 16U) | 1U;
214 uint8_t spiFmtRegister = 0U;
215 switch (pSpiInterface->
pConfig->DFSEL) {
251 switch (spiFmtRegister) {
255 pSpiInterface->
pNode->FMT0 = pSpiInterface->
pNode->FMT1;
258 pSpiInterface->
pNode->FMT0 = pSpiInterface->
pNode->FMT2;
261 pSpiInterface->
pNode->FMT0 = pSpiInterface->
pNode->FMT3;
292 uint32_t frameLength) {
294 uint16_t spi_cmdDummy[1] = {0x00};
312 (frameLength << 16U) | 1U;
319 (frameLength << 16U) | 1U;
321 uint8_t spiFmtRegister = 0U;
322 switch (pSpiInterface->
pConfig->DFSEL) {
358 switch (spiFmtRegister) {
362 pSpiInterface->
pNode->FMT0 = pSpiInterface->
pNode->FMT1;
365 pSpiInterface->
pNode->FMT0 = pSpiInterface->
pNode->FMT2;
368 pSpiInterface->
pNode->FMT0 = pSpiInterface->
pNode->FMT3;
381 spiTransmitData(pSpiInterface->
pNode, ((spiDAT1_t *)pSpiInterface->
pConfig), 1u, spi_cmdDummy);
Implementation of the tasks used by the system, headers.
STD_RETURN_TYPE_e SPI_TransmitDataWithDummy(SPI_INTERFACE_CONFIG_s *pSpiInterface, uint32_t delay, uint16_t *pTxBuff, uint32_t frameLength)
Sends data on SPI without DMA, with wake-up byte.
volatile uint32_t * pGioPort
SPI_INTERFACE_CONFIG_s spi_dmaTransmission[]
Variable used for SPI over DMA transmission. Retains the CS pin to deactivate in DMA callback.
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
Headers for the driver for the SPI module.
long FSYS_RaisePrivilege(void)
raise privilege
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
STD_RETURN_TYPE_e SPI_Lock(uint8_t spi)
Locks SPI interfaces.
void OS_ExitTaskCritical(void)
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
STD_RETURN_TYPE_e SPI_TransmitReceiveData(SPI_INTERFACE_CONFIG_s *pSpiInterface, uint16 *pTxBuff, uint16 *pRxBuff, uint32 frameLength)
Transmits and receives data on SPI without DMA.
void MCU_delay_us(uint32_t delay_us)
Wait blocking a certain time in microseconds.
Headers for the driver for the MCU module.
SPI_BUSY_STATE_e spi_busyFlags[]
STD_RETURN_TYPE_e SPI_DirectlyTransmitReceiveData(SPI_INTERFACE_CONFIG_s *pSpiInterface, uint16 *pTxBuff, uint16 *pRxBuff, uint32 frameLength)
Transmits and receives data on SPI without DMA.
STD_RETURN_TYPE_e SPI_TransmitReceiveDataWithDummyDma(SPI_INTERFACE_CONFIG_s *pSpiInterface, uint32_t delay, uint16_t *pTxBuff, uint16_t *pRxBuff, uint32_t frameLength)
Transmits and receives data on SPI with DMA.
void OS_EnterTaskCritical(void)
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
Function to switch between user mode and privilege mode.
void IO_PinReset(uint32_t *pRegisterAddress, uint32_t pin)
Set pin by writing in pin output register.
const spiDAT1_t * pConfig
#define NULL_PTR
Null pointer.
#define SPI_FLAG_REGISTER_TRANSMISSION_ERRORS
STD_RETURN_TYPE_e SPI_TransmitData(SPI_INTERFACE_CONFIG_s *pSpiInterface, uint16_t *pTxBuff, uint32_t frameLength)
Sends data on SPI without DMA.
Header for the driver for the IO module.
void IO_PinSet(uint32_t *pRegisterAddress, uint32_t pin)
Set pin by writing in pin output register.
STD_RETURN_TYPE_e SPI_TransmitDummyByte(SPI_INTERFACE_CONFIG_s *pSpiInterface, uint32_t delay)
Sends a dummy byte to wake up the SPI interface.
void SPI_Unlock(uint8_t spi)
Unlocks SPI interfaces.
STD_RETURN_TYPE_e SPI_TransmitReceiveDataDma(SPI_INTERFACE_CONFIG_s *pSpiInterface, uint16_t *pTxBuff, uint16_t *pRxBuff, uint32_t frameLength)
Transmits and receives data on SPI with DMA.
#define FSYS_SwitchToUserMode()
Switch back to user mode.
Headers for the driver for the DMA module.
const uint8_t spi_nrBusyFlags
DMA_CHANNEL_CONFIG_s dma_spiDmaChannels[DMA_NUMBER_SPI_INTERFACES]