From 50c34129cf8a33735078b15699b154020138011b Mon Sep 17 00:00:00 2001 From: ladyada Date: Fri, 22 Mar 2019 12:42:59 -0400 Subject: [PATCH] add I2C and SPI singletons for some drivers --- src/board.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/board.py b/src/board.py index e13d952..c89fd43 100755 --- a/src/board.py +++ b/src/board.py @@ -78,3 +78,13 @@ elif "sphinx" in sys.modules: else: raise NotImplementedError("Board not supported") + +def I2C(): + """The singleton I2C interface""" + import busio + return busio.I2C(SCL, SDA) + +def SPI(): + """The singleton SPI interface""" + import busio + return busio.SPI(SCLK, MOSI, MISO) -- 2.49.0