cleanup code and write a little documentation
This commit is contained in:
parent
7bfa0732db
commit
b6a2790a59
@ -15,4 +15,4 @@ mechanisms and the behavior. For a detailed code documentation see the doxygen o
|
|||||||
safety/index
|
safety/index
|
||||||
code/index
|
code/index
|
||||||
hw-version-detect
|
hw-version-detect
|
||||||
|
peripherals
|
||||||
|
44
doc/source/firmware/peripherals.rst
Normal file
44
doc/source/firmware/peripherals.rst
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
.. _peripherals:
|
||||||
|
|
||||||
|
Used Peripheral Modules
|
||||||
|
=======================
|
||||||
|
|
||||||
|
This section lists all the used peripheral modules of the ``STM32F407VxT6``.
|
||||||
|
|
||||||
|
Core Peripherals
|
||||||
|
----------------
|
||||||
|
|
||||||
|
- ``SysTick``: Generating a 100us tick for the LCD routine and 1ms base system tick.
|
||||||
|
- ``NVIC``: Interrupt controller
|
||||||
|
- ``FPU``: The Flaoting Point Unit is activated and used in this formware.
|
||||||
|
|
||||||
|
AHB Peripherals
|
||||||
|
---------------
|
||||||
|
|
||||||
|
- ``DMA2``
|
||||||
|
- ``Stream0``: DMA transfer of PT1000 measurement ADC to memory
|
||||||
|
- ``Stream4``: DMA transfer of Safety ADC measurement values
|
||||||
|
- ``Stream5``: Shell UART RX
|
||||||
|
- ``Stream7``: Shell UART TX
|
||||||
|
- ``RNG``: Random number generation for stack corruption / overflow checker.
|
||||||
|
- ``CRC``: CRC verfication of various data (Safety structures, EEPROM data, Safety RAM)
|
||||||
|
- ``Backup RAM``: Backup RAM storing errors and bootloader information beyond system resets. The memory is cleared by a power cycle!
|
||||||
|
|
||||||
|
ABP1 Peripherals
|
||||||
|
----------------
|
||||||
|
|
||||||
|
- ``IWDG``: Independent Watchdog
|
||||||
|
- ``TIM2``: PT1000 measurement ADC sample time generation timer. Genewrates the 1 KHz sample trigger to the ADC peripheral via the internal event routing system.
|
||||||
|
- ``TIM3``: PWM timer for oven relais output.
|
||||||
|
- ``TIM5``: Input capture for rotary encoder.
|
||||||
|
- ``TIM7``: Timer for loudspeaker tone generation.
|
||||||
|
|
||||||
|
|
||||||
|
APB2 Peripherals
|
||||||
|
----------------
|
||||||
|
|
||||||
|
- ``SPI1``: SPI for external SPI-EEPROM
|
||||||
|
- ``SDIO``: SD card interface
|
||||||
|
- ``USART1``: Shell UART
|
||||||
|
- ``ADC1``: Safety ADC for monitoring voltages
|
||||||
|
- ``ADC3``: PT1000 measurement ADC
|
@ -41,12 +41,12 @@ static struct pid_controller IN_SECTION(.ccm.bss) oven_pid;
|
|||||||
/**
|
/**
|
||||||
* @brief Oven PID is currently running
|
* @brief Oven PID is currently running
|
||||||
*/
|
*/
|
||||||
static bool oven_pid_running;
|
static bool IN_SECTION(.ccm.bss) oven_pid_running;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Oven PID has been aborted / abnormally stopped.
|
* @brief Oven PID has been aborted / abnormally stopped.
|
||||||
*/
|
*/
|
||||||
static bool oven_pid_aborted;
|
static bool IN_SECTION(.ccm.bss) oven_pid_aborted;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Power level [0..100] of the oven to be applied
|
* @brief Power level [0..100] of the oven to be applied
|
||||||
|
@ -31,8 +31,22 @@
|
|||||||
#include <reflow-controller/safety/safety-controller.h>
|
#include <reflow-controller/safety/safety-controller.h>
|
||||||
|
|
||||||
static const uint8_t safety_adc_channels[SAFETY_ADC_NUM_OF_CHANNELS] = {SAFETY_ADC_CHANNELS};
|
static const uint8_t safety_adc_channels[SAFETY_ADC_NUM_OF_CHANNELS] = {SAFETY_ADC_CHANNELS};
|
||||||
static volatile uint8_t safety_adc_conversion_complete;
|
|
||||||
static volatile uint8_t safety_adc_triggered;
|
/**
|
||||||
|
* @brief Safety ADC conversion complete. Set in interrupt.
|
||||||
|
*/
|
||||||
|
static volatile uint8_t IN_SECTION(.ccm.bss) safety_adc_conversion_complete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Safety ADC has been started. It will perform all specified conversions and
|
||||||
|
* set @ref safety_adc_conversion_complete afterwards
|
||||||
|
*/
|
||||||
|
static volatile uint8_t IN_SECTION(.ccm.bss) safety_adc_triggered;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Safety ADC conversion storage. This is filled by DMA.
|
||||||
|
* @note Do not move this to CCM RAM as the DMA won't be able to access it.
|
||||||
|
*/
|
||||||
static volatile uint16_t safety_adc_conversions[SAFETY_ADC_NUM_OF_CHANNELS];
|
static volatile uint16_t safety_adc_conversions[SAFETY_ADC_NUM_OF_CHANNELS];
|
||||||
|
|
||||||
void safety_adc_init(void)
|
void safety_adc_init(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user