i2c-microsd-expansion-circuitpython 1.0.13__py3-none-any.whl
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.
- i2c_microsd_expansion_circuitpython-1.0.13.dist-info/METADATA +564 -0
- i2c_microsd_expansion_circuitpython-1.0.13.dist-info/RECORD +9 -0
- i2c_microsd_expansion_circuitpython-1.0.13.dist-info/WHEEL +5 -0
- i2c_microsd_expansion_circuitpython-1.0.13.dist-info/licenses/LICENSE +21 -0
- i2c_microsd_expansion_circuitpython-1.0.13.dist-info/top_level.txt +1 -0
- i2c_microsd_module/__init__.py +63 -0
- i2c_microsd_module/config.py +49 -0
- i2c_microsd_module/module.py +1794 -0
- i2c_microsd_module/protocol.py +114 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 I2C microSD Expansion contributors
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
"""config — host-side settings for I²C microSD Expansion.
|
|
5
|
+
|
|
6
|
+
Timeout scaling: ``timeoutScaled = base * 100000 / scl_hz``, but never
|
|
7
|
+
below ``base`` (the timeout floor is independent of the I2C clock). Ops below
|
|
8
|
+
50 kHz Sm are forced to >= 2x, capped at 120 s.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
DEFAULT_ADDRESS = 0x6E
|
|
12
|
+
|
|
13
|
+
# Bus clock assumed when the host bus does not report its frequency (the
|
|
14
|
+
# library never changes it: the bus belongs to the caller).
|
|
15
|
+
DEFAULT_SCL_HZ = 400000
|
|
16
|
+
|
|
17
|
+
# Host write chunk size. Module buffers are 128 B; 64 B stays inside every
|
|
18
|
+
# CircuitPython I2C transaction buffer (RP2040/nRF/ESP32-S3).
|
|
19
|
+
CHUNK_BYTES = 64
|
|
20
|
+
# Bytes requested per READ drain. The module buffers up to 256 B across
|
|
21
|
+
# both TX buffers; busio sizes transactions per call, but a port that
|
|
22
|
+
# caps a single transfer lower (e.g. nRF at 255) is handled by an
|
|
23
|
+
# automatic 128 B fallback in microSDexp.read().
|
|
24
|
+
READ_CHUNK_BYTES = 256
|
|
25
|
+
|
|
26
|
+
POLL_MS = 10
|
|
27
|
+
FLOW_POLL_MS = 2
|
|
28
|
+
|
|
29
|
+
OP_TIMEOUT_MS = 15000
|
|
30
|
+
COMMIT_TIMEOUT_MS = 30000
|
|
31
|
+
# A FAT rebuild takes tens of seconds on a large card, so format() waits
|
|
32
|
+
# on its own budget instead of OP_TIMEOUT_MS.
|
|
33
|
+
FORMAT_TIMEOUT_MS = 300000
|
|
34
|
+
# CMD_VERSION answers with a fixed 112 B banner buffer.
|
|
35
|
+
VERSION_BANNER_BYTES = 112
|
|
36
|
+
|
|
37
|
+
# Normal LFN path cap. CircuitPython buses buffer at least 128 B, so the
|
|
38
|
+
# full 259-character LFN limit applies here.
|
|
39
|
+
PATH_MAX = 260
|
|
40
|
+
|
|
41
|
+
# Bit-bang frame/script payload per workspace write. One write is the command
|
|
42
|
+
# byte + 3 header bytes (offset LSB, offset MSB, length) + payload, all in a
|
|
43
|
+
# single bus transaction, so 120 stays within every supported host's I2C
|
|
44
|
+
# write buffer. The module workspace is 256 B.
|
|
45
|
+
BITBANG_MAX = 120
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|