iSensor-SPI-Buffer  1.15
Firmware for the iSensor-SPI-Buffer board to enable full throughput buffered data capture on Analog Devices IMUs
Macros | Variables
reg.h File Reference

Header file for iSensor-SPI-Buffer register interfacing module. More...

#include <stdint.h>
#include "main.h"
Include dependency graph for reg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define REG_PER_PAGE   64
 
#define NUM_REG_PAGES   4
 
#define PAGE_ID   0
 
#define OUTPUT_PAGE   252
 
#define BUF_CONFIG_PAGE   253
 
#define BUF_CONFIG_REG   0x41
 
#define BUF_LEN_REG   0x42
 
#define BTN_CONFIG_REG   0x43
 
#define DIO_INPUT_CONFIG_REG   0x44
 
#define DIO_OUTPUT_CONFIG_REG   0x45
 
#define WATERMARK_INT_CONFIG_REG   0x46
 
#define ERROR_INT_CONFIG_REG   0x47
 
#define IMU_SPI_CONFIG_REG   0x48
 
#define USER_SPI_CONFIG_REG   0x49
 
#define CLI_CONFIG_REG   0x4A
 
#define USER_COMMAND_REG   0x4B /* Clears automatically */
 
#define SYNC_FREQ_REG   0x4C
 
#define USER_SCR_0_REG   0x5A
 
#define USER_SCR_3_REG   0x5D
 
#define UTC_TIMESTAMP_LWR_REG   0x5E
 
#define UTC_TIMESTAMP_UPR_REG   0x5F
 
#define STATUS_0_REG   0x60
 
#define FAULT_CODE_REG   0x61
 
#define BUF_CNT_0_REG   0x62
 
#define BUF_MAX_CNT_REG   0x63
 
#define TIMESTAMP_LWR_REG   0x65
 
#define TIMESTAMP_UPR_REG   0x66
 
#define TEMP_REG   0x67
 
#define VDD_REG   0x68
 
#define SCR_LINE_REG   0x72
 
#define SCR_ERROR_REG   0x73
 
#define ENDURANCE_REG   0x76
 
#define FW_REV_REG   0x77
 
#define FW_DAY_MONTH_REG   0x78
 
#define FW_YEAR_REG   0x79
 
#define DEV_SN_REG   0x7A
 
#define BUF_WRITE_PAGE   254
 
#define BUF_WRITE_0_REG   0x89
 
#define FLASH_SIG_DRV_REG   0xBE
 
#define FLASH_SIG_REG   0xBF
 
#define BUF_READ_PAGE   255
 
#define STATUS_1_REG   0xC1
 
#define BUF_CNT_1_REG   0xC2
 
#define BUF_RETRIEVE_REG   0xC3
 
#define BUF_UTC_TIMESTAMP_REG   0xC4
 
#define BUF_US_TIMESTAMP_REG   0xC6
 
#define BUF_SIG_REG   0xC8
 
#define BUF_DATA_0_REG   0xC9
 
#define FW_REV_DEFAULT   0x0115
 
#define BUF_CONFIG_DEFAULT   0x0000
 
#define BUF_LEN_DEFAULT   0x0014
 
#define DIO_INPUT_CONFIG_DEFAULT   0x0011
 
#define DIO_OUTPUT_CONFIG_DEFAULT   0x8421
 
#define WATER_INT_CONFIG_DEFAULT   0x0020
 
#define ERROR_INT_CONFIG_DEFAULT   0xFFFC
 
#define IMU_SPI_CONFIG_DEFAULT   0x100F
 
#define USER_SPI_CONFIG_DEFAULT   0x0007
 
#define CLI_CONFIG_DEFAULT   0x2000
 
#define BTN_CONFIG_DEFAULT   0x8000
 
#define SYNC_FREQ_DEFAULT   2000
 
#define FLASH_SIG_DEFAULT   0x9D2A
 
#define DIO_OUTPUT_CONFIG_FLAG   (1 << 0)
 
#define IMU_SPI_CONFIG_FLAG   (1 << 1)
 
#define USER_SPI_CONFIG_FLAG   (1 << 2)
 
#define USER_COMMAND_FLAG   (1 << 3)
 
#define DIO_INPUT_CONFIG_FLAG   (1 << 4)
 
#define ENABLE_CAPTURE_FLAG   (1 << 5)
 
#define DEQUEUE_BUF_FLAG   (1 << 6)
 
#define DISABLE_CAPTURE_FLAG   (1 << 7)
 
#define CMD_CLEAR_BUFFER   (1 << 0)
 
#define CMD_CLEAR_FAULT   (1 << 1)
 
#define CMD_FACTORY_RESET   (1 << 2)
 
#define CMD_FLASH_UPDATE   (1 << 3)
 
#define CMD_PPS_ENABLE   (1 << 4)
 
