This driver only supports 7-bit I2C addresses The HAL.I2C.I2C_Address LSB is the R/W bit, so a 7-bit address is shifted left 1 The R/W bit is ignored by the driver. Ex. A device with bus address 2#1010_000# should set Addr => 2#1010_0000#
type Any_I2C_Peripheral is not null access all I2C_Peripheral;
procedure Configure
(This : in out I2C_Master_Port;
Baudrate : Hertz)
type I2C_Master_Port
(Num : I2C_Number;
Periph : Any_I2C_Peripheral)
is new HAL.I2C.I2C_Port with private;
subtype I2C_Number is Natural range 0 .. 1;
type I2C_Peripheral is private;
procedure Master_Receive
(This : in out I2C_Master_Port;
Addr : HAL.I2C.I2C_Address;
Data : out HAL.I2C.I2C_Data;
Status : out HAL.I2C.I2C_Status;
Timeout : Natural := 1000)
procedure Master_Transmit
(This : in out I2C_Master_Port;
Addr : HAL.I2C.I2C_Address;
Data : HAL.I2C.I2C_Data;
Status : out HAL.I2C.I2C_Status;
Timeout : Natural := 1000)
procedure Mem_Read
(This : in out I2C_Master_Port;
Addr : HAL.I2C.I2C_Address;
Mem_Addr : HAL.UInt16;
Mem_Addr_Size : HAL.I2C.I2C_Memory_Address_Size;
Data : out HAL.I2C.I2C_Data;
Status : out HAL.I2C.I2C_Status;
Timeout : Natural := 1000)
procedure Mem_Write
(This : in out I2C_Master_Port;
Addr : HAL.I2C.I2C_Address;
Mem_Addr : HAL.UInt16;
Mem_Addr_Size : HAL.I2C.I2C_Memory_Address_Size;
Data : HAL.I2C.I2C_Data;
Status : out HAL.I2C.I2C_Status;
Timeout : Natural := 1000)