blob: 52f760dc539d89b69a91cb8629932675e6ea9b7d [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/*******************************************************************************
2 * Copyright (C) 2007, ZTE Corporation.
3 *
4 * File Name: hal_spi.h
5 * File Mark:
6 * Description: Provide spi hal function prototype declaration and type declaration.
7 * Others:
8 * Version: V0.5
9 * Author: zhenghong
10 * Date: 2008-03-19
11 * History 1:
12 * Date:
13 * Version:
14 * Author:
15 * Modification:
16 * History 2:
17 ********************************************************************************/
18
19#ifndef _HAL_SPI_H
20#define _HAL_SPI_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/****************************************************************************
27* Include files
28****************************************************************************/
29#include "drvs_gpio.h"
30/****************************************************************************
31* Macros
32****************************************************************************/
33#define USB_SWITCH_GPIO_OUT 0
34#define USB_SWITCH_GPIO_IN 1
35#define USB_SWITCH_PIN_MODE_FUNC 0
36#define USB_SWITCH_PIN_MODE_GPIO 1
37#define USB_SWTICH_SEL 46
38#define USB_SWTICH_OE_N 43
39#define DBB2AR9342_POWER_ON 39
40#define DBB2AR9342_RESET 48
41#define DBB2USB_DPOS_PULL_UP 7
42#define USB2DBB_DNEG_DETECT 8
43#define USB_CHAR_DET 8
44#define VTELECOM_18_ARM_UART2_RXD 33
45/****************************************************************************
46* Types
47****************************************************************************/
48/*
49OE* S HSD1+(HSD1-) HSD2+(HSD2-)
501 X OFF OFF
510 0 ON OFF
520 1 OFF ON
53
54ps:HSD1+(HSD1-) connect PC;HSD2+(HSD2-) connect wifi
55OE* connect from GPIO43(ARM_I2S2_WS)
56S connect from GPIO42(ARM_I2S2_DOUT)
57*/
58typedef enum Usb_Switch_Select_Option
59{
60 USB_SWITCH_CONNECT_PC,
61 USB_SWITCH_CONNECT_WIFI,
62 USB_SWITCH_ALL_OFF,
63}T_Usb_Switch_Select_Option;
64
65typedef enum Ar9342_On_Off_Option
66{
67 Ar9342_ON,
68 Ar9342_OFF,
69}T_Ar9342_On_Off_Option;
70
71typedef enum Charger_Usbdevice
72{
73 USBCHARGER,//change to USBCHARGER because it`s the same to Charger_Usbdevice in Drvs_usb_switch.h
74 USBDEVICE,
75}Charger_Usbdevice;
76/****************************************************************************
77* Constants
78****************************************************************************/
79
80/****************************************************************************
81* Global Variables
82****************************************************************************/
83
84/****************************************************************************
85* Function Prototypes
86****************************************************************************/
87UINT32 zDrvUsb_Switch_Select(T_Usb_Switch_Select_Option select);
88
89UINT32 zDrvSetAR9342_ON_OFF(T_Ar9342_On_Off_Option select);
90
91VOID zDrvUSB_2V8_WriteGpio(UINT32 pinNum, UINT32 Value);
92/*******************************************************************************
93 * Function: zDrvCharger_UsbDevice_Detect
94 * Function: return charger or usb device connect
95 * Description:
96 * Parameters:
97 * Input:
98 *
99 * Output:
100 *
101 * Returns: success or fail
102 *
103 *
104 * Others:
105********************************************************************************/
106Charger_Usbdevice zDrvCharger_UsbDevice_Detect(VOID);
107/*******************************************************************************
108 * Function: zDrvCharger_UsbDevice_Prepare
109 * Function: prepare gpio zpm_2v8_gpio08
110 * Description:
111 * Parameters:
112 * Input:
113 *
114 * Output:
115 *
116 * Returns:
117 *
118 *
119 * Others:
120********************************************************************************/
121VOID zDrvCharger_UsbDevice_Prepare(VOID);
122
123#ifdef __cplusplus
124}
125#endif
126
127#endif /*_HAL_SPI_H*/