alpaca-stubs 0.1.0__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.
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: alpaca-stubs
3
+ Version: 0.1.0
4
+ Summary: Libraries for ALPACA 2.0 - NB2420 Electronic Instrumentation
5
+ License-Expression: CC-BY-4.0
6
+ Requires-Python: >=3.14
7
+ Description-Content-Type: text/markdown
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: alpaca-stubs
3
+ Version: 0.1.0
4
+ Summary: Libraries for ALPACA 2.0 - NB2420 Electronic Instrumentation
5
+ License-Expression: CC-BY-4.0
6
+ Requires-Python: >=3.14
7
+ Description-Content-Type: text/markdown
@@ -0,0 +1,12 @@
1
+ pyproject.toml
2
+ alpaca_stubs.egg-info/PKG-INFO
3
+ alpaca_stubs.egg-info/SOURCES.txt
4
+ alpaca_stubs.egg-info/dependency_links.txt
5
+ alpaca_stubs.egg-info/top_level.txt
6
+ command/__init__.pyi
7
+ dac/__init__.pyi
8
+ dac/driver.pyi
9
+ helper/__init__.pyi
10
+ link/__init__.pyi
11
+ utime/__init__.pyi
12
+ version/__init__.pyi
@@ -0,0 +1,6 @@
1
+ command
2
+ dac
3
+ helper
4
+ link
5
+ utime
6
+ version
@@ -0,0 +1,15 @@
1
+ from _typeshed import Incomplete
2
+
3
+ PING: Incomplete
4
+ LCD_PUTSTR: Incomplete
5
+ SET_PIN: Incomplete
6
+ AWG_R2R_LOAD: Incomplete
7
+ AWG_R2R_START: Incomplete
8
+ AWG_R2R_STOP: Incomplete
9
+ AWG_R2R_OFFSET: Incomplete
10
+ COMMANDS: Incomplete
11
+
12
+ def pack_args(fmt, values):
13
+ """Encode a tuple/list of values per a format string into bytes."""
14
+ def unpack_args(fmt, buf):
15
+ """Decode bytes per a format string into a list of values."""
@@ -0,0 +1,31 @@
1
+ import _thread
2
+ import micropython
3
+ import types
4
+ from _typeshed import Incomplete
5
+ from collections.abc import Callable as Callable
6
+ from dac.driver import MCP4922 as MCP4922
7
+ from machine import Pin as Pin, SPI as SPI
8
+ from typing import Literal
9
+ from utime import sleep_us as sleep_us, ticks_ms as ticks_ms
10
+
11
+ driver: Incomplete
12
+
13
+ class DAC:
14
+ channel: Literal[0, 1]
15
+ gain: Literal[1, 2]
16
+ v_ref: Incomplete
17
+ def __init__(self, channel: Literal['A', 'B'], v_ref: Literal[3000, 2048] = 3000, gain: Literal[1, 2] = 1) -> None: ...
18
+ def write(self, val: float): ...
19
+ def generate(self, generator: Callable[[float], float], frequency_hz: int, N: int = 100): ...
20
+
21
+ class DACWorker:
22
+ sample_period_us: Incomplete
23
+ awg_table: Incomplete
24
+ stop_flag_lock: Incomplete
25
+ def __init__(self, sample_period_us: int, awg_table: memoryview) -> None: ...
26
+ done: Incomplete
27
+ def __enter__(self): ...
28
+ def __exit__(self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
29
+ @micropython.native
30
+ @staticmethod
31
+ def worker(sample_period_us: int, awg_table: memoryview, stop_flag_lock: _thread.LockType, done_lock: _thread.LockType, spi: SPI, cs: Pin, ldac: Pin): ...
@@ -0,0 +1,36 @@
1
+ import micropython
2
+ from _typeshed import Incomplete
3
+ from typing import Literal
4
+
5
+ DAC_12_BIT_LIMIT: Incomplete
6
+
7
+ class MCP4922:
8
+ """
9
+ MCP4922 is a Digital to Analog Converter
10
+
11
+ It operates over SP and has two channels.
12
+
13
+ The 16-bit data is sent over TX (MOSI) Pin and 4-bit is reserved
14
+ for config (see MCP4922.write). The data for indiviual channels
15
+ is kept in the input register.
16
+
17
+ Setting LDAC to low moves inputs from input register to output
18
+ register, which allows both channels to be operated simeltanously.
19
+ """
20
+ spi: Incomplete
21
+ cs: Incomplete
22
+ ldac: Incomplete
23
+ def __init__(self) -> None: ...
24
+ @micropython.native
25
+ def write(self, value: int, channel: Literal[0, 1] = 0, buffered: bool = False, gain: Literal[1, 2] = 1) -> bool:
26
+ """Write a 12-bit value to DAC
27
+ :param channel: 0 for DAC A, 1 for DAC B.
28
+ :param value: Integer from 0 to 4095.
29
+ :param buffered: True to use VREF buffer, False for unbuffered.
30
+ :param gain: 1x or 2x output gain
31
+
32
+ :returns: whether the data was actually sent to DAC
33
+ """
34
+ @micropython.native
35
+ def push(self) -> None:
36
+ """Move input register to output"""
@@ -0,0 +1,18 @@
1
+ from _typeshed import Incomplete
2
+
3
+ link: Incomplete
4
+
5
+ def ping(): ...
6
+ def set_screen_text(text_up: str = '', text_down: str = ''): ...
7
+ def awg_r2r(samples, sample_rate_hz):
8
+ """Play a waveform on the Helper's R-2R ladder DAC (GPIO0-9).
9
+
10
+ samples: iterable of 10-bit codes (0-1023, values are masked), looped
11
+ forever. sample_rate_hz: requested playback rate; returns the actual
12
+ rate achieved, which is lower if the requested rate is too fast.
13
+ """
14
+ def awg_r2r_stop():
15
+ """Stop the AWG and drive the ladder to 0."""
16
+ def awg_r2r_offset(magnitude, negative: bool = False):
17
+ """Set the analog offset stage: magnitude 0.0-1.0 (PWM duty on
18
+ OFFSET_PWM), negative selects the sign via OFFSET_POL."""
@@ -0,0 +1,21 @@
1
+ import micropython
2
+ from _typeshed import Incomplete
3
+
4
+ OK: Incomplete
5
+ ERR: Incomplete
6
+
7
+ class Link:
8
+ uart: Incomplete
9
+ timeout_ms: Incomplete
10
+ handlers: Incomplete
11
+ event_loop: Incomplete
12
+ event_times: Incomplete
13
+ def __init__(self, uart, timeout_ms: int = 1000) -> None: ...
14
+ @micropython.native
15
+ def call(self, opcode, *args):
16
+ """Send a request and block for the reply. Returns the decoded
17
+ result or raises RuntimeError on an ERR reply."""
18
+ def register(self, opcode): ...
19
+ def event(self, func): ...
20
+ @micropython.native
21
+ def serve(self) -> None: ...
@@ -0,0 +1,22 @@
1
+ [project]
2
+ name = "alpaca-stubs"
3
+ version = "0.1.0"
4
+ description = "Libraries for ALPACA 2.0 - NB2420 Electronic Instrumentation"
5
+ readme = "README.md"
6
+ requires-python = ">=3.14"
7
+ license = "CC-BY-4.0"
8
+
9
+ [build-system]
10
+ requires = [ "setuptools>=61",]
11
+ build-backend = "setuptools.build_meta"
12
+
13
+ [tool.setuptools]
14
+ packages = [ "dac", "version", "link", "helper", "command", "utime",]
15
+
16
+ [tool.setuptools.package-data]
17
+ dac = [ "*.pyi",]
18
+ version = [ "*.pyi",]
19
+ link = [ "*.pyi",]
20
+ helper = [ "*.pyi",]
21
+ command = [ "*.pyi",]
22
+ utime = [ "*.pyi",]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,11 @@
1
+ from typing import Any
2
+
3
+ def sleep(seconds: float) -> None: ...
4
+ def sleep_ms(ms: int) -> None: ...
5
+ def sleep_us(us: int) -> None: ...
6
+
7
+ # Include any other native time elements you use so they don't break
8
+ def ticks_ms() -> int: ...
9
+ def ticks_diff(ticks1: int, ticks2: int) -> int: ...
10
+ def ticks_add(ticks1: int, ticks2: int) -> int: ...
11
+ def ticks_us() -> int: ...
@@ -0,0 +1 @@
1
+ ALPACA_FW_VER: str