85 switch (pull_up_down) {
143 for (i = 0; i < 8; i++) {
146 if (!(gpios & pin_mask)) {
150 GPIO_PC(gpioport) &= ~GPIO_PC_EDM_MASK(i);
208void gpio_set_af(uint32_t gpioport, uint8_t alt_func_num, uint8_t gpios)
215 if (alt_func_num == 0) {
225 for (i = 0; i < 8; i++) {
228 if (!(gpios & pin_mask)) {
232 pctl32 &= ~GPIO_PCTL_MASK(i);
322 return (uint8_t)
GPIO_DATA(gpioport)[gpios];
416 GPIO_LOCK(gpioport) = ~GPIO_LOCK_UNLOCK_CODE;
void gpio_unlock_commit(uint32_t gpioport, uint8_t gpios)
General Purpose Input/Outputs Unlock The Commit Control.
void gpio_set_af(uint32_t gpioport, uint8_t alt_func_num, uint8_t gpios)
General Purpose Input/Outputs Set Alternate Function Selection.
gpio_drive_strength
GPIO Drive Strength Definitions.
void gpio_clear(uint32_t gpioport, uint8_t gpios)
General Purpose Input/Outputs Clear a Group of Pins Atomic.
void gpio_clear_interrupt_flag(uint32_t gpioport, uint8_t gpios)
General Purpose Input/Outputs Mark Interrupt as Serviced.
void gpio_port_write(uint32_t gpioport, uint8_t data)
General Purpose Input/Outputs Write to a Port.
gpio_mode
GPIO Mode Definitions.
void gpio_enable_interrupts(uint32_t gpioport, uint8_t gpios)
General Purpose Input/Outputs Enable Interrupts on specified pins.
void gpio_configure_trigger(uint32_t gpioport, enum gpio_trigger trigger, uint8_t gpios)
General Purpose Input/Outputs Configure Interrupt Trigger.
uint8_t gpio_is_interrupt_source(uint32_t gpioport, uint8_t gpios)
General Purpose Input/Outputs Determine if interrupt is generated by the given pin.
void gpio_mode_setup(uint32_t gpioport, enum gpio_mode mode, enum gpio_pull_up_down pull_up_down, uint8_t gpios)
General Purpose Input/Outputs Set Pin Mode.
uint8_t gpio_port_read(uint32_t gpioport)
General Purpose Input/Outputs Read from a Port.
uint8_t gpio_get(uint32_t gpioport, uint8_t gpios)
General Purpose Input/Outputs Read a Group of Pins.
void gpio_disable_interrupts(uint32_t gpioport, uint8_t gpios)
General Purpose Input/Outputs Disable interrupts on specified pins.
gpio_pull_up_down
GPIO Pull-Up/Pull-Down Definitions.
void gpio_toggle(uint32_t gpioport, uint8_t gpios)
General Purpose Input/Outputs Toggle a Group of Pins.
gpio_output_type
GPIO Output Type Definitions.
void gpio_set(uint32_t gpioport, uint8_t gpios)
General Purpose Input/Outputs Set a Group of Pins Atomic.
gpio_trigger
GPIO Trigger Level/Edge Definitions.
void gpio_set_output_options(uint32_t gpioport, enum gpio_output_type otype, enum gpio_drive_strength drive, enum gpio_slew_ctl slewctl, uint8_t gpios)
General Purpose Input/Outputs Set Output Options.
gpio_slew_ctl
GPIO Slew Control Definitions.
@ GPIO_DRIVE_6MA
6mA drive
@ GPIO_DRIVE_8MA
8mA drive
@ GPIO_DRIVE_10MA
10mA drive
@ GPIO_DRIVE_12MA
12mA drive
@ GPIO_DRIVE_2MA
2mA drive
@ GPIO_DRIVE_4MA
4mA drive
@ GPIO_MODE_ANALOG
Configure pin as analog function.
@ GPIO_MODE_INPUT
Configure pin as input.
@ GPIO_MODE_OUTPUT
Configure pin as output.
@ GPIO_PUPD_PULLUP
Pull the pin high.
@ GPIO_PUPD_PULLDOWN
Pull the pin low.
@ GPIO_PUPD_NONE
Do not pull the pin high or low.
@ GPIO_OTYPE_OD
Open drain configuration.
@ GPIO_TRIG_EDGE_BOTH
Both edges trigger.
@ GPIO_TRIG_EDGE_FALL
Falling edge trigger.
@ GPIO_TRIG_LVL_LOW
Level trigger, signal low.
@ GPIO_TRIG_LVL_HIGH
Level trigger, signal high.
@ GPIO_TRIG_EDGE_RISE
Rising edge trigger.
@ GPIO_SLEW_CTL_ENABLE
Slew rate control enable.
#define GPIO_LOCK_UNLOCK_CODE
#define GPIO_PC_EDM_FULL_RANGE
Full range, 2, 4, 6, 8, 10 and 12 mA are available.
#define GPIO_PC_EDM(n, mode)
Extended Drive Mode Bit N.
#define GPIO_PCTL_AF(pin, af)
GPIO Port Control Set AF for Pin.
#define GPIO_ALL
GPIO All Pins Identifier.
#define GPIO_PP_EDE
Extended Drive Enable.
#define GPIO_MIS(port)
GPIO Masked Interrupt Status.
#define GPIO_PC(port)
GPIO Peripheral Configuration.
#define GPIO_DR8R(port)
GPIO 8-mA Drive Select.
#define GPIO_AFSEL(port)
GPIO Alternate Function Select.
#define GPIO_ODR(port)
GPIO Open Drain Select.
#define GPIO_DEN(port)
GPIO Digital Enable.
#define GPIO_ICR(port)
GPIO Interrupt Clear.
#define GPIO_PUR(port)
GPIO Pull-Up Select.
#define GPIO_AMSEL(port)
GPIO Analog Mode Select.
#define GPIO_PDR(port)
GPIO Pull-Down Select.
#define GPIO_IBE(port)
GPIO Interrupt Both Edges.
#define GPIO_CR(port)
GPIO Commit.
#define GPIO_DIR(port)
GPIO Direction.
#define GPIO_DR4R(port)
GPIO 4-mA Drive Select.
#define GPIO_PP(port)
GPIO Peripheral Property.
#define GPIO_SLR(port)
GPIO Slew Rate Control Select.
#define GPIO_LOCK(port)
GPIO Lock.
#define GPIO_DATA(port)
GPIO Data.
#define GPIO_PCTL(port)
GPIO Port Control.
#define GPIO_DR12R(port)
GPIO 12-mA Drive Select.
#define GPIO_IM(port)
GPIO Interrupt Mask.
#define GPIO_IEV(port)
GPIO Interrupt Event.
#define GPIO_IS(port)
GPIO Interrupt Sense.