Hello, here is the question about nrf52840_bitfields.h. Is there any problem with macros definition? For example we have such definition:
/* Bit 20 : Enable differential mode */
#define SAADC_CH_CONFIG_MODE_Pos (20UL) /*!< Position of MODE field. */
#define SAADC_CH_CONFIG_MODE_Msk (0x1UL << SAADC_CH_CONFIG_MODE_Pos) /*!< Bit mask of MODE field. */
#define SAADC_CH_CONFIG_MODE_SE (0UL) /*!< Single-ended, PSELN will be ignored, negative input to SAADC shorted to GND */
#define SAADC_CH_CONFIG_MODE_Diff (1UL) /*!< Differential */
I expected to see definition of SAADC_CH_CONFIG_MODE_Diff, as 0x1UL << SAADC_CH_CONFIG_MODE_Pos, but this if definition of SAADC_CH_CONFIG_MODE_Msk.
So I can't just write NRF_SAADC->CH[n]. CONFIG |= SAADC_CH_CONFIG_MODE_Diff.
And I have to write NRF_SAADC->CH[n]. CONFIG |= SAADC_CH_CONFIG_MODE_Diff << SAADC_CH_CONFIG_MODE_Pos instead.
So here is the question: does it really comfortable to work with such macros? For me it creates some difficulties with code reading and writing, maybe it is possible to fix this in the next generation libraries?