Skip to main content

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

Local Installation

git clone https://github.com/SequentMicrosystems/fsrc-rpi.git
cd ~/fsrc-rpi/python
sudo python setup.py install

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
>>> fsrc = SMfsrc.SMfsrc()
>>> fsrc.get_digi(1)
>>>

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

Metadata

Release files for smfsrc 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smfsrc 1.0.2
File Size Uploaded
smfsrc-1.0.2.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smfsrc 1.0.2
File Interpreter ABI Platform
smfsrc-1.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 14.2 kB

Release files / smfsrc-1.0.2.tar.gz

Download URL smfsrc-1.0.2.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e07f8f7b20c6c7edcd811b4856bdccbe76514226af155cf9f2445c3fcf45dd28
BLAKE2b-256 checksum
How to use checksums
bcc485b25aa23e8dcc548765d9e720dd14160abcee5852cda4cae2747932162a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.2

Release files / smfsrc-1.0.2-py2.py3-none-any.whl

Download URL smfsrc-1.0.2-py2.py3-none-any.whl
Size 6.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
eab6cb19128289d00c978e0e7bb36af86900d8dab92958d62d87c6e4f8587ffa
BLAKE2b-256 checksum
How to use checksums
cf1de826f1de4cb9f0eac023cea0206fc6b04aec96d4173c0955523679c9c20e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.2

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page