Building Driver
===============

Requires:

* EPICS Base >=3.15.1 https://epics.anl.gov/
* zlib

Optional general interest

* autosave https://github.com/epics-modules/autosave

Optional for SLAC

* Busy https://github.com/epics-modules/busy
* Asyn (dependency of busy) https://github.com/epics-modules/asyn

Optional for HIRES

* pyDevSup (also needs python headers) https://mdavidsaver.github.io/pyDevSup

Optional for python API to access through running IOC.
Defaults to using 'python' (from `$PATH`).
Can be changed in pyDevSup/configure/CONFIG_SITE

* cothread https://github.com/dls-controls/cothread

Building from source ::

    git clone https://github.com/epics-base/epics-base
    git clone https://github.com/epics-modules/busy
    git clone https://github.com/epics-modules/asyn
    git clone https://github.com/mdavidsaver/pyDevSup
    git clone git@gitlab.lbl.gov:drivers/FEED.git
    # configure
    cat <<EOF > asyn/configure/RELEASE
    EPICS_BASE=$PWD/epics-base
    EOF
    cat <<EOF > busy/configure/RELEASE
    ASYN=$PWD/asyn
    EPICS_BASE=$PWD/epics-base
    EOF
    cat <<EOF > pyDevSup/configure/RELEASE
    EPICS_BASE=$PWD/epics-base
    EOF
    cat <<EOF > FEED/configure/RELEASE.local
    ASYN=$PWD/asyn
    BUSY=$PWD/busy
    PYDEVSUP=$PWD/pyDevSup
    EPICS_BASE=$PWD/epics-base
    EOF
    make -C epics-base
    make -C asyn
    make -C busy
    make -C pyDevSup
    make -C FEED

Building FEED results in

* libfeed and feed.dbd for inclusion in IOCs
* leep.py CLI client tool
* feedsim Standalong device simulator
* feed_base.template A .db fragment for generic control/status
* feed_reg_*.template Fragments for use with templates generated by leep.py

To include in an IOC, add the following to eg. '<myname>App/src/Makefile' ::

    <myioc>_DBD += feed.dbd
    <myioc>_LIBS += feed

Tools
=====

Several build-time tool scripts are provided under src/python/
to assist bootstrapping a new board.  These scripts can take
a register description JSON file as input.

This may be downloaded directly from a configured device with eg. IP address 1.2.3.4 ::

    cd src/python
    python -m leep.cli leep://1.2.3.4 json > my_registers.json

Or through an IOC with record prefix TST: ::

    cd src/python
    python -m leep.cli ca://TST: json > my_registers.json

The resulting JSON file may be used to generate substitutions file
which will allow access to all registers. ::

    python -m leep.cli file:///path/to/my_registers.json template my_registers.substitutions

To generate a cs-studio/display-builder screen with basic controls for all scalar registers. ::

    python -m leep.eng my_registers.bob /path/to/my_registers.json
