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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smfsrc-1.0.2.tar.gz.
File metadata
- Download URL: smfsrc-1.0.2.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e07f8f7b20c6c7edcd811b4856bdccbe76514226af155cf9f2445c3fcf45dd28
|
|
| MD5 |
8a3e7a19772a5eabd3b7ca9eacd1fbcf
|
|
| BLAKE2b-256 |
bcc485b25aa23e8dcc548765d9e720dd14160abcee5852cda4cae2747932162a
|
File details
Details for the file smfsrc-1.0.2-py2.py3-none-any.whl.
File metadata
- Download URL: smfsrc-1.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eab6cb19128289d00c978e0e7bb36af86900d8dab92958d62d87c6e4f8587ffa
|
|
| MD5 |
67cc5b026fcb509d4db05b99a2a210a7
|
|
| BLAKE2b-256 |
cf1de826f1de4cb9f0eac023cea0206fc6b04aec96d4173c0955523679c9c20e
|