summaryrefslogtreecommitdiff
path: root/ports/samd/machine_i2c.c
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2023-03-11 08:03:18 +0100
committerDamien George <damien@micropython.org>2023-05-22 18:39:07 +1000
commit47fa723586dc4ae81df02f5a0a10b2b018045ab0 (patch)
tree0a3049c9cd305d0e69c937c5c25b5387f30fbcae /ports/samd/machine_i2c.c
parentb2df094bf8051758b10f2f0222e09e79ed97427e (diff)
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>
Diffstat (limited to 'ports/samd/machine_i2c.c')
-rw-r--r--ports/samd/machine_i2c.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/samd/machine_i2c.c b/ports/samd/machine_i2c.c
index 330fa433d..f3364950b 100644
--- a/ports/samd/machine_i2c.c
+++ b/ports/samd/machine_i2c.c
@@ -26,6 +26,9 @@
*/
#include "py/runtime.h"
+
+#if MICROPY_PY_MACHINE_I2C
+
#include "py/mphal.h"
#include "py/mperrno.h"
#include "extmod/machine_i2c.h"
@@ -274,3 +277,5 @@ MP_DEFINE_CONST_OBJ_TYPE(
protocol, &machine_i2c_p,
locals_dict, &mp_machine_i2c_locals_dict
);
+
+#endif