coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.c File Reference
#include <device/mmio.h>
#include <types.h>
#include <gpio.h>
Include dependency graph for gpio.c:

Go to the source code of this file.

Functions

void gpio_configure (gpio_t gpio, uint32_t func, uint32_t pull, uint32_t drive_str, uint32_t enable)
 
void gpio_set (gpio_t gpio, int value)
 
int gpio_get (gpio_t gpio)
 
void gpio_input_pulldown (gpio_t gpio)
 
void gpio_input_pullup (gpio_t gpio)
 
void gpio_input (gpio_t gpio)
 
void gpio_output (gpio_t gpio, int value)
 
void gpio_input_irq (gpio_t gpio, enum gpio_irq_type type, uint32_t pull)
 
int gpio_irq_status (gpio_t gpio)
 

Function Documentation

◆ gpio_configure()

void gpio_configure ( gpio_t  gpio,
uint32_t  func,
uint32_t  pull,
uint32_t  drive_str,
uint32_t  enable 
)

Definition at line 7 of file gpio.c.

References GPIO_CFG_DRV_BMSK, GPIO_CFG_DRV_SHFT, GPIO_CFG_FUNC_BMSK, GPIO_CFG_FUNC_SHFT, GPIO_CFG_OE_BMSK, GPIO_CFG_OE_SHFT, GPIO_CFG_PULL_BMSK, GPIO_CFG_PULL_SHFT, pull, and write32().

Here is the call graph for this function:

◆ gpio_get()

int gpio_get ( gpio_t  gpio)

Definition at line 27 of file gpio.c.

References GPIO_IO_IN_BMSK, GPIO_IO_IN_SHFT, and read32().

Here is the call graph for this function:

◆ gpio_input()

void gpio_input ( gpio_t  gpio)

Definition at line 47 of file gpio.c.

References GPIO_2MA, gpio_configure(), GPIO_DISABLE, GPIO_FUNC_GPIO, and GPIO_NO_PULL.

Here is the call graph for this function:

◆ gpio_input_irq()

void gpio_input_irq ( gpio_t  gpio,
enum gpio_irq_type  type,
uint32_t  pull 
)

◆ gpio_input_pulldown()

void gpio_input_pulldown ( gpio_t  gpio)

Definition at line 35 of file gpio.c.

References GPIO_2MA, gpio_configure(), GPIO_DISABLE, GPIO_FUNC_GPIO, and GPIO_PULL_DOWN.

Here is the call graph for this function:

◆ gpio_input_pullup()

void gpio_input_pullup ( gpio_t  gpio)

Definition at line 41 of file gpio.c.

References GPIO_2MA, gpio_configure(), GPIO_DISABLE, GPIO_FUNC_GPIO, and GPIO_PULL_UP.

Here is the call graph for this function:

◆ gpio_irq_status()

int gpio_irq_status ( gpio_t  gpio)

Definition at line 74 of file gpio.c.

References GPIO_INTR_STATUS_DISABLE, GPIO_INTR_STATUS_MASK, read32(), and write32().

Here is the call graph for this function:

◆ gpio_output()

void gpio_output ( gpio_t  gpio,
int  value 
)

Definition at line 53 of file gpio.c.

References GPIO_2MA, gpio_configure(), GPIO_ENABLE, GPIO_FUNC_GPIO, GPIO_NO_PULL, gpio_set(), and value.

Here is the call graph for this function:

◆ gpio_set()

void gpio_set ( gpio_t  gpio,
int  value 
)

Definition at line 21 of file gpio.c.

References GPIO_IO_OUT_SHFT, value, and write32().

Here is the call graph for this function: