151-0153 Rabbit Semiconductor, 151-0153 Datasheet - Page 86

no-image

151-0153

Manufacturer Part Number
151-0153
Description
ASSEMBLY - RABBITFLEX CABLES
Manufacturer
Rabbit Semiconductor
Series
RabbitFLEX™r
Datasheet

Specifications of 151-0153

Accessory Type
Cable Assembly
For Use With/related Products
BL300F
Lead Free Status / RoHS Status
Vendor undefined / Vendor undefined
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 151-0153