Functions | |
int32_t | Cy_DSADC_GetResult (const PACSS_DCHAN_Type *base) |
Read the value in the result register of the specified channel. More... | |
int32_t | Cy_DSADC_GetAccumulatorResult (const PACSS_DCHAN_Type *base) |
Read the value in the accumulated result register of the specified channel. More... | |
uint32_t | Cy_DSADC_CalcMaxCount (const cy_stc_dsadc_dchan_config_t *config) |
Calculate the maximum count value of the conversion result from the passed DCHAN configuration. More... | |
int32_t Cy_DSADC_GetResult | ( | const PACSS_DCHAN_Type * | base | ) |
Read the value in the result register of the specified channel.
base | The base address for the Digital Channel. |
int32_t Cy_DSADC_GetAccumulatorResult | ( | const PACSS_DCHAN_Type * | base | ) |
Read the value in the accumulated result register of the specified channel.
base | The base address for the Digital Channel. |
uint32_t Cy_DSADC_CalcMaxCount | ( | const cy_stc_dsadc_dchan_config_t * | config | ) |
Calculate the maximum count value of the conversion result from the passed DCHAN configuration.
The calculated value is used to convert A/D conversion result in count to voltage.
config | The configuration for the DCHAN |
COmax = M x U x 2^(SL + N1 log2(DR1) - SR + N2 * log2(DR2) - SRR + FIRADJ - SPP) = M x U x DR1^N1 x DR2^N2 x 2^(SL - SR - SRR + FIRADJ - SPP) = 4 x U x DR1^N1 x DR2^2 x 2^(SL - SR - SRR + 0 - SPP) = U x DR1^N1 x DR2^2 x 2^(2 + SL - SR - SRR - SPP) = U x DR2^2 x DR1^N1 x 2^(2 + SL - SR - SRR - SPP)
Where: M = Maximum modulator output. (In this driver, fixed to 4)
U = Moving-sum averaging.
SL = SHIFTL value ([0, 9])
N1 = 1st decimation filter order (3 for Sinc3, 4 for Sinc4)
DR1 = 1st decimation ratio ([2, 128])
N2 = 2nd decimation filter order (sinc2, fix 2)
DR2 = 2nd decimation ratio ([1, 32])
SR = DEC_SHIFTR value ([0, 15])
SRR = RR_SHIFTR value ([0, 15])
SPP = PP_SHIFTR value ([0, 15])
FIRADJ = log2(sum(FIRcoeff)) (assumes fix 0)