hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/** @file
  The Header of Protocol For SPI.
 
  Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.<BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
 
**/
 
#ifndef SPI_H_
#define SPI_H_
 
extern EFI_GUID gSpiMasterProtocolGuid;
typedef struct _EFI_SPI_DRV_PROTOCOL EFI_SPI_DRV_PROTOCOL;
 
typedef
EFI_STATUS
(EFIAPI *SPI_DRV_INIT_INTERFACE)  (
  VOID
  );
 
typedef
EFI_STATUS
(EFIAPI *SPI_DRV_SET_CONFIG_INTERFACE)(
  IN  UINT8  CmdId,
  IN  UINT32 Config,
  IN  UINTN  RegAddr
  );
 
typedef
EFI_STATUS
(EFIAPI *SPI_DRV_GET_CONFIG_INTERFACE)(
  IN  UINT8  CmdId,
  OUT UINT32 *Config,
  IN  UINTN  RegAddr
  );
 
typedef
EFI_STATUS
(EFIAPI *SPI_DRV_CONFIG_MODE_INTERFACE)(
  IN  UINT32 Config
  );
 
struct _EFI_SPI_DRV_PROTOCOL{
  SPI_DRV_INIT_INTERFACE        SpiInit;
  SPI_DRV_SET_CONFIG_INTERFACE  SpiSetConfig;
  SPI_DRV_GET_CONFIG_INTERFACE  SpiGetConfig;
  SPI_DRV_CONFIG_MODE_INTERFACE SpiSetMode;
};
 
#endif // SPI_H_