From 7ed7d535e9bd78299b7528533909c36d07060a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Fri, 21 Sep 2018 15:26:29 +0200 Subject: [PATCH] drivers: adc: nrfx: Use SAADC HAL for setting the burst mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces direct accesses to the peripheral registers structure with the proper SAADC HAL function that appeared recently in nrfx. Signed-off-by: Andrzej Głąbek --- drivers/adc/adc_nrfx_saadc.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 328d9fd51d6..d751e96f7ff 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -245,15 +245,6 @@ static int check_buffer_size(const struct adc_sequence *sequence, return 0; } -/* TODO: Move to . */ -static void _nrf_saadc_burst_set(uint8_t channel, - nrf_saadc_burst_t burst) -{ - NRF_SAADC->CH[channel].CONFIG = - (NRF_SAADC->CH[channel].CONFIG & ~SAADC_CH_CONFIG_BURST_Msk) | - (burst << SAADC_CH_CONFIG_BURST_Pos); -} - static int start_read(struct device *dev, const struct adc_sequence *sequence) { int error = 0; @@ -295,7 +286,7 @@ static int start_read(struct device *dev, const struct adc_sequence *sequence) * is not used (hence, the multiple channel sampling is * possible), the burst mode have to be deactivated. */ - _nrf_saadc_burst_set(channel_id, + nrf_saadc_burst_set(channel_id, (sequence->oversampling != 0 ? NRF_SAADC_BURST_ENABLED : NRF_SAADC_BURST_DISABLED));