samd/modmachine: Make some machine classes configurable by #defines.

These include ADC, DAC, I2C, SoftI2C, SPI, SoftI2C, PWM, UART, pulse.  This
is useful for devices like the Adafruit Trinket series which have almost no
accessible GPIO pins.

Signed-off-by: robert-hh <robert@hammelrath.com>
This commit is contained in:
robert-hh
2023-03-11 08:03:18 +01:00
committed by Damien George
parent b2df094bf8
commit 47fa723586
12 changed files with 131 additions and 32 deletions

View File

@@ -25,8 +25,11 @@
* THE SOFTWARE.
*/
#include <string.h>
#include "py/runtime.h"
#if MICROPY_PY_MACHINE_PWM
#include <string.h>
#include "py/mphal.h"
#include "modmachine.h"
#include "clock_config.h"
@@ -393,3 +396,5 @@ STATIC void mp_machine_pwm_duty_set_ns(machine_pwm_obj_t *self, mp_int_t duty_ns
duty_type_flags[self->device] &= ~(1 << self->channel);
mp_machine_pwm_start(self);
}
#endif