Add DMA ring buffer file for UART, Improve calculation of PT1000 resistance
This commit is contained in:
@@ -12,30 +12,32 @@
|
||||
/**
|
||||
* @brief ADC channel number of PT1000 sensor input
|
||||
*/
|
||||
#define ADC_PT1000_CHANNEL 2
|
||||
#define ADC_PT1000_CHANNEL 2U
|
||||
|
||||
#define ADC_PT1000_PORT GPIOA
|
||||
#define ADC_PT1000_PORT_RCC_MASK RCC_AHB1ENR_GPIOAEN
|
||||
|
||||
#define ADC_PT1000_PIN 2
|
||||
#define ADC_PT1000_PIN 2U
|
||||
|
||||
#define ADC_FILTER_STARTUP_CYCLES 800
|
||||
#define ADC_FILTER_STARTUP_CYCLES 800U
|
||||
|
||||
#define ADC_PT1000_SAMPLE_CNT_DELAY 2000
|
||||
#define ADC_PT1000_SAMPLE_CNT_DELAY 1000U
|
||||
|
||||
#define ADC_PT1000_DMA_AVG_SAMPLES 6U
|
||||
|
||||
/**
|
||||
* @brief Lower value for valid input range for PT1000 measurement
|
||||
*
|
||||
* If the input of the PT1000 sensor is below this value, an error is thrown. This is used to disable the temperature control loop
|
||||
*/
|
||||
#define ADC_PT1000_LOWER_WATCHDOG 100
|
||||
#define ADC_PT1000_LOWER_WATCHDOG 200U
|
||||
|
||||
/**
|
||||
* @brief Upper value for valid input range for PT1000 measurement
|
||||
*
|
||||
* If the input of the PT1000 sensor is above this value, an error is thrown. This is used to disable the temperature control loop
|
||||
*/
|
||||
#define ADC_PT1000_UPPER_WATCHDOG 4000
|
||||
#define ADC_PT1000_UPPER_WATCHDOG 4000U
|
||||
|
||||
enum adc_pt1000_error {ADC_PT1000_NO_ERR= 0, ADC_PT1000_WATCHDOG_ERROR=(1UL<<0), ADC_PT1000_OVERFLOW=(1UL<<1)};
|
||||
|
||||
|
4
stm-firmware/include/uart/dma-ring-buffer.h
Normal file
4
stm-firmware/include/uart/dma-ring-buffer.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef __DMA_RING_BUFFER_H__
|
||||
#define __DMA_RING_BUFFER_H__
|
||||
|
||||
#endif /* __DMA_RING_BUFFER_H__ */
|
Reference in New Issue
Block a user