Skip to content

Commit

Permalink
drivers: adc: saadc: Extend gains support for nRF54L15
Browse files Browse the repository at this point in the history
Add support for gains: 1/2, 1/3, 2/5, 1/4.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
  • Loading branch information
kl-cruz authored and nashif committed Jun 27, 2024
1 parent 8cd98b1 commit ed8d70c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/adc/adc_nrfx_saadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,22 @@ static int adc_nrfx_channel_setup(const struct device *dev,
config.gain = NRF_SAADC_GAIN1_5;
break;
#endif
#if defined(SAADC_CH_CONFIG_GAIN_Gain1_4)
#if defined(SAADC_CH_CONFIG_GAIN_Gain1_4) || defined(SAADC_CH_CONFIG_GAIN_Gain2_8)
case ADC_GAIN_1_4:
config.gain = NRF_SAADC_GAIN1_4;
break;
#endif
#if defined(SAADC_CH_CONFIG_GAIN_Gain1_3)
#if defined(SAADC_CH_CONFIG_GAIN_Gain1_3) || defined(SAADC_CH_CONFIG_GAIN_Gain2_6)
case ADC_GAIN_1_3:
config.gain = NRF_SAADC_GAIN1_3;
break;
#endif
#if defined(SAADC_CH_CONFIG_GAIN_Gain1_2)
#if defined(SAADC_CH_CONFIG_GAIN_Gain2_5)
case ADC_GAIN_2_5:
config.gain = NRF_SAADC_GAIN2_5;
break;
#endif
#if defined(SAADC_CH_CONFIG_GAIN_Gain1_2) || defined(SAADC_CH_CONFIG_GAIN_Gain2_4)
case ADC_GAIN_1_2:
config.gain = NRF_SAADC_GAIN1_2;
break;
Expand Down

0 comments on commit ed8d70c

Please sign in to comment.