Skip to content

Commit 185cbde

Browse files
committed
stm32h7: Add stm32h7_adc_enable_tsense()
1 parent e4ab7e7 commit 185cbde

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/platform/stm32h7/stm32h7_adc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ stm32h7_adc_init(uint32_t base, uint32_t pcsel, uint32_t difsel)
105105
reg_rd(base + ADC3_CALFACT));
106106
}
107107

108+
void stm32h7_adc_enable_tsense(void)
109+
{
110+
reg_set_bit(ADC3_BASE + ADC3_CCR, 23);
111+
}
108112

109113
void
110114
stm32h7_adc_set_smpr(uint32_t base, uint32_t channel, uint32_t value)

src/platform/stm32h7/stm32h7_adc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
#define ADC3_DIFSEL 0xb0
5050
#define ADC3_CALFACT 0xb4
51+
#define ADC3_CCR 0x308
5152

5253
#define ADCX_CSR 0x40022300
5354
#define ADCX_CCR 0x40022308
@@ -56,6 +57,8 @@
5657

5758
void stm32h7_adc_init(uint32_t base, uint32_t pcsel, uint32_t difsel);
5859

60+
void stm32h7_adc_enable_tsense(void);
61+
5962
void stm32h7_adc_set_smpr(uint32_t base, uint32_t channel, uint32_t value);
6063

6164
void stm32h7_set_seq_channel(uint32_t base, uint32_t seq, uint32_t channel);

0 commit comments

Comments
 (0)