Mikroelektronika MIKROE-350 Fiche De Données

Page de 526
Expander_Read_Byte
Expander_Write_Byte
291
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub function Expander_Read_Byte(dim ModuleAddress as bytedim
RegAddress 
as byteas byte
Returns
Byte read.
Description
The function reads byte from Port Expander.
Parameters : 
ModuleAddress:
Port Expander hardware address, see schematic at the 
bottom of this page 
RegAddress:
Port Expander's internal register address 
Requires
Port Expander must be initialized. See Expander_Init.
Example
' Read a byte from Port Expander's register
dim read_data as byte
...
read_data = Expander_Read_Byte(0,1)
Prototype
sub procedure Expander_Write_Byte(dim ModuleAddress as bytedim
RegAddress 
as bytedim Data_ as byte)
Returns
Nothing.
Description
Routine writes a byte to Port Expander.
Parameters : 
ModuleAddress:
Port Expander hardware address, see schematic at the 
bottom of this page 
RegAddress:
Port Expander's internal register address 
Data_:
data to be written 
Requires
Port Expander must be initialized. See Expander_Init.
Example
' Write a byte to the Port Expander's register
Expander_Write_Byte(0,1,0xFF)