Mikroelektronika MIKROE-350 データシート
![Mikroelektronika](https://files.manualsbrain.com/attachments/e0529b3b58069a916ad7bb89f7e9f5f0eda73421/common/fit/150/50/1b07b99aa3112e022a916b06db07f1f4f211e91d41878452d87c7638b1bf/brand_logo.gif)
Expander_Write_PortAB
296
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub procedure Expander_Write_PortAB(dim ModuleAddress as byte,
dim Data_
dim Data_
as word)
Returns
Nothing.
Description
The function writes word to Port Expander's ports.
Parameters :
-
ModuleAddress:
Port Expander hardware address, see schematic at the
bottom of this page
-
Data_:
data to be written. Data to be written to PortA are passed in
Data
's
higher byte. Data to be written to PortB are passed in
Data
's lower byte
Requires
Port Expander must be initialized. See Expander_Init.
Port Expander's PortA and PortB should be configured as outputs. See
Expander_Set_DirectionPortA, Expander_Set_DirectionPortB and
Expander_Set_DirectionPortAB routines.
Expander_Set_DirectionPortA, Expander_Set_DirectionPortB and
Expander_Set_DirectionPortAB routines.
Example
' Write a byte to Port Expander's PORTA and PORTB
...
Expander_Set_DirectionPortAB(0,0x0000) ' set expander's
porta and portb to be output
...
Expander_Write_PortAB(0, 0xAA55)
Expander_Set_DirectionPortAB(0,0x0000) ' set expander's
porta and portb to be output
...
Expander_Write_PortAB(0, 0xAA55)