Add DMA ring buffer file for UART, Improve calculation of PT1000 resistance

This commit is contained in:
2020-02-05 23:09:23 +01:00
parent 4c7909adac
commit 3ac252db69
5 changed files with 118 additions and 30 deletions

View File

@@ -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)};

View File

@@ -0,0 +1,4 @@
#ifndef __DMA_RING_BUFFER_H__
#define __DMA_RING_BUFFER_H__
#endif /* __DMA_RING_BUFFER_H__ */