add digital temperature sensor to health packet - #2414
Conversation
| "sbu2_voltage_mV": a[23], | ||
| "som_reset_triggered": a[24], | ||
| "sound_output_level": a[25], | ||
| "temperature_c": a[26], |
There was a problem hiding this comment.
i wouldn't put C here, we generally don't include units if it's the SI unit
| #define DTS_HSREF_DIV 64U // calibration counter must run below 1MHz | ||
|
|
||
| void dts_init(void) { | ||
| RCC->APB4ENR |= RCC_APB4ENR_DTSEN; |
There was a problem hiding this comment.
this should go in peripherals.h
| // continuous measurements w/ sw trigger | ||
| register_set_bits(&(DTS->CFGR1), DTS_CFGR1_TS1_START); | ||
|
|
||
| print(" DTS cal: T0VALR1 0x"); puth(DTS->T0VALR1); print(", RAMPVALR 0x"); puth(DTS->RAMPVALR); print("\n"); |
| register_clear_bits(&(DTS->CFGR1), DTS_CFGR1_TS1_START); | ||
| register_clear_bits(&(DTS->CFGR1), DTS_CFGR1_TS1_EN); | ||
| register_set(&(DTS->CFGR1), 0U, (DTS_CFGR1_TS1_SMP_TIME_Msk | DTS_CFGR1_REFCLK_SEL_Msk | DTS_CFGR1_Q_MEAS_OPT_Msk | DTS_CFGR1_HSREF_CLK_DIV_Msk | DTS_CFGR1_TS1_INTRIG_SEL_Msk)); | ||
| RCC->APB4ENR &= ~(RCC_APB4ENR_DTSEN); |
There was a problem hiding this comment.
can we just clear all the APB peripherals together? @elkoled
There was a problem hiding this comment.
@probablyanasian can you make a separate PR for that and we merge that first?
There was a problem hiding this comment.
Table 31 of RM0468 says that in stop mode (VOS5), all peripheral clocks are OFF. Since all the other APB peripherals are clocks, I don't think anything else needs to be explicitly turned off.
|
Also why are the HITL tests failing? |
|
Someone moved stuff and inadvertently unplugged the jungle. |
|
LGTM once HITL CI passes |
No description provided.