Rabbit OP7100 User Manual Page 65

  • Download
  • Add to my manuals
  • Print
  • Page
    / 172
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 64
User’s Manual 59
4.5.2 Digital I/O
This functions is used to configure the high-current outputs as either a sinking or a sourcing type output.
Note that
brdInit must be executed before calling this function.
PARAMETERS
outputMode is an 8-bit parameter where each bit corresponds to a high-current output:
Bit 7 = OUT7
Bit 6 = OUT6
Bit 5 = OUT5
Bit 4 = OUT4
Bit 3 = OUT3
Bit 2 = OUT2
Bit 1 = OUT1
Bit 0 = OUT0
To set the outputs, set the corresponding bit to one of the following states:
0 = Sinking type circuit
1 = Sourcing type circuit
EXAMPLE
digOutConfig(0x81);
// OUT0 and OUT7 are sourcing, OUT1–OUNT6 are sinking
SEE ALSO
brdInit, digIn, digOut, triStateConfig, digOutTriState
Sets the state of a digital output (OUT0–OUT7).
The output channel is set to the state that is specified. If the output is configured as sinking, set to 0 for
the driver to be sinking, or set to 1 for the driver to be OFF (high-impedance state). If the output is con-
figured as sourcing, set to 0 for the driver to be OFF (high-impedance state), or set to 1 for the driver to
be sourcing.
Remember to call brdInit and digOutConfig before executing this function.
A runtime error will occur for the following conditions:
1. channel or state out of range.
2. brdInit or digOutConfig was not executed before executing digOut.
3. Your tried to use a channel configured as a tri-state output.
PARAMETERS
channel is the output channel number (0–7).
state is the output value (0 or 1).
SEE ALSO
brdInit, digOutConfig, triStateConfig, digOutTriState
void digOutConfig(char outputMode);
void digOut(int channel, int state);
Page view 64
1 2 ... 60 61 62 63 64 65 66 67 68 69 70 ... 171 172

Comments to this Manuals

No comments