|
enum | GPIO_PinTypeDef {
GPIO_GROUPA = 0x000,
GPIO_GROUPB = 0x100,
GPIO_GROUPC = 0x200,
GPIO_GROUPD = 0x300,
GPIO_GROUPE = 0x400,
GPIO_PA0 = GPIO_GROUPA | BIT(0),
GPIO_PA1 = GPIO_GROUPA | BIT(1),
GPIO_PA2 = GPIO_GROUPA | BIT(2),
GPIO_PA3 = GPIO_GROUPA | BIT(3),
GPIO_PA4 = GPIO_GROUPA | BIT(4),
GPIO_PA5 = GPIO_GROUPA | BIT(5),
GPIO_DM =GPIO_PA5,
GPIO_PA6 = GPIO_GROUPA | BIT(6),
GPIO_DP =GPIO_PA6,
GPIO_PA7 = GPIO_GROUPA | BIT(7),
GPIO_SWS =GPIO_PA7,
GPIOA_ALL = GPIO_GROUPA | 0x00ff,
GPIO_PB0 = GPIO_GROUPB | BIT(0),
GPIO_PB1 = GPIO_GROUPB | BIT(1),
GPIO_PB2 = GPIO_GROUPB | BIT(2),
GPIO_PB3 = GPIO_GROUPB | BIT(3),
GPIO_PB4 = GPIO_GROUPB | BIT(4),
GPIO_PB5 = GPIO_GROUPB | BIT(5),
GPIO_PB6 = GPIO_GROUPB | BIT(6),
GPIO_PB7 = GPIO_GROUPB | BIT(7),
GPIO_PC0 = GPIO_GROUPC | BIT(0),
GPIO_PC1 = GPIO_GROUPC | BIT(1),
GPIO_PC2 = GPIO_GROUPC | BIT(2),
GPIO_PC3 = GPIO_GROUPC | BIT(3),
GPIO_PC4 = GPIO_GROUPC | BIT(4),
GPIO_PC5 = GPIO_GROUPC | BIT(5),
GPIO_PC6 = GPIO_GROUPC | BIT(6),
GPIO_PC7 = GPIO_GROUPC | BIT(7),
GPIO_PD0 = GPIO_GROUPD | BIT(0),
GPIO_PD1 = GPIO_GROUPD | BIT(1),
GPIO_PD2 = GPIO_GROUPD | BIT(2),
GPIO_PD3 = GPIO_GROUPD | BIT(3),
GPIO_PD4 = GPIO_GROUPD | BIT(4),
GPIO_PD5 = GPIO_GROUPD | BIT(5),
GPIO_PD6 = GPIO_GROUPD | BIT(6),
GPIO_PD7 = GPIO_GROUPD | BIT(7),
GPIO_PE0 = GPIO_GROUPE | BIT(0),
GPIO_MSDO =GPIO_PE0,
GPIO_PE1 = GPIO_GROUPE | BIT(1),
GPIO_MCLK =GPIO_PE1,
GPIO_PE2 = GPIO_GROUPE | BIT(2),
GPIO_MSCN =GPIO_PE2,
GPIO_PE3 = GPIO_GROUPE | BIT(3),
GPIO_MSDI =GPIO_PE3,
GPIO_ALL = 0x500
} |
| Define GPIO types. More...
|
|
enum | GPIO_FuncTypeDef {
AS_GPIO = 0,
AS_MSPI = 1,
AS_SWIRE = 2,
AS_UART = 3,
AS_I2C = 4,
AS_SPI = 5,
AS_I2S = 6,
AS_AMIC = 7,
AS_DMIC = 8,
AS_SDM = 9,
AS_USB = 10,
AS_ADC = 11,
AS_CMP = 12,
AS_ATS = 13,
AS_PWM0 = 20,
AS_PWM1 = 21,
AS_PWM2 = 22,
AS_PWM3 = 23,
AS_PWM4 = 24,
AS_PWM5 = 25,
AS_PWM0_N = 26,
AS_PWM1_N = 27,
AS_PWM2_N = 28,
AS_PWM3_N = 29,
AS_PWM4_N = 30,
AS_PWM5_N = 31
} |
| Define GPIO Function types. More...
|
|
enum | GPIO_LevelTypeDef { Level_Low =0,
Level_High =1
} |
|
enum | GPIO_PolTypeDef { POL_RISING = 0,
pol_rising = 0,
POL_FALLING = 1,
pol_falling = 1
} |
| Define rising/falling types. More...
|
|
enum | GPIO_PullTypeDef { PM_PIN_UP_DOWN_FLOAT = 0,
PM_PIN_PULLUP_1M = 1,
PM_PIN_PULLDOWN_100K = 2,
PM_PIN_PULLUP_10K = 3
} |
| Define pull up or down types. More...
|
|
|
void | gpio_init (int anaRes_init_en) |
| This function servers to initialization all gpio. More...
|
|
void | gpio_set_func (GPIO_PinTypeDef pin, GPIO_FuncTypeDef func) |
| This function servers to set the GPIO's function. More...
|
|
static void | gpio_set_output_en (GPIO_PinTypeDef pin, unsigned int value) |
| This function set the output function of a pin. More...
|
|
void | gpio_set_input_en (GPIO_PinTypeDef pin, unsigned int value) |
| This function set the input function of a pin. More...
|
|
static int | gpio_is_output_en (GPIO_PinTypeDef pin) |
| This function determines whether the output function of a pin is enabled. More...
|
|
static int | gpio_is_input_en (GPIO_PinTypeDef pin) |
| This function determines whether the input function of a pin is enabled. More...
|
|
static void | gpio_write (GPIO_PinTypeDef pin, unsigned int value) |
| This function set the pin's output level. More...
|
|
static unsigned int | gpio_read (GPIO_PinTypeDef pin) |
| This function read the pin's input/output level. More...
|
|
static unsigned int | gpio_read_cache (GPIO_PinTypeDef pin, unsigned char *p) |
| This function read a pin's cache from the buffer. More...
|
|
static void | gpio_read_all (unsigned char *p) |
| This function read all the pins' input level. More...
|
|
static void | gpio_toggle (GPIO_PinTypeDef pin) |
| This function set the pin toggle. More...
|
|
void | gpio_set_data_strength (GPIO_PinTypeDef pin, unsigned int value) |
| This function set the pin's driving strength. More...
|
|
void | gpio_setup_up_down_resistor (GPIO_PinTypeDef gpio, GPIO_PullTypeDef up_down) |
| This function set a pin's pull-up/down resistor. More...
|
|
void | gpio_shutdown (GPIO_PinTypeDef pin) |
| This function servers to set the specified GPIO as high resistor. More...
|
|
static void | gpio_set_interrupt_pol (GPIO_PinTypeDef pin, GPIO_PolTypeDef falling) |
| This function set a pin's polarity that trig its IRQ. More...
|
|
static void | gpio_set_interrupt (GPIO_PinTypeDef pin, GPIO_PolTypeDef falling) |
| This function set a pin's IRQ. More...
|
|
static void | gpio_en_interrupt (GPIO_PinTypeDef pin, int en) |
| This function enables a pin's IRQ function. More...
|
|
static void | gpio_set_interrupt_risc0 (GPIO_PinTypeDef pin, GPIO_PolTypeDef falling) |
| This function set a pin's IRQ. More...
|
|
static void | gpio_en_interrupt_risc0 (GPIO_PinTypeDef pin, int en) |
| This function enables a pin's IRQ function. More...
|
|
static void | gpio_set_interrupt_risc1 (GPIO_PinTypeDef pin, GPIO_PolTypeDef falling) |
| This function set a pin's IRQ. More...
|
|
static void | gpio_en_interrupt_risc1 (GPIO_PinTypeDef pin, int en) |
| This function enables a pin's IRQ function. More...
|
|
static void | usb_dp_pullup_en (int en) |
| This function enables or disables the internal pull-up resistor of DP pin of USB interface. More...
|
|
static void | usb_power_on (unsigned char en) |
| This function serves to power on or down USB module. More...
|
|
static void | usb_set_pin_en (void) |
| This function serves to set GPIO MUX function as DP and DM pin of USB. More...
|
|