TT-System-Firmware APIs 19.10.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
gpio_tt_grendel.c File Reference
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/gpio/gpio_utils.h>
#include <zephyr/sys/sys_io.h>
#include <platform.h>
Include dependency graph for gpio_tt_grendel.c:

Data Structures

struct  gpio_grendel_config
struct  gpio_grendel_data

Macros

#define DT_DRV_COMPAT   tenstorrent_grendel_gpio
#define GPIO_REG_SPACING   0x10
#define gpio_grendel_INIT(inst)

Functions

static int gpio_grendel_pin_configure (const struct device *dev, gpio_pin_t pin, gpio_flags_t flags)
static int gpio_grendel_port_get_raw (const struct device *dev, uint32_t *value)
static int gpio_grendel_port_set_masked_raw (const struct device *dev, uint32_t mask, uint32_t value)
static int gpio_grendel_port_set_bits_raw (const struct device *dev, uint32_t pins)
static int gpio_grendel_port_clear_bits_raw (const struct device *dev, uint32_t pins)
static int gpio_grendel_port_toggle_bits (const struct device *dev, uint32_t pins)
static int gpio_grendel_pin_interrupt_configure (const struct device *dev, gpio_pin_t pin, enum gpio_int_mode mode, enum gpio_int_trig trig)
static DEVICE_API (gpio, gpio_grendel_api_funcs)
static int gpio_grendel_initialize (const struct device *dev)

Macro Definition Documentation

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   tenstorrent_grendel_gpio

◆ gpio_grendel_INIT

#define gpio_grendel_INIT ( inst)
Value:
static struct gpio_grendel_data gpio_grendel_data_##inst; \
static const struct gpio_grendel_config gpio_grendel_config_##inst = { \
.common = \
{ \
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(inst), \
}, \
.base_addr = DT_INST_REG_ADDR(inst), \
}; \
DEVICE_DT_INST_DEFINE(inst, gpio_grendel_initialize, NULL, &gpio_grendel_data_##inst, \
&gpio_grendel_config_##inst, PRE_KERNEL_1, \
CONFIG_GPIO_INIT_PRIORITY, &gpio_grendel_api_funcs);
#define NULL
Definition avs.c:45
static int gpio_grendel_initialize(const struct device *dev)
Definition gpio_tt_grendel.c:192
#define DT_INST_REG_ADDR(inst)
#define GPIO_PORT_PIN_MASK_FROM_DT_INST(inst)
Definition gpio_tt_grendel.c:15
Definition gpio_tt_grendel.c:21

◆ GPIO_REG_SPACING

#define GPIO_REG_SPACING   0x10

Function Documentation

◆ DEVICE_API()

DEVICE_API ( gpio ,
gpio_grendel_api_funcs  )
static

◆ gpio_grendel_initialize()

int gpio_grendel_initialize ( const struct device * dev)
static

◆ gpio_grendel_pin_configure()

int gpio_grendel_pin_configure ( const struct device * dev,
gpio_pin_t pin,
gpio_flags_t flags )
static

◆ gpio_grendel_pin_interrupt_configure()

int gpio_grendel_pin_interrupt_configure ( const struct device * dev,
gpio_pin_t pin,
enum gpio_int_mode mode,
enum gpio_int_trig trig )
static

◆ gpio_grendel_port_clear_bits_raw()

int gpio_grendel_port_clear_bits_raw ( const struct device * dev,
uint32_t pins )
static

◆ gpio_grendel_port_get_raw()

int gpio_grendel_port_get_raw ( const struct device * dev,
uint32_t * value )
static

◆ gpio_grendel_port_set_bits_raw()

int gpio_grendel_port_set_bits_raw ( const struct device * dev,
uint32_t pins )
static

◆ gpio_grendel_port_set_masked_raw()

int gpio_grendel_port_set_masked_raw ( const struct device * dev,
uint32_t mask,
uint32_t value )
static

◆ gpio_grendel_port_toggle_bits()

int gpio_grendel_port_toggle_bits ( const struct device * dev,
uint32_t pins )
static