Datasheet

Expander_Read_PortA
Expander_Read_PortB
356
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
char Expander_Read_PortA(char ModuleAddress);
Returns Byte read.
Description
The function reads byte from Port Expander's PortA.
Parameters :
-
ModuleAddress: Port Expander hardware address, see schematic at
the bottom of this page
Requires
Port Expander must be initialized. See Expander_Init.
Port Expander's PortA should be configured as input. See Expander_Set_Direc-
tionPortA and Expander_Set_DirectionPortAB routines.
Example
// Read a byte from Port Expander's PORTA
char read_data;
...
Expander_Set_DirectionPortA(0,0xFF); // set expander's
porta to be input
...
read_data = Expander_Read_PortA(0);
Prototype
char Expander_Read_PortB(char ModuleAddress);
Returns Byte read.
Description
The function reads byte from Port Expander's PortB.
Parameters :
-
ModuleAddress: Port Expander hardware address, see schematic at
the bottom of this page
Requires
Port Expander must be initialized. See Expander_Init.
Port Expander's PortB should be configured as input. See Expander_Set_Direc-
tionPortB and Expander_Set_DirectionPortAB routines.
Example
// Read a byte from Port Expander's PORTB
char read_data;
...
Expander_Set_DirectionPortB(0,0xFF); // set expander's
portb to be input
...
read_data = Expander_Read_PortB(0);