Mikroelektronika MIKROE-350 Fiche De Données

Page de 526
Expander_Set_DirectionPortA
Expander_Set_DirectionPortB
297
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub procedure Expander_Set_DirectionPortA(dim ModuleAddress as
byte
dim Data_ as byte)
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 corresponds 
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
sub procedure Expander_Set_DirectionPortB(dim ModuleAddress as
byte
dim Data_ as byte)
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 corresponds 
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)