periph 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. periph-1.2.1/PKG-INFO +113 -0
  2. periph-1.2.1/README.md +105 -0
  3. periph-1.2.1/periph/__init__.py +1 -0
  4. periph-1.2.1/periph/chips/accelerometer/adxl345.py +524 -0
  5. periph-1.2.1/periph/chips/accelerometer/adxl362.py +704 -0
  6. periph-1.2.1/periph/chips/adc_dac/ad7705.py +476 -0
  7. periph-1.2.1/periph/chips/adc_dac/ad7706.py +495 -0
  8. periph-1.2.1/periph/chips/adc_dac/hx710a.py +187 -0
  9. periph-1.2.1/periph/chips/adc_dac/hx710b.py +189 -0
  10. periph-1.2.1/periph/chips/adc_dac/hx711.py +170 -0
  11. periph-1.2.1/periph/chips/adc_dac/mcp4725.py +167 -0
  12. periph-1.2.1/periph/chips/adc_dac/mcp4728.py +317 -0
  13. periph-1.2.1/periph/chips/adc_dac/pcf8591.py +199 -0
  14. periph-1.2.1/periph/chips/comms/mcp2515.py +651 -0
  15. periph-1.2.1/periph/chips/comms/rda5807m.py +420 -0
  16. periph-1.2.1/periph/chips/comms/rfm9x.py +594 -0
  17. periph-1.2.1/periph/chips/display/pcf8576.py +223 -0
  18. periph-1.2.1/periph/chips/environmental/aht21.py +150 -0
  19. periph-1.2.1/periph/chips/environmental/bme280.py +384 -0
  20. periph-1.2.1/periph/chips/environmental/bme680.py +501 -0
  21. periph-1.2.1/periph/chips/gas/ens160.py +273 -0
  22. periph-1.2.1/periph/chips/gnss/neo6.py +439 -0
  23. periph-1.2.1/periph/chips/gyroscope/l3g4200d.py +448 -0
  24. periph-1.2.1/periph/chips/gyroscope/l3gd20h.py +337 -0
  25. periph-1.2.1/periph/chips/humidity/dht11.py +123 -0
  26. periph-1.2.1/periph/chips/imu/mpu6050.py +251 -0
  27. periph-1.2.1/periph/chips/imu/mpu9250.py +378 -0
  28. periph-1.2.1/periph/chips/imu/mpu9255.py +434 -0
  29. periph-1.2.1/periph/chips/io_expander/mcp23017.py +494 -0
  30. periph-1.2.1/periph/chips/io_expander/pcf8574.py +401 -0
  31. periph-1.2.1/periph/chips/io_expander/pcf8575.py +420 -0
  32. periph-1.2.1/periph/chips/io_expander/tpic6b595.py +271 -0
  33. periph-1.2.1/periph/chips/led/_color.py +23 -0
  34. periph-1.2.1/periph/chips/led/_neopixel_rgb_base.py +175 -0
  35. periph-1.2.1/periph/chips/led/_neopixel_rgbw_base.py +193 -0
  36. periph-1.2.1/periph/chips/led/apa102.py +200 -0
  37. periph-1.2.1/periph/chips/led/sk6812rgbw.py +52 -0
  38. periph-1.2.1/periph/chips/led/ws2812b.py +46 -0
  39. periph-1.2.1/periph/chips/led/ws2814.py +52 -0
  40. periph-1.2.1/periph/chips/light/apds9960.py +496 -0
  41. periph-1.2.1/periph/chips/light/apds_9930.py +364 -0
  42. periph-1.2.1/periph/chips/magnetometer/as5600.py +290 -0
  43. periph-1.2.1/periph/chips/magnetometer/hmc5883l.py +210 -0
  44. periph-1.2.1/periph/chips/memory/_24aa02uid.py +175 -0
  45. periph-1.2.1/periph/chips/motor/drv8830.py +236 -0
  46. periph-1.2.1/periph/chips/other/mpr121.py +465 -0
  47. periph-1.2.1/periph/chips/power/ade7953.py +1196 -0
  48. periph-1.2.1/periph/chips/power/ina219.py +195 -0
  49. periph-1.2.1/periph/chips/power/ina226.py +217 -0
  50. periph-1.2.1/periph/chips/power/ina3221.py +359 -0
  51. periph-1.2.1/periph/chips/pressure/bmp085.py +234 -0
  52. periph-1.2.1/periph/chips/pressure/bmp180.py +234 -0
  53. periph-1.2.1/periph/chips/pressure/bmp280.py +292 -0
  54. periph-1.2.1/periph/chips/pressure/bmp384.py +471 -0
  55. periph-1.2.1/periph/chips/pressure/bmp581.py +561 -0
  56. periph-1.2.1/periph/chips/pressure/lps22df.py +394 -0
  57. periph-1.2.1/periph/chips/pressure/lps28dfw.py +337 -0
  58. periph-1.2.1/periph/chips/pressure/lps33hw.py +385 -0
  59. periph-1.2.1/periph/chips/rfid/mfrc522.py +818 -0
  60. periph-1.2.1/periph/chips/rtc/ds3231.py +522 -0
  61. periph-1.2.1/periph/chips/rtc/pcf8523.py +549 -0
  62. periph-1.2.1/periph/chips/temperature/mcp9808.py +453 -0
  63. periph-1.2.1/periph/chips/temperature/tmp117.py +461 -0
  64. periph-1.2.1/periph/chips/tof/_vl53_base.py +174 -0
  65. periph-1.2.1/periph/chips/tof/vl53l0x.py +816 -0
  66. periph-1.2.1/periph/chips/tof/vl53l1x.py +815 -0
  67. periph-1.2.1/periph/connection/__init__.py +31 -0
  68. periph-1.2.1/periph/connection/base.py +103 -0
  69. periph-1.2.1/periph/connection/dhtxx_auto.py +52 -0
  70. periph-1.2.1/periph/connection/dhtxx_circuitpython.py +138 -0
  71. periph-1.2.1/periph/connection/dhtxx_linux.py +230 -0
  72. periph-1.2.1/periph/connection/dhtxx_micropython.py +133 -0
  73. periph-1.2.1/periph/connection/dhtxx_mock.py +34 -0
  74. periph-1.2.1/periph/connection/hx711_auto.py +66 -0
  75. periph-1.2.1/periph/connection/hx711_circuitpython.py +114 -0
  76. periph-1.2.1/periph/connection/hx711_linux.py +121 -0
  77. periph-1.2.1/periph/connection/hx711_micropython.py +113 -0
  78. periph-1.2.1/periph/connection/hx711_mock.py +43 -0
  79. periph-1.2.1/periph/connection/i2c_auto.py +54 -0
  80. periph-1.2.1/periph/connection/i2c_circuitpython.py +84 -0
  81. periph-1.2.1/periph/connection/i2c_linux.py +81 -0
  82. periph-1.2.1/periph/connection/i2c_micropython.py +65 -0
  83. periph-1.2.1/periph/connection/i2c_mock.py +57 -0
  84. periph-1.2.1/periph/connection/input_pin.py +259 -0
  85. periph-1.2.1/periph/connection/neo6_mock.py +36 -0
  86. periph-1.2.1/periph/connection/neopixel_auto.py +75 -0
  87. periph-1.2.1/periph/connection/neopixel_circuitpython.py +44 -0
  88. periph-1.2.1/periph/connection/neopixel_linux.py +47 -0
  89. periph-1.2.1/periph/connection/neopixel_micropython.py +38 -0
  90. periph-1.2.1/periph/connection/output_pin.py +81 -0
  91. periph-1.2.1/periph/connection/sipo_circuitpython.py +119 -0
  92. periph-1.2.1/periph/connection/sipo_linux.py +149 -0
  93. periph-1.2.1/periph/connection/sipo_micropython.py +104 -0
  94. periph-1.2.1/periph/connection/smbus_auto.py +68 -0
  95. periph-1.2.1/periph/connection/smbus_circuitpython.py +118 -0
  96. periph-1.2.1/periph/connection/smbus_linux.py +119 -0
  97. periph-1.2.1/periph/connection/smbus_micropython.py +100 -0
  98. periph-1.2.1/periph/connection/spi_auto.py +79 -0
  99. periph-1.2.1/periph/connection/spi_circuitpython.py +97 -0
  100. periph-1.2.1/periph/connection/spi_linux.py +66 -0
  101. periph-1.2.1/periph/connection/spi_micropython.py +64 -0
  102. periph-1.2.1/periph/connection/spi_mock.py +96 -0
  103. periph-1.2.1/periph/connection/uart_auto.py +76 -0
  104. periph-1.2.1/periph/connection/uart_circuitpython.py +81 -0
  105. periph-1.2.1/periph/connection/uart_linux.py +120 -0
  106. periph-1.2.1/periph/connection/uart_micropython.py +81 -0
  107. periph-1.2.1/periph.egg-info/PKG-INFO +113 -0
  108. periph-1.2.1/periph.egg-info/SOURCES.txt +110 -0
  109. periph-1.2.1/periph.egg-info/dependency_links.txt +1 -0
  110. periph-1.2.1/periph.egg-info/top_level.txt +1 -0
  111. periph-1.2.1/pyproject.toml +15 -0
  112. periph-1.2.1/setup.cfg +4 -0
