Datasheet

Expander_Set_DirectionPortA
Expander_Set_DirectionPortB
361
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
void Expander_Set_DirectionPortA(char ModuleAddress, char Data);
Returns Nothing.
Description
The function sets Port Expander's PortA direction.
Parameters :
- ModuleAddress: Port Expander hardware address, see schematic at
the bottom of this page
- Data: data to be written to the PortA direction register. Each bit corre-
sponds to the appropriate pin of the PortA 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
Expander_Set_DirectionPortA(0,0x00);
Prototype
void Expander_Set_DirectionPortB(char ModuleAddress, char Data);
Returns Nothing.
Description
The function sets Port Expander's PortB direction.
Parameters :
- ModuleAddress: Port Expander hardware address, see schematic at
the bottom of this page
- Data: data to be written to the PortB direction register. Each bit corre-
sponds to the appropriate pin of the 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 PORTB to be input
Expander_Set_DirectionPortB(0,0xFF);