1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/sam0/periph: remove bitfield usage in DAC driver

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
This commit is contained in:
Dylan Laduranty 2024-06-06 22:26:51 +02:00
parent 3c64901b5e
commit 292111a244

View File

@ -59,7 +59,7 @@ static inline void _sync(void)
#ifdef DAC_SYNCBUSY_MASK
while (DAC->SYNCBUSY.reg) {}
#else
while (DAC->STATUS.bit.SYNCBUSY) {}
while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {}
#endif
}
@ -110,7 +110,7 @@ int8_t dac_init(dac_t line)
_dac_init_clock(line);
/* Settings can only be changed when DAC is disabled */
DAC->CTRLA.bit.ENABLE = 0;
DAC->CTRLA.reg &= ~DAC_CTRLA_ENABLE;
_sync();
#ifdef DAC_DACCTRL_ENABLE
@ -125,7 +125,7 @@ int8_t dac_init(dac_t line)
#endif
;
DAC->CTRLA.bit.ENABLE = 1;
DAC->CTRLA.reg |= DAC_CTRLA_ENABLE;
_sync();
#ifdef DAC_STATUS_READY