|
PHiLIP
|
Files | |
| file | adc.h |
| Controls the adc peripheral. | |
| file | gpio.h |
| GPIO management. | |
| file | i2c.h |
| Controls the i2c peripheral. | |
| file | led_flash.h |
| Flashes the LED, the most important thing in embedded. | |
| file | pwm_dac.h |
| Controls the pwm and dac peripheral. | |
| file | rtc.h |
| Controls the rtc peripheral. | |
| file | spi.h |
| Controls the spi peripheral. | |
| file | sys.h |
| System control and management. | |
| file | tmr.c |
| Controls the timer peripheral. | |
| file | trace.h |
| Used for logging traces. | |
| file | uart.h |
| Controls the uart peripherals. | |
| file | wdt.h |
| Handles watchdog timer periph. | |
| file | adc.c |
| Controls the adc peripheral. | |
| file | gpio.c |
| GPIO management. | |
| file | i2c.c |
| Controls the i2c peripheral. | |
| file | led_flash.c |
| Flashes the LED, the most important thing in embedded. | |
| file | pwm_dac.c |
| Controls the pwm and dac peripheral. | |
| file | rtc.c |
| Controls the rtc peripheral. | |
| file | spi.c |
| Controls the spi peripheral. | |
| file | sys.c |
| System control and management. | |
| file | tmr.c |
| Controls the timer peripheral. | |
| file | trace.c |
| Used for logging traces. | |
| file | uart.c |
| Controls the uart peripherals. | |
| file | wdt.c |
| Handles watchdog timer periph. | |
Data Structures | |
| struct | gpio_dev |
| Parameters for gpio control. More... | |
| struct | i2c_dev |
| The parameters for reg control. More... | |
| struct | pwm_dev |
| The parameters for pwm control. More... | |
| struct | dac_dev |
| The parameters for dac control. More... | |
| struct | spi_dev |
| The parameters for spi control. More... | |
| struct | uart_dev_t |
| The parameters for uart control. More... | |
Macros | |
| #define | SPI_NO_DATA_BYTE 0xFE |
| SPI data not available byte. | |
| #define | DMA_HOLDOFF_NS 200 |
| #define | INT_HOLDOFF_NS 1000 |
| #define | OVERFLOW_TICK_VAL 0x10000 |
| #define | UART_IF_BUF_SIZE (1024) |
| Size allocated for if uart buffer. | |
| #define | UART_DUT_BUF_SIZE (128) |
| Size allocated for dut uart buffer. | |
| #define | START_WAIT_FLASHES (6 * 2) |
| How long it takes to indicate the start of led flashing. | |
| #define | WAIT_FLASHES (2 * 2) |
| How long it takes to indicate the next led flashing state. | |
| #define | MAJOR_FLASHES ((FW_REV_MAJOR + 1) * 2) |
| Start flash waits longer than the normal waits. | |
| #define | MINOR_FLASHES ((FW_REV_MINOR + 1) * 2) |
| Start flash waits longer than the normal waits. | |
| #define | PATCH_FLASHES ((FW_REV_PATCH + 1) * 2) |
| Start flash waits longer than the normal waits. | |
| #define | FLASH_TIME_MS 150 |
| How long the led takes to toggle in ms. | |
Functions | |
| void | init_dut_adc (map_t *reg) |
| Initializes adc registers and peripheral. More... | |
| void | init_dut_adc_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | deinit_dut_adc_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| error_t | commit_dut_adc () |
| Commits the adc registers and executes operations. More... | |
| void | poll_dut_adc () |
| Updated the map with ADC values. More... | |
| void | init_gpio (map_t *reg) |
| Initializes gpio directions, states and interrupt settings. More... | |
| error_t | commit_debug () |
| Commits the gpio registers and executes operations. More... | |
| void | update_debug_inputs () |
| Updates the DEBUG input levels. | |
| error_t | init_basic_gpio (basic_gpio_t gpio, GPIO_TypeDef *port, uint32_t pin) |
| Initializes a basic gpio. More... | |
| void | init_dut_i2c (map_t *reg) |
| Initializes i2c registers. More... | |
| error_t | commit_dut_i2c () |
| Commits the i2c registers and executes operations. More... | |
| void | update_dut_i2c_inputs () |
| Updates the i2c input levels. | |
| void | init_dut_i2c_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | deinit_dut_i2c_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | init_led_flash () |
| Initialize LED0 gpio. | |
| void | flash_fw_version () |
| Flashes the firmware major, minor, and patch version (+1) on on the led. More... | |
| void | init_dut_pwm_dac (map_t *reg) |
| Initializes pwm and dac registers. More... | |
| error_t | commit_dut_pwm () |
| Commits the dut pwm registers and executes operations. More... | |
| error_t | commit_dut_dac () |
| Commits the dut dac registers and executes operations. More... | |
| void | update_dut_pwm_inputs () |
| Updates the pwm input levels. | |
| void | update_dut_dac_inputs () |
| Updates the dac input levels. | |
| void | init_dut_pwm_dac_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | postinit_dut_pwm_dac_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | deinit_dut_pwm_dac_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | init_rtc (map_t *reg) |
| Initializes rtc registers. More... | |
| error_t | commit_rtc () |
| Commits the rtc registers and executes operations. More... | |
| void | update_rtc () |
| Updates the rtc time. | |
| void | init_dut_spi (map_t *reg) |
| Initializes spi registers. More... | |
| error_t | commit_dut_spi () |
| Commits the spi registers and executes operations. More... | |
| void | update_dut_spi_inputs () |
| Updates the spi input levels. | |
| void | init_dut_spi_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | deinit_dut_spi_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | GPIO_NSS_INT () |
| Interrupt callback for the spi line raise or lower. More... | |
| void | init_sys (map_t *reg) |
| Initializes system registers. More... | |
| error_t | commit_sys () |
| Commits the system registers and executes operations. More... | |
| void | update_tick () |
| Updates the tick count to the app reg. More... | |
| void | init_dut_ic (map_t *reg) |
| Initializes timer registers and peripheral. More... | |
| void | init_dut_ic_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | deinit_dut_ic_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| error_t | commit_dut_ic () |
| Commits the adc registers and executes operations. More... | |
| void | poll_dut_ic () |
| Polls for high speed input capture values. More... | |
| void | update_dut_ic_inputs () |
| Updates the dut_ic input level. | |
| void | init_trace (map_t *reg) |
| Initializes trace register. More... | |
| void | store_gpio_trace (uint8_t tick_div, uint8_t source, uint16_t value) |
| Stores an gpio toggle event. More... | |
| void | store_tick_from_buf (uint8_t source, uint16_t value, uint32_t tick) |
| Stores an ticks saved from a buffer. More... | |
| void | init_dut_uart (map_t *reg) |
| Initializes dut uart registers. More... | |
| void | init_if_uart () |
| Initializes interface uart registers. | |
| error_t | commit_dut_uart () |
| Commits the dut uart registers and executes operations. More... | |
| error_t | poll_dut_uart () |
| Polls for any commands from the dut uart. More... | |
| error_t | poll_if_uart () |
| Polls for any commands from the interface uart. More... | |
| void | update_dut_uart_inputs () |
| Updates the uart input levels. | |
| void | GPIO_CTS_INT () |
| This function handles dut_cts event interrupt. | |
| void | init_dut_uart_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | deinit_dut_uart_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | init_if_uart_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | deinit_if_uart_msp () |
| Only for use with the STM32xxxx_HAL_Driver. | |
| void | init_wdt () |
| Initializes the watchdog timer. | |
| void | reset_wdt () |
| Resets the watchdog timer. | |
| #define DMA_HOLDOFF_NS 200 |
Time it takes for a DMA to load value
| #define INT_HOLDOFF_NS 1000 |
Time it takes for a interrupt to load value
| #define OVERFLOW_TICK_VAL 0x10000 |
16 bit timer will overflow to this value
| enum APP_UART_DATABITS |
| enum APP_UART_PARITY |
| enum DUT_IC_EDGE |
| enum EVENT_SOURCES |
| enum EVENT_TYPE |
| enum FLASH_STATE |
The states of flashing the led.
| enum GPIO_IO_TYPE |
| enum I2C_STATE |
The state settings of the I2C.
| enum SPI_IF_TYPE |
| enum SPI_STATE |
| enum UART_IF_TYPE |
| error_t commit_debug | ( | ) |
Commits the gpio registers and executes operations.
| error_t commit_dut_adc | ( | ) |
Commits the adc registers and executes operations.
| error_t commit_dut_dac | ( | ) |
Commits the dut dac registers and executes operations.
| error_t commit_dut_i2c | ( | ) |
Commits the i2c registers and executes operations.
| error_t commit_dut_ic | ( | ) |
Commits the adc registers and executes operations.
| error_t commit_dut_pwm | ( | ) |
Commits the dut pwm registers and executes operations.
| error_t commit_dut_spi | ( | ) |
Commits the spi registers and executes operations.
| error_t commit_dut_uart | ( | ) |
Commits the dut uart registers and executes operations.
| error_t commit_rtc | ( | ) |
Commits the rtc registers and executes operations.
| error_t commit_sys | ( | ) |
Commits the system registers and executes operations.
| void flash_fw_version | ( | ) |
Flashes the firmware major, minor, and patch version (+1) on on the led.
| void GPIO_NSS_INT | ( | ) |
Interrupt callback for the spi line raise or lower.
Interrupt callback for the spi line raise or lower.
| error_t init_basic_gpio | ( | basic_gpio_t | gpio, |
| GPIO_TypeDef * | port, | ||
| uint32_t | pin | ||
| ) |
Initializes a basic gpio.
| [in] | gpio | Parameters of GPIO such as input with pullup |
| [in] | port | ...GPIO port |
| [in] | pin | ...GPIO pin |
| void init_dut_adc | ( | map_t * | reg | ) |
Initializes adc registers and peripheral.
| [in] | reg | Pointer to live register memory map |
| void init_dut_i2c | ( | map_t * | reg | ) |
Initializes i2c registers.
| [in] | reg | Pointer to register memory map |
| void init_dut_ic | ( | map_t * | reg | ) |
Initializes timer registers and peripheral.
| [in] | reg | Pointer to register memory map |
| void init_dut_pwm_dac | ( | map_t * | reg | ) |
Initializes pwm and dac registers.
| [in] | reg | Pointer to live register memory map |
| void init_dut_spi | ( | map_t * | reg | ) |
Initializes spi registers.
| [in] | reg | Pointer to live register memory map |
| void init_dut_uart | ( | map_t * | reg | ) |
Initializes dut uart registers.
| [in] | reg | Pointer to live register memory map |
| void init_gpio | ( | map_t * | reg | ) |
Initializes gpio directions, states and interrupt settings.
| [in] | reg | Pointer to register memory map |
| void init_rtc | ( | map_t * | reg | ) |
Initializes rtc registers.
| [in] | reg | Pointer to live register memory map |
| void init_sys | ( | map_t * | reg | ) |
Initializes system registers.
| [in] | reg | Pointer to register memory map |
| void init_trace | ( | map_t * | reg | ) |
Initializes trace register.
| [in] | reg | Pointer to live register memory map |
| void poll_dut_adc | ( | ) |
Updated the map with ADC values.
| void poll_dut_ic | ( | ) |
Polls for high speed input capture values.
Since values must be transferred before the buffer overflows, either in DMA or INT mode this must be called at a rate faster that buffer overflow can occur.
| error_t poll_dut_uart | ( | ) |
Polls for any commands from the dut uart.
| error_t poll_if_uart | ( | ) |
Polls for any commands from the interface uart.
| void store_gpio_trace | ( | uint8_t | tick_div, |
| uint8_t | source, | ||
| uint16_t | value | ||
| ) |
Stores an gpio toggle event.
| [in] | tick_div | Divides ticks by power of 2 |
| [in] | source | The source of the event |
| [in] | value | The value from the event |
| void store_tick_from_buf | ( | uint8_t | source, |
| uint16_t | value, | ||
| uint32_t | tick | ||
| ) |
Stores an ticks saved from a buffer.
Assume tick_div is 0
| [in] | source | The source of the event |
| [in] | value | The value from the event |
| [in] | tick | Value of the tick |
| void update_tick | ( | ) |
Updates the tick count to the app reg.