periph-1.2.1/PKG-INFO ADDED
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: periph
3
+ Version: 1.2.1
4
+ Summary: Peripheral chip drivers for MicroPython, CircuitPython, and Linux
5
+ License: MIT
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+
9
+ # periph
10
+
11
+ Peripheral chip drivers for MicroPython, CircuitPython, and Linux
12
+
13
+ - **Three targets** — MicroPython, CircuitPython, and Linux (`/dev/i2c-N` via `smbus2`)
14
+ - **Same driver code everywhere** — only the connection class changes per platform
15
+ - **Two-tier API** — `*Minimal` for the primary use case, `*Full` for complete chip functionality
16
+
17
+ ## Install
18
+
19
+ ```sh
20
+ pip install periph
21
+ ```
22
+
23
+ On MicroPython/CircuitPython, copy the `periph/` package onto the device's filesystem (or freeze it into the firmware) instead.
24
+
25
+ ## Example
26
+
27
+ ```python
28
+ from periph.connection.i2c_auto import I2CConnection
29
+ from periph.chips.power.ina226 import INA226Minimal
30
+ import time
31
+
32
+ connection = I2CConnection(0x40)
33
+ ina = INA226Minimal(connection)
34
+
35
+ while True:
36
+ print(ina.voltage(), ina.current(), ina.power())
37
+ time.sleep(1)
38
+ ```
39
+
40
+ `I2CConnection` above resolves to the right platform implementation automatically (MicroPython `machine.I2C`, CircuitPython `busio.I2C`, or Linux `/dev/i2c-N`).
41
+
42
+ Each chip exposes two classes:
43
+
44
+ - `*Minimal` — primary use case, works out of the box with sensible defaults
45
+ - `*Full` — complete chip functionality, extends Minimal
46
+
47
+ ## Supported chips
48
+
49
+ | Chip | Category | Description |
50
+ |------|----------|-------------|
51
+ | 24AA02UID | Memory | 2K I2C EEPROM with 32-bit unique serial number |
52
+ | AD7705 | ADC/DAC | 2-channel, 16-bit sigma-delta ADC |
53
+ | AD7706 | ADC/DAC | 3-channel, 16-bit sigma-delta ADC |
54
+ | ADE7953 | Power monitor | Single-phase metering IC |
55
+ | ADXL345 | Accelerometer | 3-axis accelerometer |
56
+ | ADXL362 | Accelerometer | Read X, Y, Z acceleration in *g*. |
57
+ | AHT21 | Environmental sensor | Temperature and humidity sensor |
58
+ | APA102 | LED driver | Addressable RGB LED strip |
59
+ | APDS-9930 | Light sensor | Ambient light and proximity sensor |
60
+ | APDS9960 | Light sensor | APDS-9960 digital proximity, ambient light, RGB and gesture sensor |
61
+ | AS5600 | Magnetometer | 12-bit programmable contactless rotary position sensor |
62
+ | BME280 | Environmental sensor | Combined humidity + pressure + temperature sensor |
63
+ | BME680 | Environmental sensor | 4-in-1 environmental sensor: temperature, pressure, humidity, gas resistance. |
64
+ | BMP085 | Pressure sensor | Piezo-resistive pressure + temperature sensor |
65
+ | BMP180 | Pressure sensor | Piezo-resistive pressure + temperature sensor |
66
+ | BMP280 | Pressure sensor | Piezo-resistive pressure + temperature sensor |
67
+ | BMP384 | Pressure sensor | High-precision barometric pressure and temperature sensor |
68
+ | BMP581 | Pressure sensor | MEMS barometric pressure + temperature sensor |
69
+ | DHT11 | Humidity sensor | Combined temperature and humidity sensor |
70
+ | DRV8830 | Motor driver | Low-voltage motor driver |
71
+ | DS3231 | RTC | Extremely accurate I2C RTC/TCXO/crystal |
72
+ | ENS160 | Gas sensor | Digital multi-gas sensor |
73
+ | HMC5883L | Magnetometer | 3-axis magnetometer |
74
+ | HX710A | ADC/DAC | 24-bit ADC |
75
+ | HX710B | ADC/DAC | 24-bit ADC |
76
+ | HX711 | ADC/DAC | 24-bit ADC |
77
+ | INA219 | Power monitor | 26V, 12-bit current/voltage/power monitor |
78
+ | INA226 | Power monitor | 36V, 16-bit current/voltage/power monitor |
79
+ | INA3221 | Power monitor | Three-channel 26V current/voltage/power monitor |
80
+ | L3G4200D | Gyroscope | Three-axis MEMS gyroscope |
81
+ | L3GD20H | Gyroscope | (and L3GD20) three-axis MEMS gyroscope |
82
+ | LPS22DF | Pressure sensor | Absolute pressure and temperature sensor |
83
+ | LPS28DFW | Pressure sensor | Dual full-scale digital barometer |
84
+ | LPS33HW | Pressure sensor | Water-resistant MEMS absolute pressure sensor |
85
+ | MCP23017 | IO expander | 16-bit I/O port expander |
86
+ | MCP2515 | Comms | Send/recv with default configuration. |
87
+ | MCP4725 | ADC/DAC | Single-channel 12-bit voltage-output DAC |
88
+ | MCP4728 | ADC/DAC | Quad-channel 12-bit voltage-output DAC |
89
+ | MCP9808 | Temperature sensor | ±0.5°C maximum accuracy digital temperature sensor |
90
+ | MFRC522 | RFID/NFC | 13.56 MHz RFID/NFC reader |
91
+ | MPR121 | Other | Capacitive touch controller |
92
+ | MPU-6050 | IMU | 6-axis MotionTracking device (accelerometer + gyroscope) |
93
+ | MPU-9250 | IMU | 9-axis MotionTracking device (accelerometer + gyroscope) |
94
+ | MPU-9255 | IMU | 9-axis MotionTracking device (accelerometer + gyroscope) |
95
+ | NEO-6 | GNSS/GPS | U-blox NEO-6 GNSS receiver: NMEA position, altitude, and fix status. |
96
+ | PCF8523 | RTC | Low-power I2C real-time clock |
97
+ | PCF8574 | IO expander | 8-bit quasi-bidirectional I/O port expander |
98
+ | PCF8575 | IO expander | 16-bit quasi-bidirectional I/O port expander |
99
+ | PCF8576 | Display driver | 40x4 universal LCD segment driver |
100
+ | PCF8591 | ADC/DAC | 8-bit quad ADC + DAC |
101
+ | RDA5807M | Comms | Single-chip FM stereo radio tuner |
102
+ | RFM9x | Comms | 868/915 MHz HF band, max SF=12. |
103
+ | SK6812RGBW | LED driver | Addressable RGBW LED strip |
104
+ | TMP117 | Temperature sensor | ±0.1°C high-accuracy digital temperature sensor |
105
+ | TPIC6B595 | IO expander | 8-bit power SIPO shift register |
106
+ | VL53L0X | Time-of-flight | Time-of-Flight ranging sensor |
107
+ | VL53L1X | Time-of-flight | Time-of-Flight ranging sensor |
108
+ | WS2812B | LED driver | Addressable RGB LED strip |
109
+ | WS2814 | LED driver | Addressable RGBW LED strip |
110
+
111
+ ## Links
112
+
113
+ - [GitHub](https://github.com/tuhde/Periph)
periph-1.2.1/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # periph
2
+
3
+ Peripheral chip drivers for MicroPython, CircuitPython, and Linux
4
+
5
+ - **Three targets** — MicroPython, CircuitPython, and Linux (`/dev/i2c-N` via `smbus2`)
6
+ - **Same driver code everywhere** — only the connection class changes per platform
7
+ - **Two-tier API** — `*Minimal` for the primary use case, `*Full` for complete chip functionality
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ pip install periph
13
+ ```
14
+
15
+ On MicroPython/CircuitPython, copy the `periph/` package onto the device's filesystem (or freeze it into the firmware) instead.
16
+
17
+ ## Example
18
+
19
+ ```python
20
+ from periph.connection.i2c_auto import I2CConnection
21
+ from periph.chips.power.ina226 import INA226Minimal
22
+ import time
23
+
24
+ connection = I2CConnection(0x40)
25
+ ina = INA226Minimal(connection)
26
+
27
+ while True:
28
+ print(ina.voltage(), ina.current(), ina.power())
29
+ time.sleep(1)
30
+ ```
31
+
32
+ `I2CConnection` above resolves to the right platform implementation automatically (MicroPython `machine.I2C`, CircuitPython `busio.I2C`, or Linux `/dev/i2c-N`).
33
+
34
+ Each chip exposes two classes:
35
+
36
+ - `*Minimal` — primary use case, works out of the box with sensible defaults
37
+ - `*Full` — complete chip functionality, extends Minimal
38
+
39
+ ## Supported chips
40
+
41
+ | Chip | Category | Description |
42
+ |------|----------|-------------|
43
+ | 24AA02UID | Memory | 2K I2C EEPROM with 32-bit unique serial number |
44
+ | AD7705 | ADC/DAC | 2-channel, 16-bit sigma-delta ADC |
45
+ | AD7706 | ADC/DAC | 3-channel, 16-bit sigma-delta ADC |
46
+ | ADE7953 | Power monitor | Single-phase metering IC |
47
+ | ADXL345 | Accelerometer | 3-axis accelerometer |
48
+ | ADXL362 | Accelerometer | Read X, Y, Z acceleration in *g*. |
49
+ | AHT21 | Environmental sensor | Temperature and humidity sensor |
50
+ | APA102 | LED driver | Addressable RGB LED strip |
51
+ | APDS-9930 | Light sensor | Ambient light and proximity sensor |
52
+ | APDS9960 | Light sensor | APDS-9960 digital proximity, ambient light, RGB and gesture sensor |
53
+ | AS5600 | Magnetometer | 12-bit programmable contactless rotary position sensor |
54
+ | BME280 | Environmental sensor | Combined humidity + pressure + temperature sensor |
55
+ | BME680 | Environmental sensor | 4-in-1 environmental sensor: temperature, pressure, humidity, gas resistance. |
56
+ | BMP085 | Pressure sensor | Piezo-resistive pressure + temperature sensor |
57
+ | BMP180 | Pressure sensor | Piezo-resistive pressure + temperature sensor |
58
+ | BMP280 | Pressure sensor | Piezo-resistive pressure + temperature sensor |
59
+ | BMP384 | Pressure sensor | High-precision barometric pressure and temperature sensor |
60
+ | BMP581 | Pressure sensor | MEMS barometric pressure + temperature sensor |
61
+ | DHT11 | Humidity sensor | Combined temperature and humidity sensor |
62
+ | DRV8830 | Motor driver | Low-voltage motor driver |
63
+ | DS3231 | RTC | Extremely accurate I2C RTC/TCXO/crystal |
64
+ | ENS160 | Gas sensor | Digital multi-gas sensor |
65
+ | HMC5883L | Magnetometer | 3-axis magnetometer |
66
+ | HX710A | ADC/DAC | 24-bit ADC |
67
+ | HX710B | ADC/DAC | 24-bit ADC |
68
+ | HX711 | ADC/DAC | 24-bit ADC |
69
+ | INA219 | Power monitor | 26V, 12-bit current/voltage/power monitor |
70
+ | INA226 | Power monitor | 36V, 16-bit current/voltage/power monitor |
71
+ | INA3221 | Power monitor | Three-channel 26V current/voltage/power monitor |
72
+ | L3G4200D | Gyroscope | Three-axis MEMS gyroscope |
73
+ | L3GD20H | Gyroscope | (and L3GD20) three-axis MEMS gyroscope |
74
+ | LPS22DF | Pressure sensor | Absolute pressure and temperature sensor |
75
+ | LPS28DFW | Pressure sensor | Dual full-scale digital barometer |
76
+ | LPS33HW | Pressure sensor | Water-resistant MEMS absolute pressure sensor |
77
+ | MCP23017 | IO expander | 16-bit I/O port expander |
78
+ | MCP2515 | Comms | Send/recv with default configuration. |
79
+ | MCP4725 | ADC/DAC | Single-channel 12-bit voltage-output DAC |
80
+ | MCP4728 | ADC/DAC | Quad-channel 12-bit voltage-output DAC |
81
+ | MCP9808 | Temperature sensor | ±0.5°C maximum accuracy digital temperature sensor |
82
+ | MFRC522 | RFID/NFC | 13.56 MHz RFID/NFC reader |
83
+ | MPR121 | Other | Capacitive touch controller |
84
+ | MPU-6050 | IMU | 6-axis MotionTracking device (accelerometer + gyroscope) |
85
+ | MPU-9250 | IMU | 9-axis MotionTracking device (accelerometer + gyroscope) |
86
+ | MPU-9255 | IMU | 9-axis MotionTracking device (accelerometer + gyroscope) |
87
+ | NEO-6 | GNSS/GPS | U-blox NEO-6 GNSS receiver: NMEA position, altitude, and fix status. |
88
+ | PCF8523 | RTC | Low-power I2C real-time clock |
89
+ | PCF8574 | IO expander | 8-bit quasi-bidirectional I/O port expander |
90
+ | PCF8575 | IO expander | 16-bit quasi-bidirectional I/O port expander |
91
+ | PCF8576 | Display driver | 40x4 universal LCD segment driver |
92
+ | PCF8591 | ADC/DAC | 8-bit quad ADC + DAC |
93
+ | RDA5807M | Comms | Single-chip FM stereo radio tuner |
94
+ | RFM9x | Comms | 868/915 MHz HF band, max SF=12. |
95
+ | SK6812RGBW | LED driver | Addressable RGBW LED strip |
96
+ | TMP117 | Temperature sensor | ±0.1°C high-accuracy digital temperature sensor |
97
+ | TPIC6B595 | IO expander | 8-bit power SIPO shift register |
98
+ | VL53L0X | Time-of-flight | Time-of-Flight ranging sensor |
99
+ | VL53L1X | Time-of-flight | Time-of-Flight ranging sensor |
100
+ | WS2812B | LED driver | Addressable RGB LED strip |
101
+ | WS2814 | LED driver | Addressable RGBW LED strip |
102
+
103
+ ## Links
104
+
105
+ - [GitHub](https://github.com/tuhde/Periph)
@@ -0,0 +1 @@
1
+ from .connection import Connection