Skip to main content

Library to control Flagstaff Research Controller

Project description

Welcome to SMfsrc’s documentation!

Install

sudo pip install SMfsrc

or

sudo pip3 install SMfsrc

Update

sudo pip install SMfsrc -U

or

sudo pip3 install SMfsrc -U

Initiate class

$ python
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import SMfsrc.SMfsrc
>>> fsrc = SMfsrc()
>>>

Documentation

class SMfsrc.SMfsrc(stack=0, i2c=1)

Bases: object

Python class to control the Flagstaff-Research for Raspberry Pi.

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

get_all_digi()

Get all digital inputs status as a bitmask.

  • Returns: (int) Digital bitmask

get_all_fets()

Get all fets state as bitmask.

  • Returns: (int) Fets state bitmask

get_digi(channel)

Get digital input status.

  • Parameters: channel (int) – Channel number
  • Returns: (bool) Channel status

get_digi_counter(channel)

Get digital inputs counter for one channel.

  • Parameters: channel (int) – Channel number
  • Returns: (int) Digi counter

get_digi_edge(channel)

Get digital inputs counting edges status.

  • Parameters: channel (int) – Channel number
  • Returns: (int) Counting edge status : 0(none)/1(rising)/2(falling)/3(both)

get_fet(fet)

Get fet state.

  • Parameters: fet (int) – Fet number
  • Returns: (int) Fet state

get_owb_id(channel)

Get the 64bit ROM ID of the One Wire Bus connected sensor

  • Parameters: channel (int) – Channel number
  • Returns: (int) 64bit ROM ID

get_owb_no()

Get the number of Onw Wire Bus sensors connected

  • Returns: (int) Number of sensors connected

get_owb_scan()

Start One Wire Bus scanning procedure.

get_owb_temp(channel)

Get the temperature from a one wire bus connected sensor.

  • Parameters: channel (int) – Channel number
  • Returns: (float) Temperature read from connected sensor

get_pump(channel)

Get pump value in %.

  • Parameters: channel (int) – Channel number
  • Returns: (float) Pump value in % for specified channel.

get_rtc()

Get rtc time.

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

get_rtd_res(channel)

Get RTD resistance in ohm.

  • Parameters: channel (int) – RTD channel number
  • Returns: (float) RTD resistance value

get_rtd_temp(channel)

Get RTD temperature in Celsius.

  • Parameters: channel (int) – RTD channel number
  • Returns: (float) RTD Celsius value

get_u10_out(channel)

Get 0-10V output channel value in volts.

  • Parameters: channel (int) – Channel number
  • Returns: (float) 0-10V output value

get_u5_in(channel)

Get 0-5V input channel value in volts.

  • Parameters: channel (int) – Channel number
  • Returns: (float) Input value in volts

get_version()

Get firmware version.

Returns: (int) Firmware version number

reset_digi_counter(channel)

Reset digital inputs counter.

  • Parameters: channel (int) – Channel number

set_all_fets(val)

Set all fets states as bitmask.

  • Parameters: val (int) – Fets bitmask

set_digi_edge(channel, value)

Set digital inputs counting edges status.

  • Parameters:
    • channel (int) – Channel number
    • value (int) – Counting edge status 0(none)/1(rising)/2(falling)/3(both)

set_fet(fet, val)

Set fet state.

  • Parameters:
    • fet (int) – Fet number
    • val – 0(OFF) or 1(ON)

set_pump(channel, value)

Set pump value in %.

  • Parameters:
    • channel (int) – Channel number
    • value (float) – Pump value in %

set_pump_prescaler(value)

Set pump prescaler.

  • Parameters: value (int) – Pump prescaler[0..65535]

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

set_u10_out(channel, value)

Set 0-10V output channel value in volts.

  • Parameters:
    • channel (int) – Channel number
    • value (float) – Voltage value

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) Watchfog 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) – Channel number

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SMfsrc-1.0.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SMfsrc-1.0.1-py2.py3-none-any.whl (6.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file SMfsrc-1.0.1.tar.gz.

File metadata

  • Download URL: SMfsrc-1.0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for SMfsrc-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ddb3d7a5f9f4153d64421f7d0700f13c735f579ddf3e186e7395137678d8c43f
MD5 ef98bf18925afc0f32d3ec9339dab225
BLAKE2b-256 466900dc45718de17fd7879dcdd5f9481c983d57e00e8543e54814e7e4bb8abe

See more details on using hashes here.

File details

Details for the file SMfsrc-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: SMfsrc-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for SMfsrc-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5097d1d7f6897e83d1a9a79683a386b262566911a95165d778d505f9048ed1b4
MD5 47d1a5a34b1aa615533dd6f941ad121e
BLAKE2b-256 8141e4175e8110139ad3f77ad6c50914a8d097efc9f5a173845b4bf3a04bddaa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page