TianoCore EDK2 master
Loading...
Searching...
No Matches
SmbusLib.h
Go to the documentation of this file.
1
10#ifndef __SMBUS_LIB__
11#define __SMBUS_LIB__
12
27#define SMBUS_LIB_ADDRESS(SlaveAddress, Command, Length, Pec) \
28 ( ((Pec) ? BIT22: 0) | \
29 (((SlaveAddress) & 0x7f) << 1) | \
30 (((Command) & 0xff) << 8) | \
31 (((Length) & 0x3f) << 16) \
32 )
33
39#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)
40
46#define SMBUS_LIB_COMMAND(SmBusAddress) (((SmBusAddress) >> 8) & 0xff)
47
53#define SMBUS_LIB_LENGTH(SmBusAddress) (((SmBusAddress) >> 16) & 0x3f)
54
60#define SMBUS_LIB_PEC(SmBusAddress) ((BOOLEAN) (((SmBusAddress) & BIT22) != 0))
61
67#define SMBUS_LIB_RESERVED(SmBusAddress) ((SmBusAddress) & ~(BIT23 - 2))
68
93VOID
94EFIAPI
96 IN UINTN SmBusAddress,
97 OUT RETURN_STATUS *Status OPTIONAL
98 );
99
124VOID
125EFIAPI
127 IN UINTN SmBusAddress,
128 OUT RETURN_STATUS *Status OPTIONAL
129 );
130
158UINT8
159EFIAPI
161 IN UINTN SmBusAddress,
162 OUT RETURN_STATUS *Status OPTIONAL
163 );
164
193UINT8
194EFIAPI
196 IN UINTN SmBusAddress,
197 IN UINT8 Value,
198 OUT RETURN_STATUS *Status OPTIONAL
199 );
200
227UINT8
228EFIAPI
230 IN UINTN SmBusAddress,
231 OUT RETURN_STATUS *Status OPTIONAL
232 );
233
262UINT8
263EFIAPI
265 IN UINTN SmBusAddress,
266 IN UINT8 Value,
267 OUT RETURN_STATUS *Status OPTIONAL
268 );
269
296UINT16
297EFIAPI
299 IN UINTN SmBusAddress,
300 OUT RETURN_STATUS *Status OPTIONAL
301 );
302
331UINT16
332EFIAPI
334 IN UINTN SmBusAddress,
335 IN UINT16 Value,
336 OUT RETURN_STATUS *Status OPTIONAL
337 );
338
367UINT16
368EFIAPI
370 IN UINTN SmBusAddress,
371 IN UINT16 Value,
372 OUT RETURN_STATUS *Status OPTIONAL
373 );
374
406UINTN
407EFIAPI
409 IN UINTN SmBusAddress,
410 OUT VOID *Buffer,
411 OUT RETURN_STATUS *Status OPTIONAL
412 );
413
442UINTN
443EFIAPI
445 IN UINTN SmBusAddress,
446 OUT VOID *Buffer,
447 OUT RETURN_STATUS *Status OPTIONAL
448 );
449
481UINTN
482EFIAPI
484 IN UINTN SmBusAddress,
485 IN VOID *WriteBuffer,
486 OUT VOID *ReadBuffer,
487 OUT RETURN_STATUS *Status OPTIONAL
488 );
489
490#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT16 EFIAPI SmBusReadDataWord(IN UINTN SmBusAddress, OUT RETURN_STATUS *Status OPTIONAL)
UINT8 EFIAPI SmBusWriteDataByte(IN UINTN SmBusAddress, IN UINT8 Value, OUT RETURN_STATUS *Status OPTIONAL)
UINTN EFIAPI SmBusWriteBlock(IN UINTN SmBusAddress, OUT VOID *Buffer, OUT RETURN_STATUS *Status OPTIONAL)
UINT16 EFIAPI SmBusProcessCall(IN UINTN SmBusAddress, IN UINT16 Value, OUT RETURN_STATUS *Status OPTIONAL)
VOID EFIAPI SmBusQuickWrite(IN UINTN SmBusAddress, OUT RETURN_STATUS *Status OPTIONAL)
UINTN EFIAPI SmBusReadBlock(IN UINTN SmBusAddress, OUT VOID *Buffer, OUT RETURN_STATUS *Status OPTIONAL)
UINT8 EFIAPI SmBusReceiveByte(IN UINTN SmBusAddress, OUT RETURN_STATUS *Status OPTIONAL)
VOID EFIAPI SmBusQuickRead(IN UINTN SmBusAddress, OUT RETURN_STATUS *Status OPTIONAL)
UINT16 EFIAPI SmBusWriteDataWord(IN UINTN SmBusAddress, IN UINT16 Value, OUT RETURN_STATUS *Status OPTIONAL)
UINTN EFIAPI SmBusBlockProcessCall(IN UINTN SmBusAddress, IN VOID *WriteBuffer, OUT VOID *ReadBuffer, OUT RETURN_STATUS *Status OPTIONAL)
UINT8 EFIAPI SmBusSendByte(IN UINTN SmBusAddress, IN UINT8 Value, OUT RETURN_STATUS *Status OPTIONAL)
UINT8 EFIAPI SmBusReadDataByte(IN UINTN SmBusAddress, OUT RETURN_STATUS *Status OPTIONAL)