]> Repositories - Adafruit_Blinka-hackapet.git/blob - src/neopixel_write.py
Merge pull request #343 from makermelissa/stm32mp1
[Adafruit_Blinka-hackapet.git] / src / neopixel_write.py
1 """
2 `neopixel_write` - NeoPixel precision timed writing support
3 =================================================
4
5 See `CircuitPython:neopixel_write` in CircuitPython for more details.
6
7 * Author(s): ladyada
8 """
9
10 import sys
11
12 from adafruit_blinka.agnostic import detector
13
14 if detector.board.any_raspberry_pi:
15     from adafruit_blinka.microcontroller.bcm283x import neopixel as _neopixel
16 elif "sphinx" in sys.modules:
17     pass
18 else:
19     raise NotImplementedError("Board not supported")
20
21
22 def neopixel_write(gpio, buf):
23     """Write buf out on the given DigitalInOut."""
24     return _neopixel.neopixel_write(gpio, buf)