altos: Add STM temperature sensor calibration data
authorKeith Packard <keithp@keithp.com>
Sun, 8 Apr 2012 03:31:58 +0000 (20:31 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 8 Apr 2012 03:31:58 +0000 (20:31 -0700)
Each stm32l has two-point factory temperature calibration data.
Provide access to that for displaying temperature data.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/registers.ld
src/stm/stm32l.h

index 5192144485d2f693c507d109aa637dde27194966..fd61e4864bd44a434d14f2c6fcad52e7f87ff994 100644 (file)
@@ -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;
index b9f455138897e92f3efa46f93b2365cc304f6a0f..338bc4711f29b2f93fee150195cbecd3b7e013d0 100644 (file)
@@ -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_ */