Datasheet

Expander_Set_DirectionPortAB
Expander_Set_PullUpsPortA
362
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
void Expander_Set_DirectionPortAB(char ModuleAddress, unsigned int
Direction);
Returns Nothing.
Description
The function sets Port Expander's PortA and PortB direction.
Parameters :
-
ModuleAddress: Port Expander hardware address, see schematic at
the bottom of this page
- Direction: data to be written to direction registers. Data to be written
to the PortA direction register are passed in Direction's higher byte.
Data to be written to the PortB direction register are passed in
Direction's lower byte. Each bit corresponds to the appropriate pin of
the PortA/PortB register. Set bit designates corresponding pin as input.
Cleared bit designates corresponding pin as output.
Requires Port Expander must be initialized. See Expander_Init.
Example
// Set Port Expander's PORTA to be output and PORTB to be input
Expander_Set_DirectionPortAB(0,0x00FF);
Prototype
void Expander_Set_PullUpsPortA(char ModuleAddress, char Data);
Returns Nothing.
Description
The function sets Port Expander's PortA pull up/down resistors.
Parameters :
-
ModuleAddress: Port Expander hardware address, see schematic at
the bottom of this page
- Data: data for choosing pull up/down resistors configuration. Each bit
corresponds to the appropriate pin of the PortA register. Set bit
enables pull-up for corresponding pin.
Requires Port Expander must be initialized. See Expander_Init.
Example
// Set Port Expander's PORTA pull-up resistors
Expander_Set_PullUpsPortA(0, 0xFF);