SM8crt


NameSM8crt JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://sequentmicrosystems.com
SummaryLibrary to control 8crt Automation Card
upload_time2025-07-19 23:14:14
maintainerNone
docs_urlNone
authorSequent Microsystems
requires_pythonNone
licenseMIT
keywords industrial raspberry power current inputs
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Welcome to SM8crt’s documentation!

# Install

```bash
sudo pip install SM8crt
```

or

```bash
sudo pip3 install SM8crt
```

# Update

```bash
sudo pip install SM8crt -U
```

or

```bash
sudo pip3 install SM8crt -U
```

# Initiate class

```console
$ python
Python 3.11.8 (main, Feb 12 2024, 14:50:05) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import SM8crt
>>> sm = SM8crt.SM8crt()
>>> sm.set_led(2, 1) # Set LED 2 to ON
>>>
```

# Documentation

<a id="module-SM8crt"></a>

### *class* SM8crt.SM8crt(stack=0, i2c=1)

Bases: `object`

Python class to control the 8crt Card for Raspberry Pi.

* **Parameters:**
  * **stack** (*int*) – Stack level/device number.
  * **i2c** (*int*) – i2c bus number

#### cal_crt(channel, value)

Calibrate current readings.
Calibration must be done in 2 points. The further the points are
apart, the more accurate the calibration will be.

* **Parameters:**
  * **channel** (*int*) – Channel number
  * **value** (*int*) – Current(A) value

#### calib_status()

Get current calibration status of device.

* **Returns:**
  (int) Calib status

#### get_all_leds()

Get all leds state as bitmask.

* **Returns:**
  (int) Leds state bitmask

#### get_button()

Get button status.

* **Returns:**
  (bool) status
  : True(ON)/False(OFF)

#### get_button_latch()

Get button latch status.

* **Returns:**
  (bool) status
  : True(ON)/False(OFF)

#### get_crt(channel)

Read the instantenous current(A) of one input channel.

* **Parameters:**
  **channel** (*int*) – Channel number [1..8]
* **Returns:**
  (float) Current value in amperes(A)

#### get_crt_range(channel)

Get the full scale range for a current sensor.

* **Parameters:**
  **channel** (*int*) – Channel number [1..8]
* **Returns:**
  (int) Full scale range in amperes(A)

#### get_crt_rms(channel)

Read the RMS current(A) of one input channel.

* **Parameters:**
  **channel** (*int*) – Channel number [1..8]
* **Returns:**
  (float) RMS current value in amperes(A)

#### get_crt_sensor_type(channel)

Get the type of current sensor.

Type 0 = 2.5V +/- 0.625V
Type 1 = 2.5V +/- 1V

* **Parameters:**
  **channel** (*int*) – Channel number [1..8]
* **Returns:**
  (int) 0 or 1 indicating sensor type

#### get_led(led)

Get led state.

* **Parameters:**
  **led** (*int*) – Led number
* **Returns:**
  0(OFF) or 1(ON)

#### get_rtc()

Get rtc time.

* **Returns:**
  (tuple) date(year, month, day, hour, minute, second)

#### get_version()

Get firmware version.

Returns: (int) Firmware version number

#### set_all_leds(val)

Set all leds states as bitmask.

* **Parameters:**
  **val** (*int*) – Led bitmask

#### set_crt_range(channel, value)

Set the full scale range for a current sensor.

* **Parameters:**
  * **channel** (*int*) – Channel number [1..8]
  * **value** (*int*) – Full scale range in amperes(A) [1..300]

#### set_crt_sensor_type(channel, sensor_type)

Set the type of current sensor.

Type 0 = 2.5V +/- 0.625V
Type 1 = 2.5V +/- 1V

* **Parameters:**
  * **channel** (*int*) – Channel number [1..8]
  * **sensor_type** (*int*) – 0 or 1 indicating sensor type

#### set_led(led, val)

Set led state.

* **Parameters:**
  * **led** (*int*) – Led number
  * **val** – 0(OFF) or 1(ON)

#### set_rtc(year, month, day, hour, minute, second)

Set rtc time.

* **Parameters:**
  * **year** (*int*) – current year
  * **month** (*int*) – current month
  * **day** (*int*) – current day
  * **hour** (*int*) – current hour
  * **minute** (*int*) – current minute
  * **second** (*int*) – current second

#### wdt_clear_reset_count()

Clear watchdog counter.

#### wdt_get_init_period()

Get watchdog initial period.

* **Returns:**
  (int) Initial watchdog period in seconds

#### wdt_get_off_period()

Get watchdog off period in seconds.

* **Returns:**
  (int) Watchdog off period in seconds.

