Skip to content

Commit

Permalink
Cleaning up the basic examples (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
strainmike committed Apr 27, 2017
1 parent c974498 commit 6b8762a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ information on sessions view our Read the docs documentation
Example usage of FPGA configuration functions:

with Session(bitfile="BitfilePath.lvbitx", resource="RIO0") as session:
session.run()
session.download()
session.abort()
session.reset()
my_control = session.registers["MyControl"]
my_control.write(4)
data = my_control.read()
session.reset()
session.run()
my_control = session.registers["MyControl"]
my_control.write(4)
data = my_control.read()


See our [readthedocs page](http://nifpga-python.readthedocs.io/en/latest/) for more detailed examples and documentation.
Expand Down
15 changes: 11 additions & 4 deletions docs/examples/basic_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ Recommended usage is to open a Session as follows:
from nifpga import Session
with Session(bitfile="MyBitfile.lvbitx", resource="RIO0") as session:
session.run()
session.download()
session.abort()
session.reset()
# Reset stops the logic on the FPGA and puts it in the default state.
# May substitute reset with download if your bitfile doesn't support it.
session.reset()
# Add Initialization code here!
# Write initial values to controls while the FPGA logic is stopped.
# Start the logic on the FPGA
session.run()
# Add code that interacts with the FPGA while it is running here!
Using Controls and Indicators
-----------------------------
Expand Down

0 comments on commit 6b8762a

Please sign in to comment.