User manual
419
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
Expander_Write_Byte
Expander_Read_PortA
Prototype
procedure Expander_Write_Byte(ModuleAddress, RegAddress, Data : byte);
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
Returns Byte read.
Requires Port Expander must be initialized. See Expander_Init.
Example
// Write a byte to the Port Expander’s register
Expander_Write_Byte(0,1,$FF);
Notes None.
Prototype
function Expander_Read_PortA(ModuleAddress : byte) : byte;
Description The function reads byte from Port Expander’s PortA.
Parameters - ModuleAddress: Port Expander hardware address, see schematic at the bottom of this page
Returns Byte read.
Requires Port Expander must be initialized. See Expander_Init.
Port Expander’s PortA should be congured as input. See Expander_Set_DirectionPortA and
Expander_Set_DirectionPortAB routines.
Example
// Read a byte from Port Expander’s PORTA
var read_data : byte;
...
Expander_Set_DirectionPortA(0,$FF); // set expander’s porta to be input
...
read_data := Expander_Read_PortA(0);
Notes None.