57 int ffs = __builtin_ffs(gpios);
59 const int pin = ffs - 1;
60 const int bit = (1 << pin);
63 reg &= ~GPIO_MODER_MASK_PIN(pin);
78 ffs = __builtin_ffs(gpios);
93void gpio_set(uint32_t gpioport, uint16_t gpios) {
101uint16_t
gpio_get(uint32_t gpioport, uint16_t gpios) {
110 int ffs = __builtin_ffs(gpios);
112 const int pin = ffs - 1;
114 reg &= ~CCS_MUXSELR_MASK_PIN(pin);
119 ffs = __builtin_ffs(gpios);
130 int ffs = __builtin_ffs(gpios);
132 const int pin = ffs - 1;
134 reg &= ~CCS_DSR_MASK_PIN(pin);
139 ffs = __builtin_ffs(gpios);
149 int ffs = __builtin_ffs(gpios);
151 const int pin = ffs - 1;
155 reg &= ~CCS_DSR_SCHMIDT_PIN(pin);
160 ffs = __builtin_ffs(gpios);
static uint32_t get_ccs_port_base(uint32_t gpioport)
PAC55xxxx General-Purpose Input/Output (GPIO)
ccs_drive_strength_t
Drive strength enumeration for type specificity.
#define CCS_DSR_SCHMIDT_PIN(pin)
#define CCS_DSR_DS_VAL(pin, ds)
void gpio_mode_setup(uint32_t gpioport, gpio_mode_t mode, ccs_pull_updown_t pull_up_down, uint16_t gpios)
Set the IO mode and pull-up/down configuration for the pins.
void gpio_set_schmidt_trigger(uint32_t gpioport, bool enable, uint16_t gpios)
Set input schmidt trigger for glitch rejection on the input pin.
uint16_t gpio_get(uint32_t gpioport, uint16_t gpios)
Return a masked bitfield of the port specified.
void gpio_set_outmask(uint32_t gpioport, bool enable, uint16_t gpios)
Set the output mask (disable changes) to the output pins specified.
void gpio_set(uint32_t gpioport, uint16_t gpios)
Set the port pins specified to the true state.
void gpio_clear(uint32_t gpioport, uint16_t gpios)
Clear the port pins specified to the false state.
void gpio_set_output_options(uint32_t gpioport, ccs_drive_strength_t strength, uint16_t gpios)
Set special output options for the gpio pin.
void gpio_set_af(uint32_t gpioport, ccs_muxsel_func_t muxsel, uint16_t gpios)
Set the function of the pin for this port.
#define GPIO_DOCLEARR(base)
#define GPIO_DOSETR(base)
#define GPIO_MODER_MODE(pin, mode)
#define GPIO_OUTMASKR(base)
ccs_pull_updown_t
Pull Up/Down enum for type specificity.
#define CCS_MUXSELR_VAL(pin, muxsel)
#define CCS_MUXSELR(base)