Skip to content

Commit 0b7816c

Browse files
committed
re-export classes to package-level; extract constants common to both ads modules to the generic adsx module
1 parent a40a311 commit 0b7816c

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

adafruit_ads1x15/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2018 Carter Nelson for Adafruit Industries
2+
# SPDX-FileCopyrightText: 2025 Asadullah Shaikh <github.com/pantheraleo-7>
3+
#
4+
# SPDX-License-Identifier: MIT
5+
6+
"""
7+
`adafruit_ads1x15`
8+
====================================================
9+
10+
Support for the ADS1x15 series of analog-to-digital converters.
11+
12+
* Author(s): Carter Nelson
13+
"""
14+
15+
from .ads1015 import ADS1015
16+
from .ads1115 import ADS1115
17+
from .analog_in import AnalogIn
18+
19+
__all__ = ["ADS1015", "ADS1115", "AnalogIn"]

adafruit_ads1x15/ads1015.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
* Author(s): Carter Nelson
1212
"""
13+
1314
import struct
1415

1516
try:
@@ -33,16 +34,6 @@
3334
3300: 0x00C0,
3435
}
3536

36-
# Pins
37-
P0 = 0
38-
"""Analog Pin 0"""
39-
P1 = 1
40-
"""Analog Pin 1"""
41-
P2 = 2
42-
"""Analog Pin 2"""
43-
P3 = 3
44-
"""Analog Pin 3"""
45-
4637

4738
class ADS1015(ADS1x15):
4839
"""Class for the ADS1015 12 bit ADC."""

adafruit_ads1x15/ads1115.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
* Author(s): Carter Nelson
1212
"""
13+
1314
import struct
1415

1516
try:
@@ -34,16 +35,6 @@
3435
860: 0x00E0,
3536
}
3637

37-
# Pins
38-
P0 = 0
39-
"""Analog Pin 0"""
40-
P1 = 1
41-
"""Analog Pin 1"""
42-
P2 = 2
43-
"""Analog Pin 2"""
44-
P3 = 3
45-
"""Analog Pin 3"""
46-
4738

4839
class ADS1115(ADS1x15):
4940
"""Class for the ADS1115 16 bit ADC."""

adafruit_ads1x15/ads1x15.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@
5353
16: 0x0A00,
5454
}
5555

56+
# Pins
57+
A0 = 0
58+
"""Analog Pin 0"""
59+
A1 = 1
60+
"""Analog Pin 1"""
61+
A2 = 2
62+
"""Analog Pin 2"""
63+
A3 = 3
64+
"""Analog Pin 3"""
65+
5666

5767
class Mode:
5868
"""An enum-like class representing possible ADC operating modes."""

0 commit comments

Comments
 (0)