TianoCore EDK2 master
Loading...
Searching...
No Matches
I2cMaster.h File Reference
#include <Pi/PiI2c.h>

Go to the source code of this file.

Data Structures

struct  _EFI_PEI_I2C_MASTER_PPI
 

Macros

#define EFI_PEI_I2C_MASTER_PPI_GUID    { 0xb3bfab9b, 0x9f9c, 0x4e8b, { 0xad, 0x37, 0x7f, 0x8c, 0x51, 0xfc, 0x62, 0x80 }}
 

Typedefs

typedef struct _EFI_PEI_I2C_MASTER_PPI EFI_PEI_I2C_MASTER_PPI
 
typedef EFI_STATUS(EFIAPI * EFI_PEI_I2C_MASTER_PPI_SET_BUS_FREQUENCY) (IN EFI_PEI_I2C_MASTER_PPI *This, IN UINTN *BusClockHertz)
 
typedef EFI_STATUS(EFIAPI * EFI_PEI_I2C_MASTER_PPI_RESET) (IN CONST EFI_PEI_I2C_MASTER_PPI *This)
 
typedef EFI_STATUS(EFIAPI * EFI_PEI_I2C_MASTER_PPI_START_REQUEST) (IN CONST EFI_PEI_I2C_MASTER_PPI *This, IN UINTN SlaveAddress, IN EFI_I2C_REQUEST_PACKET *RequestPacket)
 

Variables

EFI_GUID gEfiPeiI2cMasterPpiGuid
 

Detailed Description

This PPI manipulates the I2C host controller to perform transactions as a master on the I2C bus using the current state of any switches or multiplexers in the I2C bus.

Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference:
This PPI is introduced in PI Version 1.3.

Definition in file I2cMaster.h.

Macro Definition Documentation

◆ EFI_PEI_I2C_MASTER_PPI_GUID

#define EFI_PEI_I2C_MASTER_PPI_GUID    { 0xb3bfab9b, 0x9f9c, 0x4e8b, { 0xad, 0x37, 0x7f, 0x8c, 0x51, 0xfc, 0x62, 0x80 }}

Definition at line 18 of file I2cMaster.h.

Typedef Documentation

◆ EFI_PEI_I2C_MASTER_PPI

Definition at line 21 of file I2cMaster.h.

◆ EFI_PEI_I2C_MASTER_PPI_RESET

typedef EFI_STATUS(EFIAPI * EFI_PEI_I2C_MASTER_PPI_RESET) (IN CONST EFI_PEI_I2C_MASTER_PPI *This)

Reset the I2C controller and configure it for use.

Parameters
ThisPointer to an EFI_PEI_I2C_MASTER_PPI structure.
Return values
EFI_SUCCESSThe reset completed successfully.
EFI_DEVICE_ERRORThe reset operation failed.

Definition at line 53 of file I2cMaster.h.

◆ EFI_PEI_I2C_MASTER_PPI_SET_BUS_FREQUENCY

typedef EFI_STATUS(EFIAPI * EFI_PEI_I2C_MASTER_PPI_SET_BUS_FREQUENCY) (IN EFI_PEI_I2C_MASTER_PPI *This, IN UINTN *BusClockHertz)

Set the frequency for the I2C clock line.

Parameters
ThisPointer to an EFI_PEI_I2C_MASTER_PPI structure.
BusClockHertzPointer to the requested I2C bus clock frequency in Hertz. Upon return this value contains the actual frequency in use by the I2C controller.
Return values
EFI_SUCCESSThe bus frequency was set successfully.
EFI_INVALID_PARAMETERBusClockHertz is NULL
EFI_UNSUPPORTEDThe controller does not support this frequency.

Definition at line 37 of file I2cMaster.h.

◆ EFI_PEI_I2C_MASTER_PPI_START_REQUEST

typedef EFI_STATUS(EFIAPI * EFI_PEI_I2C_MASTER_PPI_START_REQUEST) (IN CONST EFI_PEI_I2C_MASTER_PPI *This, IN UINTN SlaveAddress, IN EFI_I2C_REQUEST_PACKET *RequestPacket)

Start an I2C transaction on the host controller.

Parameters
ThisPointer to an EFI_PEI_I2C_MASTER_PPI structure.
SlaveAddressAddress of the device on the I2C bus. Set the I2C_ADDRESSING_10_BIT when using 10-bit addresses, clear this bit for 7-bit addressing. Bits 0-6 are used for 7-bit I2C slave addresses and bits 0-9 are used for 10-bit I2C slave addresses.
RequestPacketPointer to an EFI_I2C_REQUEST_PACKET structure describing the I2C transaction.
Return values
EFI_SUCCESSThe transaction completed successfully.
EFI_BAD_BUFFER_SIZEThe RequestPacket->LengthInBytes value is too large.
EFI_DEVICE_ERRORThere was an I2C error (NACK) during the transaction.
EFI_INVALID_PARAMETERRequestPacket is NULL
EFI_NO_RESPONSEThe I2C device is not responding to the slave address. EFI_DEVICE_ERROR will be returned if the controller cannot distinguish when the NACK occurred.
EFI_NOT_FOUNDReserved bit set in the SlaveAddress parameter
EFI_OUT_OF_RESOURCESInsufficient memory for I2C transaction
EFI_UNSUPPORTEDThe controller does not support the requested transaction.

Definition at line 81 of file I2cMaster.h.