EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Accessing Raspberry Pi GPIO through EPICS
From: Peter Milne <[email protected]>
To: [email protected], [email protected]
Date: Wed, 14 Aug 2013 09:14:52 +0100
Hi Peter

If your use of gpio is the "switch a bit on, switch it off sometime later" type,
then the linux kernel gpio support will probably do it for you:

eg from the shell control would be:
echo 1 > /sys/class/gpio/gpio100/value

We use that interface extensively with an ioc; we wrote a very thin layer of device support that reads/writes single values from/to a virtual file and fits it into an appropriate record. A small set of abbreviations makes the db support palatable.


eg for BO record type, in the device support:

/** @file devBoAcqHost.cpp Device support entry for BO records
 *
 *  Created on: May 3, 2012
 *      Author: pgm
 *      BO:
 *      INP = path to knob, write 0 or 1.
 *      specials:
 *      %g KNOB : /sys/class/gpio/KNOB/value
 *      eg %g gpio100
 *      %l KNOB : /sys/class/leds/KNOB/brightness {1|0}
 *      eg %l cpsc:1:green:idle
 */

in the db file:

record(bo, "${UUT}:PSU:RESET:${cid}") {
        field(DTYP, "boAcqHost")
        field(OUT, "@%g gpio${gpio_reset}")
        field(DESC, "reset PSU ${cid}")
        field(ZNAM, "OK")
        field(ONAM, "ERR")
        field(PINI, "YES")
}

record(bi, "${UUT}:SYS:exttrg2") {
        field(DTYP, "biAcqHost")
        field(INP,  "@%g gpio22")
        field(DESC, "front panel input WAVTRIG")
        field(SCAN, "1 second")
}

I'd be very happy to send you a copy of the source if you're interested.

Cheers

Peter.




On 14/08/13 08:25, Florian Feldbauer wrote:
Hey Peter,

to access the GPIOs from EPICS you need to write a device support module using the C-libraries.

Unfortunately there is no good documentation on this topic for beginners that I know of... I could provide you my device support for reading out DS18S20 Dallas-1-Wire Temperature sensors using the Pi as a starting point.

Best regards,
Florian

On 08/14/2013 02:09 AM, Peter Linardakis wrote:
Hello all...

We are exploring the idea of using Raspberry Pi for basic digital IO tasks. Theidea is that we could avoid deploying other IOCs and possibly wasting many other IOC ports. I have EPICS running on a Raspberry Pi with a test record DB (soft records only) and it is successfully communicating across the network. I know how to directly access the GPIO pins while on the Pi (through C libraries etc.),but I do not know the first thing about how to get to those pins through EPICS.

Any advice or direction would be much appreciated.I am relatively new to EPICS development but am experienced with with maintenance of EPICS records and the like.

Regards
Peter

Dr PeterLinardakis

/Accelerator Research &Development Engineer/

*Nuclear Physics | Research School of Physics and Engineering*

*Australian National University*

e: [email protected]

p: (02) 6125 2862



--
----------------------------------------
| Dr. Florian Feldbauer                |
|                                      |
| Helmholtz-Institut Mainz /           |
| Johannes Gutenberg-Universität Mainz |
| Johann-Joachim-Becher-Weg 45         |
| D-55128 Mainz                        |
|                                      |
| Office: 01/102                       |
| Phone:  (+49)6131 / 39-27373         |
----------------------------------------


--
Peter Milne			[email protected]
D-TACQ Solutions Ltd		www.d-tacq.com


Replies:
Re: Accessing Raspberry Pi GPIO through EPICS Peter Linardakis
References:
Accessing Raspberry Pi GPIO through EPICS Peter Linardakis
Re: Accessing Raspberry Pi GPIO through EPICS Florian Feldbauer

Navigate by Date:
Prev: RE: Accessing Raspberry Pi GPIO through EPICS ulrik.pedersen
Next: Should Linux C++ builds have debug symbols by default in R3.14.12.3? tom.cobb
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Accessing Raspberry Pi GPIO through EPICS ulrik.pedersen
Next: Re: Accessing Raspberry Pi GPIO through EPICS Peter Linardakis
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·