File tree Expand file tree Collapse file tree 5 files changed +666
-194
lines changed Expand file tree Collapse file tree 5 files changed +666
-194
lines changed Original file line number Diff line number Diff line change 1
1
"""Contains modules for interfacing with the PSLab's I2C, SPI, and UART buses.
2
2
3
- (SPI and UART still TODO)
3
+ (UART still TODO)
4
4
"""
5
5
6
6
from pslab .bus .i2c import I2CMaster , I2CSlave
7
+ from pslab .bus .spi import SPIMaster , SPISlave
7
8
8
9
__all__ = (
9
10
"I2CMaster" ,
10
11
"I2CSlave" ,
12
+ "SPIMaster" ,
13
+ "SPISlave" ,
11
14
)
Original file line number Diff line number Diff line change 30
30
31
31
from typing import List , Union
32
32
33
- from pslab .bus .i2c import I2CPrimitive
33
+ from pslab .bus .i2c import _I2CPrimitive
34
34
from pslab .serial_handler import SerialHandler
35
35
36
36
__all__ = "I2C"
37
37
ReadableBuffer = Union [bytes , bytearray , memoryview ]
38
38
WriteableBuffer = Union [bytearray , memoryview ]
39
39
40
40
41
- class I2C (I2CPrimitive ):
41
+ class I2C (_I2CPrimitive ):
42
42
"""Busio I2C Class for CircuitPython Compatibility.
43
43
44
44
Parameters
Original file line number Diff line number Diff line change 32
32
logger = logging .getLogger (__name__ )
33
33
34
34
35
- class I2CPrimitive :
35
+ class _I2CPrimitive :
36
36
"""I2C primitive commands.
37
37
38
38
Handles all the I2C subcommands coded in pslab-firmware.
@@ -429,7 +429,7 @@ def _read_bulk(
429
429
return bytearray (data )
430
430
431
431
432
- class I2CMaster (I2CPrimitive ):
432
+ class I2CMaster (_I2CPrimitive ):
433
433
"""I2C bus controller.
434
434
435
435
Handles slave independent functionality with the I2C port.
@@ -480,7 +480,7 @@ def scan(self) -> List[int]:
480
480
return addrs
481
481
482
482
483
- class I2CSlave (I2CPrimitive ):
483
+ class I2CSlave (_I2CPrimitive ):
484
484
"""I2C slave device.
485
485
486
486
Parameters
You can’t perform that action at this time.
0 commit comments