Working temperature readout.

This commit is contained in:
2025-07-16 14:57:34 +02:00
parent c6b250a4a8
commit ed49071ffa
4 changed files with 176 additions and 13 deletions

31
src/ad5940_registers.rs Normal file
View File

@@ -0,0 +1,31 @@
use bitflags::bitflags;
bitflags! {
// Address 0x00002000, Reset: 0x00080000, Name: AFECON
pub struct ConfigurationRegister: u32 {
const reset = 0x00080000;
const DACBUFEN = 1 << 21;
const DACREFEN = 1 << 20;
const SINC2EN = 1 << 16;
const DFTEN = 1 << 15;
const WAVEGENEN = 1 << 14;
const TEMPCONVEN = 1 << 13;
const TEMPSENSEN = 1 << 12;
const TIAEN = 1 << 11;
const INAMPEN = 1 << 10;
const EXBUFEN = 1 << 9;
const ADCCONVEN = 1 << 8;
const ADCEN = 1 << 7;
const DACEN = 1 << 6;
const HSREFDIS = 1 << 5;
}
}
bitflags! {
// Address 0x000021A8, Reset: 0x00000000, Name: ADCCON
pub struct ADCConfigurationRegister: u32 {
const GNPGA_1_5 = 1 << 16;
const MUXSELN_TEMP = 0b01011 << 8;
const MUXSELP_TEMP = 0b01011;
}
}