samd/machine_bitstream: Add the machine.bitstream() function.

The SAMD21 implementation is an adaption of @jimmo's code for STM32Lxx.
The only changes are the addresses and names of the port registers and the
timing parameters.

SAMD21: The precision is about +/-25ns at 48MHz clock frequency.  The first
two cycles are about 40-60 ns longer than set.  But still good enough to
drive a neopixel device.

SAMD51: The precision is about +/-30ns at 120MHz clock frequency.  Good
enough to drive a neopixel device.
This commit is contained in:
robert-hh
2022-06-10 16:40:50 +02:00
committed by Damien George
parent fd7b57dd22
commit a415752173
6 changed files with 214 additions and 4 deletions

View File

@@ -111,7 +111,7 @@ void samd_init(void) {
SysTick_Config(get_cpu_freq() / 1000);
init_us_counter();
usb_init();
#if defined (MCU_SAMD51)
#if defined(MCU_SAMD51)
mp_hal_ticks_cpu_enable();
#endif
}