SLAAEN5 February 2025 MSPM0G1106 , MSPM0G1107 , MSPM0G1506 , MSPM0G1507 , MSPM0G1518 , MSPM0G1519 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1 , MSPM0G3518 , MSPM0G3518-Q1 , MSPM0G3519 , MSPM0G3519-Q1
Custom_FIFO is the structure defined in user_define.h. The definition is also shown in Figure 2-6.
typedef struct {
uint16_t fifo_in;
uint16_t fifo_out;
uint16_t fifo_count;
Custom_Element *fifo_pointer;
} Custom_FIFO;
gCan2Spi_FIFO and gSpi2Can_FIFO are defined in main.c. Note the usage of SRAM, which is related to C2S_FIFO_SIZE, S2C_FIFO_SIZE and the size for Custom_Element.
/* Variables for C2S_FIFO
* C2S_FIFO is used to temporarily store message from CAN to SPI */
Custom_Element gC2S_FIFO[C2S_FIFO_SIZE];
Custom_FIFO gCan2Spi_FIFO = {0, 0, 0, gC2S_FIFO};
/* Variables for S2C_FIFO
* S2C_FIFO is used to temporarily store message from SPI to CAN */
Custom_Element gS2C_FIFO[S2C_FIFO_SIZE];
Custom_FIFO gSpi2Can_FIFO = {0, 0, 0, gS2C_FIFO};