20-151-0178 Rabbit Semiconductor, 20-151-0178 Datasheet - Page 86

CABLE CONVERTER RS-232 TO USB

20-151-0178

Manufacturer Part Number
20-151-0178
Description
CABLE CONVERTER RS-232 TO USB
Manufacturer
Rabbit Semiconductor
Datasheet

Specifications of 20-151-0178

Accessory Type
USB to RS232 Adapter
Product
Microcontroller Accessories
For Use With/related Products
Rabbit-based Boards
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
20-151-0178
316-1181
To use I/O groups, we must first create the groups. The switches[] and leds[] arrays contain point-
ers to each of the Flex_IOPin structures for the switches and the LEDs, respectively. Note that these are
arrays of Flex_IOPin pointers. Also note that each group is terminated by FLEX_GROUP_END; this
macro allows the I/O group API functions to know when they have reached the end of the I/O group.
Note the flexibility that I/O groups allow. To change which inputs you want to use, you can simply change
the members of the switches I/O group. Once this change has been made, it is not necessary to change any
other code in the sample.
We will now skip through the sample to just before the main while() loop.
Remember how we individually initialized each of the LEDs in the previous section? With the “leds” I/O
group, we can initialize the LEDs in a single statement. Both the flexDigOutGroup16() and
flexDigInGroup16() functions expect an array of Flex_IOPin pointers as the first argument. The
second parameter in flexDigOutGroup16() is an unsigned integer. This integer provides the values
that will be output to the pins in the group. The least significant bit in the integer provides the value for the
first output in the group; the next least significant bit provides the value for the second output in the group,
etc:
80
static const Flex_IOPin *leds[] = {
};
// Initialize the output LEDs to turn off
flexDigOutGroup16(leds, 0x0f);
&flex_digout32,
&flex_digout34,
&flex_digout36,
&flex_digout38,
FLEX_GROUP_END
www.rabbit.com
Applications Programming

Related parts for 20-151-0178