Open gudnimg opened 3 years ago
@GunZi200 I ran across similar issue. with this register. I was attempting to read GPIO6 but based on how struct is aligned/written I was getting VREF2. My simple fix for this was changing
/*! AUX Reg Voltage Data structure */
typedef struct
{
uint16_t a_codes[9]; //!< Aux Voltage Codes
uint8_t pec_match[4]; //!< If a PEC error was detected during most recent read cmd
} ax;
to
/*! AUX Reg Voltage Data structure */
typedef struct
{
uint16_t a_codes[12]; //!< Aux Voltage Codes
uint8_t pec_match[4]; //!< If a PEC error was detected during most recent read cmd
} ax;
I would think that:
ic[cic].ic_reg.aux_channels=9; // LTC6813
Should be:
ic[cic].ic_reg.aux_channels=12; // LTC6813
Because
a_codes[0]
= GPIO1a_codes[1]
= GPIO2a_codes[2]
= GPIO3a_codes[3]
= GPIO4a_codes[4]
= GPIO5a_codes[5]
= VREF2a_codes[6]
= GPIO6a_codes[7]
= GPIO7a_codes[8]
= GPIO8a_codes[9]
= GPIO9a_codes[10]
= Reserveda_codes[11]
= UVOV flags for C13 to C18This is how a_codes is defined in
LTC681x.h
This contradicts the example code from DC2350AB. I would expect a overflow when
i > 8
, was this code ever tested?