=====
ICLib
=====
ADC78H89 is a A collection of integrated circuit libraries in pure Python.
Features
--------
- High-level integrated circuit usage.
- Low-level integrated circuit usage.
Installation
------------
.. code-block:: bash
pip install iclib
Usage
-----
Below shows a sample usage of ADC78H89.
.. code-block:: python
from iclib.adc78h89 import ADC78H89
from periphery import SPI
spi = SPI('/dev/spidev0.0', 3, 1e6)
adc78h89 = ADC78H89(spi)
voltages = adc78h89.sample_all()
print(voltages[ADC78H89.InputChannel.AIN1])
print(voltages[ADC78H89.InputChannel.GROUND])
Below shows a sample usage of MCP4161.
.. code-block:: python
from iclib.mcp4161 import MCP4161
from periphery import SPI
spi = SPI('/dev/spidev0.0', 3, 1e6)
mcp4161 = MCP4161(spi)
mcp4161.set_wiper_step(123, True) # eeprom
mcp4161.set_wiper_step(123)
Below shows a sample usage of SN74HCS137.
.. code-block:: python
from time import sleep
from unittest.mock import MagicMock
from periphery import GPIO
from iclib.sn78hcs137 import SN74HCS137
latch_enable_gpio = GPIO('/dev/gpiochip0', 0, 'out', inverted=True)
strobe_input_gpio = GPIO('/dev/gpiochip0', 1, 'out', inverted=True)
address_select_0_gpio = GPIO('/dev/gpiochip0', 2, 'out', inverted=False)
address_select_1_gpio = GPIO('/dev/gpiochip0', 3, 'out', inverted=False)
address_select_2_gpio = GPIO('/dev/gpiochip0', 4, 'out', inverted=False)
sn78hcs137 = SN74HCS137(
latch_enable_gpio,
MagicMock(),
strobe_input_gpio,
address_select_0_gpio,
address_select_1_gpio,
address_select_2_gpio,
)
sn78hcs137.select(SN74HCS137.Address.Y3)
sleep(1)
sn78hcs137.deselect()
Below shows a sample usage of NHD-C12864A1Z-FSW-FBW-HTT.
.. code-block:: python
from time import sleep
from periphery import GPIO, SPI
from iclib.nhd_c12864a1z_fsw_fbw_htt import NHDC12864A1ZFSWFBWHTT
spi = SPI('/dev/spidev0.0', 3, 10e6)
a0 = GPIO('/dev/gpiochip0', 8, 'out')
not_reset = GPIO('/dev/gpiochip0', 9, 'out')
display = NHDC12864A1ZFSWFBWHTT(spi, a0, not_reset)
display.clear_screen()
display.draw_rect(0, 0, 127, 63)
display.set_font('dejavusans.ttf')
display.set_size(8, 14)
display.draw_word('Welcome to Blue Sky solar racing! 12345678910', 2, 2)
display.set_size(16, 16)
display.draw_word('@#$%*^', 1, int(driver.HEIGHT * 0.7))
display.display()
sleep(5)
display.clear_screen()
# Fill screen
for row in range(display.HEIGHT)
for col in range(display.WIDTH)
display.write_pixel(col, row)
display.display()
# Create checkerboard pattern
for row in range(display.HEIGHT)
for col in range(display.WIDTH)
if (row + col) % 2 == 1: # Checker pattern
display.clear_pixel(col, row)
Testing and Validation
----------------------
ICLib has extensive test coverage, passes mypy static type checking with strict
parameter, and has been validated through extensive use in real-life scenarios.
Contributing
------------
Contributions are welcome! Please read our Contributing Guide for more
information.
License
-------
ICLib is distributed under the MIT license.
Raw data
{
"_id": null,
"home_page": "https://github.com/blueskysolarracing/iclib",
"name": "iclib",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "adc78h89, ina229, mcp23s17, mcp4161, microchip technology, newhaven display, nhd-c12864a1z-fsw-fbw-htt, python, sn74hcs137, texas instruments, ti",
"author": "Blue Sky Solar Racing",
"author_email": "blueskysolar@studentorg.utoronto.ca",
"download_url": "https://files.pythonhosted.org/packages/4d/ef/a23190e49e30c51ff695b87251923f3ad802391e97f560e77b3498cfd596/iclib-0.0.0.dev8.tar.gz",
"platform": null,
"description": "=====\nICLib\n=====\n\nADC78H89 is a A collection of integrated circuit libraries in pure Python.\n\nFeatures\n--------\n\n- High-level integrated circuit usage.\n- Low-level integrated circuit usage.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n pip install iclib\n\nUsage\n-----\n\nBelow shows a sample usage of ADC78H89.\n\n.. code-block:: python\n\n from iclib.adc78h89 import ADC78H89\n from periphery import SPI\n\n spi = SPI('/dev/spidev0.0', 3, 1e6)\n adc78h89 = ADC78H89(spi)\n voltages = adc78h89.sample_all()\n\n print(voltages[ADC78H89.InputChannel.AIN1])\n print(voltages[ADC78H89.InputChannel.GROUND])\n\nBelow shows a sample usage of MCP4161.\n\n.. code-block:: python\n\n from iclib.mcp4161 import MCP4161\n from periphery import SPI\n\n spi = SPI('/dev/spidev0.0', 3, 1e6)\n mcp4161 = MCP4161(spi)\n\n mcp4161.set_wiper_step(123, True) # eeprom\n mcp4161.set_wiper_step(123)\n\nBelow shows a sample usage of SN74HCS137.\n\n.. code-block:: python\n\n from time import sleep\n from unittest.mock import MagicMock\n\n from periphery import GPIO\n from iclib.sn78hcs137 import SN74HCS137\n \n latch_enable_gpio = GPIO('/dev/gpiochip0', 0, 'out', inverted=True)\n strobe_input_gpio = GPIO('/dev/gpiochip0', 1, 'out', inverted=True)\n address_select_0_gpio = GPIO('/dev/gpiochip0', 2, 'out', inverted=False)\n address_select_1_gpio = GPIO('/dev/gpiochip0', 3, 'out', inverted=False)\n address_select_2_gpio = GPIO('/dev/gpiochip0', 4, 'out', inverted=False)\n sn78hcs137 = SN74HCS137(\n latch_enable_gpio,\n MagicMock(),\n strobe_input_gpio,\n address_select_0_gpio,\n address_select_1_gpio,\n address_select_2_gpio,\n )\n\n sn78hcs137.select(SN74HCS137.Address.Y3)\n sleep(1)\n sn78hcs137.deselect()\n\nBelow shows a sample usage of NHD-C12864A1Z-FSW-FBW-HTT.\n\n.. code-block:: python\n\n from time import sleep\n\n from periphery import GPIO, SPI\n from iclib.nhd_c12864a1z_fsw_fbw_htt import NHDC12864A1ZFSWFBWHTT \n\n spi = SPI('/dev/spidev0.0', 3, 10e6)\n a0 = GPIO('/dev/gpiochip0', 8, 'out')\n not_reset = GPIO('/dev/gpiochip0', 9, 'out')\n display = NHDC12864A1ZFSWFBWHTT(spi, a0, not_reset)\n\n display.clear_screen()\n\n display.draw_rect(0, 0, 127, 63)\n\n display.set_font('dejavusans.ttf')\n display.set_size(8, 14)\n display.draw_word('Welcome to Blue Sky solar racing! 12345678910', 2, 2)\n display.set_size(16, 16)\n display.draw_word('@#$%*^', 1, int(driver.HEIGHT * 0.7))\n display.display()\n\n sleep(5)\n\n display.clear_screen()\n\n # Fill screen\n for row in range(display.HEIGHT)\n for col in range(display.WIDTH)\n display.write_pixel(col, row)\n\n display.display()\n\n # Create checkerboard pattern\n for row in range(display.HEIGHT)\n for col in range(display.WIDTH)\n if (row + col) % 2 == 1: # Checker pattern\n display.clear_pixel(col, row)\n\nTesting and Validation\n----------------------\n\nICLib has extensive test coverage, passes mypy static type checking with strict\nparameter, and has been validated through extensive use in real-life scenarios.\n\nContributing\n------------\n\nContributions are welcome! Please read our Contributing Guide for more\ninformation.\n\nLicense\n-------\n\nICLib is distributed under the MIT license.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A collection of integrated circuit libraries in pure Python",
"version": "0.0.0.dev8",
"project_urls": {
"Documentation": "https://iclib.readthedocs.io/en/latest/",
"Homepage": "https://github.com/blueskysolarracing/iclib",
"Source": "https://github.com/blueskysolarracing/iclib",
"Tracker": "https://github.com/blueskysolarracing/iclib/issues"
},
"split_keywords": [
"adc78h89",
" ina229",
" mcp23s17",
" mcp4161",
" microchip technology",
" newhaven display",
" nhd-c12864a1z-fsw-fbw-htt",
" python",
" sn74hcs137",
" texas instruments",
" ti"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ccf9cd783856e08782575af19e5d17f2c5d35a12379d015ceb6968cb92f3df32",
"md5": "053a2056b8a0753fa89ab2d05fd52420",
"sha256": "d5f81decf790e7d5f09162ee2586ea879774c52fdf4f528b091afba8672dba58"
},
"downloads": -1,
"filename": "iclib-0.0.0.dev8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "053a2056b8a0753fa89ab2d05fd52420",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 30668,
"upload_time": "2024-07-27T04:46:15",
"upload_time_iso_8601": "2024-07-27T04:46:15.132404Z",
"url": "https://files.pythonhosted.org/packages/cc/f9/cd783856e08782575af19e5d17f2c5d35a12379d015ceb6968cb92f3df32/iclib-0.0.0.dev8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4defa23190e49e30c51ff695b87251923f3ad802391e97f560e77b3498cfd596",
"md5": "332ca8dda2df9b2a4bc0646043ab9550",
"sha256": "1459dc996bd41b847dd61144d247940e3136609294ee6709bc36faf558635f72"
},
"downloads": -1,
"filename": "iclib-0.0.0.dev8.tar.gz",
"has_sig": false,
"md5_digest": "332ca8dda2df9b2a4bc0646043ab9550",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 25392,
"upload_time": "2024-07-27T04:46:16",
"upload_time_iso_8601": "2024-07-27T04:46:16.755163Z",
"url": "https://files.pythonhosted.org/packages/4d/ef/a23190e49e30c51ff695b87251923f3ad802391e97f560e77b3498cfd596/iclib-0.0.0.dev8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-27 04:46:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "blueskysolarracing",
"github_project": "iclib",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "iclib"
}