|
11 | 11 |
|
12 | 12 | from micropython import const
|
13 | 13 | from adafruit_bus_device import spi_device
|
14 |
| -from digitalio import DigitalInOut # Needed for type annotation |
15 |
| -from busio import SPI # Needed for type annotation |
| 14 | + |
16 | 15 |
|
17 | 16 | try:
|
| 17 | + """Needed for type annotations""" |
18 | 18 | from typing import Any, List
|
| 19 | + from digitalio import DigitalInOut |
| 20 | + from busio import SPI |
19 | 21 | except ImportError:
|
20 | 22 | pass
|
21 | 23 |
|
@@ -96,11 +98,11 @@ def read16(self, addr: int, reg: int = SRAM_READ):
|
96 | 98 | buf = self.read(addr, 2, reg)
|
97 | 99 | return buf[0] << 8 | buf[1]
|
98 | 100 |
|
99 |
| - def write8(self, addr: int, value: Any, reg: int = SRAM_WRITE): |
| 101 | + def write8(self, addr: int, value: int, reg: int = SRAM_WRITE): |
100 | 102 | """write a single byte at the passed address"""
|
101 | 103 | self.write(addr, [value], reg)
|
102 | 104 |
|
103 |
| - def write16(self, addr: int, value: Any, reg: int = SRAM_WRITE): |
| 105 | + def write16(self, addr: int, value: int, reg: int = SRAM_WRITE): |
104 | 106 | """write 2 bytes at the passed address"""
|
105 | 107 | self.write(addr, [value >> 8, value], reg)
|
106 | 108 |
|
|
0 commit comments