#define CMD_PPS_DISABLE   (1 << 5)
 
#define CMD_START_SCRIPT   (1 << 6)
 
#define CMD_STOP_SCRIPT   (1 << 7)
 
#define CMD_WATERMARK_SET   (1 << 8)
 
#define CMD_SYNC_GEN   (1 << 9)
 
#define CMD_BOOTLOADER   (1 << 13)
 
#define CMD_IMU_RESET   (1 << 14)
 
#define CMD_SOFTWARE_RESET   (1 << 15)
 
#define SPI_CONF_CPHA   (1 << 0)
 
#define SPI_CONF_CPOL   (1 << 1)
 
#define SPI_CONF_MSB_FIRST   (1 << 2)
 
#define SPI_CONF_MASK   (SPI_CONF_CPHA|SPI_CONF_CPOL|SPI_CONF_MSB_FIRST)
 
#define STATUS_BUF_WATERMARK   (1 << 0)
 
#define STATUS_BUF_FULL   (1 << 1)
 
#define STATUS_SPI_ERROR   (1 << 2)
 
#define STATUS_SPI_OVERFLOW   (1 << 3)
 
#define STATUS_OVERRUN   (1 << 4)
 
#define STATUS_DMA_ERROR   (1 << 5)
 
#define STATUS_PPS_UNLOCK   (1 << 6)
 
#define STATUS_TEMP_WARNING   (1 << 7)
 
#define STATUS_SCR_ERROR   (1 << 10)
 
#define STATUS_SCR_RUNNING   (1 << 11)
 
#define STATUS_FLASH_ERROR   (1 << 12)
 
#define STATUS_FLASH_UPDATE   (1 << 13)
 
#define STATUS_FAULT   (1 << 14)
 
#define STATUS_WATCHDOG   (1 << 15)
 
#define STATUS_CLEAR_MASK   (STATUS_FLASH_ERROR|STATUS_FAULT|STATUS_FLASH_UPDATE|STATUS_WATCHDOG|STATUS_SCR_RUNNING)
 
#define BUF_CFG_REPLACE_OLDEST   (1 << 0)
 
#define BUF_CFG_IMU_BURST   (1 << 1)
 
#define BUF_CFG_BUF_BURST   (1 << 2)
 
#define BUF_CFG_MASK   (BUF_CFG_REPLACE_OLDEST|BUF_CFG_IMU_BURST|BUF_CFG_BUF_BURST)
 
#define WATERMARK_PULSE_MASK   (1 << 15)
 
#define USB_STREAM_BITP   0
 
#define SD_STREAM_BITP   1
 
#define USB_ECHO_BITP   2
 
#define SD_AUTORUN_BITP   3
 
#define CLI_DELIM_BITP   8
 
#define USB_STREAM_BITM   (1 << USB_STREAM_BITP)
 
#define SD_STREAM_BITM   (1 << SD_STREAM_BITP)
 
#define USB_ECHO_BITM   (1 << USB_ECHO_BITP)
 
#define SD_AUTORUN_BITM   (1 << SD_AUTORUN_BITP)
 
#define CLI_DELIM_BITM   (0xFF << CLI_DELIM_BITP)
 
#define CLI_CONFIG_CLEAR_MASK   0xFF0C
 

Variables

volatile uint32_t g_update_flags
 
volatile uint16_t g_regs [NUM_REG_PAGES *REG_PER_PAGE]
 
volatile uint16_t * g_CurrentBufEntry
 

Detailed Description

Header file for iSensor-SPI-Buffer register interfacing module.

Copyright (c) Analog Devices Inc, 2020 All Rights Reserved.

Date
3/18/2020
Author
A. Nolan (alex..nosp@m.nola.nosp@m.n@ana.nosp@m.log..nosp@m.com)

Macro Definition Documentation

◆ BUF_CONFIG_PAGE

#define BUF_CONFIG_PAGE   253

iSensor-SPI-Buffer config settings page

◆ BUF_READ_PAGE

#define BUF_READ_PAGE   255

iSensor-SPI-Buffer buffer Rx data page

◆ BUF_WRITE_PAGE

#define BUF_WRITE_PAGE   254

iSensor-SPI-Buffer buffer Tx data page

◆ NUM_REG_PAGES

#define NUM_REG_PAGES   4

Number of pages

◆ OUTPUT_PAGE

#define OUTPUT_PAGE   252

Output page used for storing volatile data

◆ PAGE_ID

#define PAGE_ID   0

Page register (0 for all pages)

Variable Documentation

◆ g_CurrentBufEntry

volatile uint16_t* g_CurrentBufEntry
extern

Pointer to buffer entry. Will be 0 if no buffer entry "loaded" to output registers

◆ g_update_flags

volatile uint32_t g_update_flags
extern

Register update flags for main loop processing. Global scope