#### wdt_get_period()

Get watchdog period in seconds.

* **Returns:**
  (int) Watchdog period in seconds

#### wdt_get_reset_count()

Get watchdog reset count.

* **Returns:**
  (int) Watchdog reset count

#### wdt_reload()

Reload watchdog.

#### wdt_set_init_period(period)

Set watchdog initial period.

* **Parameters:**
  **period** (*int*) – Initial period in second

#### wdt_set_off_period(period)

Set off period in seconds

* **Parameters:**
  **period** (*int*) – Off period in seconds

#### wdt_set_period(period)

Set watchdog period.

* **Parameters:**
  **period** (*int*) – Watchdog period in seconds

<!-- vi:se ts=4 sw=4 et: -->



            

Raw data

            {
    "_id": null,
    "home_page": "https://sequentmicrosystems.com",
    "name": "SM8crt",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "industrial, raspberry, power, current, inputs",
    "author": "Sequent Microsystems",
    "author_email": "olcitu@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6a/9f/8e468286ce9148be76d32ea0145d8ebb41259a2848f9a3a2c5f7c47a8d5b/SM8crt-0.1.0.tar.gz",
    "platform": null,
    "description": "# Welcome to SM8crt\u2019s documentation!\n\n# Install\n\n```bash\nsudo pip install SM8crt\n```\n\nor\n\n```bash\nsudo pip3 install SM8crt\n```\n\n# Update\n\n```bash\nsudo pip install SM8crt -U\n```\n\nor\n\n```bash\nsudo pip3 install SM8crt -U\n```\n\n# Initiate class\n\n```console\n$ python\nPython 3.11.8 (main, Feb 12 2024, 14:50:05) [GCC 13.2.1 20230801] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import SM8crt\n>>> sm = SM8crt.SM8crt()\n>>> sm.set_led(2, 1) # Set LED 2 to ON\n>>>\n```\n\n# Documentation\n\n<a id=\"module-SM8crt\"></a>\n\n### *class* SM8crt.SM8crt(stack=0, i2c=1)\n\nBases: `object`\n\nPython class to control the 8crt Card for Raspberry Pi.\n\n* **Parameters:**\n  * **stack** (*int*) \u2013 Stack level/device number.\n  * **i2c** (*int*) \u2013 i2c bus number\n\n#### cal_crt(channel, value)\n\nCalibrate current readings.\nCalibration must be done in 2 points. The further the points are\napart, the more accurate the calibration will be.\n\n* **Parameters:**\n  * **channel** (*int*) \u2013 Channel number\n  * **value** (*int*) \u2013 Current(A) value\n\n#### calib_status()\n\nGet current calibration status of device.\n\n* **Returns:**\n  (int) Calib status\n\n#### get_all_leds()\n\nGet all leds state as bitmask.\n\n* **Returns:**\n  (int) Leds state bitmask\n\n#### get_button()\n\nGet button status.\n\n* **Returns:**\n  (bool) status\n  : True(ON)/False(OFF)\n\n#### get_button_latch()\n\nGet button latch status.\n\n* **Returns:**\n  (bool) status\n  : True(ON)/False(OFF)\n\n#### get_crt(channel)\n\nRead the instantenous current(A) of one input channel.\n\n* **Parameters:**\n  **channel** (*int*) \u2013 Channel number [1..8]\n* **Returns:**\n  (float) Current value in amperes(A)\n\n#### get_crt_range(channel)\n\nGet the full scale range for a current sensor.\n\n* **Parameters:**\n  **channel** (*int*) \u2013 Channel number [1..8]\n* **Returns:**\n  (int) Full scale range in amperes(A)\n\n#### get_crt_rms(channel)\n\nRead the RMS current(A) of one input channel.\n\n* **Parameters:**\n  **channel** (*int*) \u2013 Channel number [1..8]\n* **Returns:**\n  (float) RMS current value in amperes(A)\n\n#### get_crt_sensor_type(channel)\n\nGet the type of current sensor.\n\nType 0 = 2.5V +/- 0.625V\nType 1 = 2.5V +/- 1V\n\n* **Parameters:**\n  **channel** (*int*) \u2013 Channel number [1..8]\n* **Returns:**\n  (int) 0 or 1 indicating sensor type\n\n#### get_led(led)\n\nGet led state.\n\n* **Parameters:**\n  **led** (*int*) \u2013 Led number\n* **Returns:**\n  0(OFF) or 1(ON)\n\n#### get_rtc()\n\nGet rtc time.\n\n* **Returns:**\n  (tuple) date(year, month, day, hour, minute, second)\n\n#### get_version()\n\nGet firmware version.\n\nReturns: (int) Firmware version number\n\n#### set_all_leds(val)\n\nSet all leds states as bitmask.\n\n* **Parameters:**\n  **val** (*int*) \u2013 Led bitmask\n\n#### set_crt_range(channel, value)\n\nSet the full scale range for a current sensor.\n\n* **Parameters:**\n  * **channel** (*int*) \u2013 Channel number [1..8]\n  * **value** (*int*) \u2013 Full scale range in amperes(A) [1..300]\n\n#### set_crt_sensor_type(channel, sensor_type)\n\nSet the type of current sensor.\n\nType 0 = 2.5V +/- 0.625V\nType 1 = 2.5V +/- 1V\n\n* **Parameters:**\n  * **channel** (*int*) \u2013 Channel number [1..8]\n  * **sensor_type** (*int*) \u2013 0 or 1 indicating sensor type\n\n#### set_led(led, val)\n\nSet led state.\n\n* **Parameters:**\n  * **led** (*int*) \u2013 Led number\n  * **val** \u2013 0(OFF) or 1(ON)\n\n#### set_rtc(year, month, day, hour, minute, second)\n\nSet rtc time.\n\n* **Parameters:**\n  * **year** (*int*) \u2013 current year\n  * **month** (*int*) \u2013 current month\n  * **day** (*int*) \u2013 current day\n  * **hour** (*int*) \u2013 current hour\n  * **minute** (*int*) \u2013 current minute\n  * **second** (*int*) \u2013 current second\n\n#### wdt_clear_reset_count()\n\nClear watchdog counter.\n\n#### wdt_get_init_period()\n\nGet watchdog initial period.\n\n* **Returns:**\n  (int) Initial watchdog period in seconds\n\n#### wdt_get_off_period()\n\nGet watchdog off period in seconds.\n\n* **Returns:**\n  (int) Watchdog off period in seconds.\n\n#### wdt_get_period()\n\nGet watchdog period in seconds.\n\n* **Returns:**\n  (int) Watchdog period in seconds\n\n#### wdt_get_reset_count()\n\nGet watchdog reset count.\n\n* **Returns:**\n  (int) Watchdog reset count\n\n#### wdt_reload()\n\nReload watchdog.\n\n#### wdt_set_init_period(period)\n\nSet watchdog initial period.\n\n* **Parameters:**\n  **period** (*int*) \u2013 Initial period in second\n\n#### wdt_set_off_period(period)\n\nSet off period in seconds\n\n* **Parameters:**\n  **period** (*int*) \u2013 Off period in seconds\n\n#### wdt_set_period(period)\n\nSet watchdog period.\n\n* **Parameters:**\n  **period** (*int*) \u2013 Watchdog period in seconds\n\n<!-- vi:se ts=4 sw=4 et: -->\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Library to control 8crt Automation Card",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://sequentmicrosystems.com"
    },
    "split_keywords": [
        "industrial",
        " raspberry",
        " power",
        " current",
        " inputs"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b93374936b6e1b48550670163ba5e0da6009059573b4f7f17507e114e6dd1dc",
                "md5": "2f499c01a3cff46811342fdc3689c47f",
                "sha256": "fb19f1afa78a0ec2b5ef817c3699cc93bee75cfa75a28e84c7369ca58cf34174"
            },
            "downloads": -1,
            "filename": "SM8crt-0.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2f499c01a3cff46811342fdc3689c47f",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 10750,
            "upload_time": "2025-07-19T23:14:13",
            "upload_time_iso_8601": "2025-07-19T23:14:13.460464Z",
            "url": "https://files.pythonhosted.org/packages/8b/93/374936b6e1b48550670163ba5e0da6009059573b4f7f17507e114e6dd1dc/SM8crt-0.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a9f8e468286ce9148be76d32ea0145d8ebb41259a2848f9a3a2c5f7c47a8d5b",
                "md5": "44354da2843d5d34e26fcd56ce978943",
                "sha256": "e65d22fa2b07d5539dc3d736909c228f7b687534ade09f4b335629d642f37cf1"
            },
            "downloads": -1,
            "filename": "SM8crt-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "44354da2843d5d34e26fcd56ce978943",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6903,
            "upload_time": "2025-07-19T23:14:14",
            "upload_time_iso_8601": "2025-07-19T23:14:14.918691Z",
            "url": "https://files.pythonhosted.org/packages/6a/9f/8e468286ce9148be76d32ea0145d8ebb41259a2848f9a3a2c5f7c47a8d5b/SM8crt-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-19 23:14:14",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "sm8crt"
}
        
Elapsed time: 2.20144s