From 0bce68e6a0abc19f49c573331164d13643c9bee5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 7 Apr 2012 20:31:58 -0700 Subject: [PATCH] altos: Add STM temperature sensor calibration data Each stm32l has two-point factory temperature calibration data. Provide access to that for displaying temperature data. Signed-off-by: Keith Packard --- src/stm/registers.ld | 5 ++++- src/stm/stm32l.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/stm/registers.ld b/src/stm/registers.ld index 51921444..fd61e486 100644 --- a/src/stm/registers.ld +++ b/src/stm/registers.ld @@ -44,4 +44,7 @@ stm_tim4 = 0x40000800; stm_tim3 = 0x40000400; stm_tim2 = 0x40000000; -stm_nvic = 0xe000e100; \ No newline at end of file +stm_nvic = 0xe000e100; + +/* calibration data in system memory */ +stm_temp_cal = 0x1ff80078; diff --git a/src/stm/stm32l.h b/src/stm/stm32l.h index b9f45513..338bc471 100644 --- a/src/stm/stm32l.h +++ b/src/stm/stm32l.h @@ -1152,4 +1152,16 @@ extern struct stm_adc stm_adc; #define STM_ADC_CCR_ADCPRE_HSI_4 2 #define STM_ADC_CCR_ADCPRE_MASK 3 +struct stm_temp_cal { + uint16_t vref; + uint16_t ts_cal_cold; + uint16_t reserved; + uint16_t ts_cal_hot; +}; + +extern struct stm_temp_cal stm_temp_cal; + +#define stm_temp_cal_cold 25 +#define stm_temp_cal_hot 110 + #endif /* _STM32L_H_ */ -- 2.30.2