Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Expander_Read_Byte
Expander_Write_Byte
304
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
function Expander_Read_Byte(ModuleAddress : byte; RegAddress :
byte) : byte;
Returns
Byte read.
Description
The function reads byte from Port Expander.
Parameters : 
ModuleAddress
: Port Expander hardware address, see schematic at the bot-
tom 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
var read_data : byte;
...
read_data := Expander_Read_Byte(0,1);
Prototype
procedure Expander_Write_Byte(ModuleAddress: byte; RegAddress:
byte; Data_: byte);
Returns
Nothing.
Description
Routine writes a byte to Port Expander.
Parameters : 
ModuleAddress
: Port Expander hardware address, see schematic at the bot
tom 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);