GEX thesis source code, full text, references

ch.unit.di.tex 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. \section{Digital Input}
  2. The digital input unit is the input counterpart of the digital output unit. In addition to reading the immediate digital levels of the selected pins, this unit can report asynchronous events on a pin change.
  3. All pins of the unit may be configured either for a rising, falling, or for any change detection; due to a hardware limitation, the same pin number may not be used for event detection on different ports (e.g., A1 and B1) at the same time. In order to receive a pin change event, we must first arm the pin using a command; it can be armed for a single event, or it may be re-armed automatically with a hold-off time. It is further possible to automatically arm selected pins on start-up, removing the need to arm them, e.g., after the module restarts or is re-connected.
  4. \subsection{Digital Input Configuration}
  5. \begin{inicode}
  6. [DI:in@2]
  7. # Port name
  8. port=A
  9. # Pins (comma separated, supports ranges)
  10. pins=10-8,3-0
  11. # Pins with pull-up
  12. pull-up=10,9
  13. # Pins with pull-down
  14. pull-down=0
  15. # Trigger pins activated by rising/falling edge
  16. trig-rise=10
  17. trig-fall=
  18. # Trigger pins auto-armed by default
  19. auto-trigger=10
  20. # Triggers hold-off time (ms)
  21. hold-off=100
  22. \end{inicode}
  23. \subsection{Digital Input Events}
  24. \begin{cmdlist}
  25. 0 & \cname{PIN\_CHANGE}
  26. A pin change event. The payload includes a snapshot of all configured pins captured immediately after the change was registered.
  27. & \begin{cmdpld}
  28. \cfield{u16} changed pins
  29. \cfield{u16} port snapshot
  30. \end{cmdpld}
  31. \end{cmdlist}
  32. \subsection{Digital Input Commands}
  33. \begin{cmdlist}
  34. 0 & \cname{READ} Read the pins
  35. & \begin{cmdresp}
  36. \cfield{u16} pin states
  37. \end{cmdresp} \\
  38. 1 & \cname{ARM\_SINGLE} Arm for a single event
  39. & \begin{cmdreq}
  40. \cfield{u16} pins to arm
  41. \end{cmdreq} \\
  42. 2 & \cname{ARM\_AUTO} Arm with automatic re-arming after each event
  43. & \begin{cmdreq}
  44. \cfield{u16} pins to arm
  45. \end{cmdreq} \\
  46. 3 & \cname{DISARM} Dis-arm selected pins
  47. & \begin{cmdreq}
  48. \cfield{u16} pins to dis-arm
  49. \end{cmdreq}
  50. \end{cmdlist}