 |
iSensor-SPI-Buffer
1.15
Firmware for the iSensor-SPI-Buffer board to enable full throughput buffered data capture on Analog Devices IMUs
|
Go to the documentation of this file.
16 #include "stm32f3xx_hal.h"
32 #define STATE_CHECK_FLAGS 0
35 #define STATE_CHECK_PPS 1
38 #define STATE_READ_ADC 2
41 #define STATE_CHECK_USB 3
44 #define STATE_CHECK_STREAM 4
47 #define STATE_STEP_SCRIPT 5
53 extern SPI_HandleTypeDef
g_spi1;
54 extern SPI_HandleTypeDef
g_spi2;
void Flash_Fault_Log_Init()
Initialize flash error logging.
Definition: flash.c:221
#define STATE_CHECK_PPS
Definition: main.h:35
void IMU_SPI_Init()
SPI1 Initialization Function (master SPI port to IMU)
Definition: imu.c:38
Header file for iSensor-SPI-Buffer register interfacing module.
void Script_Check_Stream()
Check the stream status.
Definition: script.c:151
static void SystemClock_Config()
System Clock Configuration.
Definition: main.c:328
void Timer_Init()
Initialize all timers for operation.
Definition: timer.c:47
DMA_HandleTypeDef g_dma_spi2_tx
Definition: main.c:43
Header file for iSensor-SPI-Buffer runtime firmware upgrade module.
DMA_HandleTypeDef g_dma_spi1_tx
Definition: main.c:40
DMA_HandleTypeDef g_dma_spi1_rx
Definition: main.c:37
Header file for iSensor-SPI-Buffer watchdog timer module.
static void DMA_Init()
Init all DMA channels in use and configure DMA interrupts.
Definition: main.c:256
void DIO_Validate_Input_Config()
Validates the DIO_INPUT_CONFIG value.
Definition: dio.c:152
void Reg_Buf_Dequeue_To_Outputs()
Dequeues an entry from the buffer and loads it to the primary output registers.
Definition: reg.c:158
Header file for iSensor-SPI-Buffer user SPI (slave SPI) module.
bool
Definition: main.h:26
SPI_HandleTypeDef g_spi1
Definition: main.c:46
volatile uint32_t g_user_burst_start
Definition: user_spi.c:20
Header file for iSensor-SPI-Buffer SD card interfacing and script execution module.
Header file for iSensor-SPI-Buffer DIO interfacing module.
volatile uint32_t g_update_flags
Definition: reg.c:32
void USB_Rx_Handler()
Handler for received USB data.
Definition: usb.c:77
Header file for iSensor-SPI-Buffer ADC module (for temp sensor and Vdd monitoring)
#define STATE_CHECK_FLAGS
Definition: main.h:32
void Flash_Log_Fault(uint32_t faultCode)
Stores an error code to flash memory.
Definition: flash.c:173
void Watchdog_Feed()
Feeds the watchdog timer. Should be called periodically from main loop.
Definition: watchdog.c:25
void ADC_Update()
Read and scale ADC values then load to output registers.
Definition: adc.c:106
void DFU_Check_Flags()
Checks if a reboot into the DFU bootloader is needed.
Definition: dfu.c:33
void Watchdog_Check_Status()
Check if system reset from independent watch dog timeout and sets the appropriate STATUS flag.
Definition: watchdog.c:35
DMA_HandleTypeDef g_dma_spi2_tx
Definition: main.c:43
static void MX_GPIO_Init()
GPIO Initialization Function.
Definition: main.c:382
Implementation for iSensor-SPI-Buffer IMU interfacing module.
void SD_Card_Init()
Init SD card hardware interface and FATFs driver.
Definition: sd_card.c:98
Header file for iSensor-SPI-Buffer timer module.
void User_Interrupt_Update()
Updates the user interrupt (data ready) signal status.
Definition: user_interrupt.c:25
#define STATE_CHECK_STREAM
Definition: main.h:44
void Flash_Check_Logged_Fault()
Checks for error codes which may have been logged to flash, and sets the status register bit.
Definition: flash.c:142
SPI_HandleTypeDef g_spi2
Definition: main.c:49
void Data_Capture_Disable()
disables autonomous data capture by disabling DR ISR.
Definition: data_capture.c:53
Header file for iSensor-SPI-Buffer USB command line register interface.
void Reg_Init()
Initialize the register module by loading all saves values from flash.
Definition: reg.c:125
void User_SPI_Update_Config(uint32_t CheckUnlock)
Updates the slave SPI (SPI2) config based on the USER_SPI_CONFIG register.
Definition: user_spi.c:163
Header file for iSensor-SPI-Buffer LED control module.
Header file for iSensor-SPI-Buffer buffer data structure module.
void Watchdog_Enable(uint32_t timeout_ms)
Enables watch dog reset functionality.
Definition: watchdog.c:60
void Main_Error_Handler()
This function is executed in case of error occurrence.
Definition: main.c:233
void DIO_Update_Output_Config()
Validates DIO_OUTPUT_CONFIG settings and applies to GPIO.
Definition: dio.c:291
Header file for iSensor-SPI-Buffer user interrupt (data ready) config and generation functions.
static uint32_t state
Definition: main.c:52
DMA_HandleTypeDef g_dma_spi1_tx
Definition: main.c:40
DMA_HandleTypeDef g_dma_spi1_rx
Definition: main.c:37
Header file for iSensor-SPI-Buffer main.
void Reg_Process_Command()
Processes a command register write. This function is called from main loop.
Definition: reg.c:322
void SD_Card_Script_Autorun()
Run SD card script automatic execution process.
Definition: sd_card.c:118
SPI_HandleTypeDef g_spi2
Definition: main.c:49
void ADC_Init()
ADC1 Initialization Function.
Definition: adc.c:40
void Data_Capture_Enable()
Enables autonomous data capture by enabling DR ISR in NVIC.
Definition: data_capture.c:27
void Timer_Check_PPS_Unlock()
Check if the PPS signal is unlocked (greater than 1100ms since last PPS strobe)
Definition: timer.c:64
Header file for iSensor-SPI-Buffer autonomous IMU data acquisition module.
#define STATE_READ_ADC
Definition: main.h:38
#define STATE_STEP_SCRIPT
Definition: main.h:47
void IMU_Update_SPI_Config()
Processes any changes to IMU_SPI_CONFIG reg and applies.
Definition: imu.c:294
#define STATE_CHECK_USB
Definition: main.h:41
SPI_HandleTypeDef g_spi1
Definition: main.c:46
Header file for iSensor-SPI-Buffer script module (loaded from SD card)
int main()
The application entry point.
Definition: main.c:59
void SD_Card_Script_Step()
Step the script execution process.
Definition: sd_card.c:234
void DIO_Update_Input_Config()
Validates and updates the data ready input configuration based on DIO_INPUT_CONFIG.
Definition: dio.c:186
void Buffer_Reset()
Clears the buffer data structure.
Definition: buffer.c:186
void USB_Reset()
Toggle USB PU to force a re-enumeration on the host side.
Definition: usb.c:47
#define ERROR_INIT
Definition: flash.h:39
Header file for iSensor-SPI-Buffer flash memory interfacing functions.