Sapphire SoC DS Sapphire SoC UG Sapphire HP SoC DS Sapphire HP SoC UG RISC-V Embedded IDE UG Board Support Package
Loading...
Searching...
No Matches

Overview

Function definitions for GPIO driver.

Functions

void gpio_applyConfig (gpio_instance_t *inst)
 Apply stored GPIO configuration to hardware.

GPIO (Get Functions)

Read values from the GPIO hardware registers.

u32 gpio_getInput (gpio_instance_t *inst)
 Read GPIO Input Register.
u32 gpio_getOutput (gpio_instance_t *inst)
 Get stored GPIO Output Value.
u32 gpio_getOutputEnable (gpio_instance_t *inst)
 Get stored GPIO Output Enable Mask.
u32 gpio_getInterruptRiseEnable (gpio_instance_t *inst)
 Get Rising Edge Interrupt Mask.
u32 gpio_getInterruptFallEnable (gpio_instance_t *inst)
 Get Falling Edge Interrupt Mask.
u32 gpio_getInterruptHighEnable (gpio_instance_t *inst)
 Get High Level Interrupt Mask.
u32 gpio_getInterruptLowEnable (gpio_instance_t *inst)
 Get Low Level Interrupt Mask.

GPIO (Set Functions)

Write values to the GPIO registers.

Note
Call gpio_applyConfig() to make these changes effective.
void gpio_setOutput (gpio_instance_t *inst, u32 value)
 Set GPIO Output Value.
void gpio_setOutputEnable (gpio_instance_t *inst, u32 value)
 Set GPIO Output Enable (Direction).
void gpio_setInterruptRiseEnable (gpio_instance_t *inst, u32 value)
 Set Rising Edge Interrupt Enable.
void gpio_setInterruptFallEnable (gpio_instance_t *inst, u32 value)
 Set Falling Edge Interrupt Enable.
void gpio_setInterruptHighEnable (gpio_instance_t *inst, u32 value)
 Set High Level Interrupt Enable.
void gpio_setInterruptLowEnable (gpio_instance_t *inst, u32 value)
 Set Low Level Interrupt Enable.

Function Documentation

◆ gpio_applyConfig()

void gpio_applyConfig ( gpio_instance_t * inst)

#include <gpio.h>

Apply stored GPIO configuration to hardware.

Writes all configuration values to the corresponding hardware registers.

Parameters
instPointer to GPIO instance.

Definition at line 87 of file gpio.c.

◆ gpio_getInput()

u32 gpio_getInput ( gpio_instance_t * inst)

#include <gpio.h>

Read GPIO Input Register.

Parameters
instPointer to GPIO instance.
Returns
Current state of the input pins.

Definition at line 52 of file gpio.c.

◆ gpio_getInterruptFallEnable()

u32 gpio_getInterruptFallEnable ( gpio_instance_t * inst)

#include <gpio.h>

Get Falling Edge Interrupt Mask.

Parameters
instPointer to GPIO instance.
Returns
The current falling edge interrupt enable mask.

Definition at line 72 of file gpio.c.

◆ gpio_getInterruptHighEnable()

u32 gpio_getInterruptHighEnable ( gpio_instance_t * inst)

#include <gpio.h>

Get High Level Interrupt Mask.

Parameters
instPointer to GPIO instance.
Returns
The current high level interrupt enable mask.

Definition at line 77 of file gpio.c.

◆ gpio_getInterruptLowEnable()

u32 gpio_getInterruptLowEnable ( gpio_instance_t * inst)

#include <gpio.h>

Get Low Level Interrupt Mask.

Parameters
instPointer to GPIO instance.
Returns
The current low level interrupt enable mask.

Definition at line 82 of file gpio.c.

◆ gpio_getInterruptRiseEnable()

u32 gpio_getInterruptRiseEnable ( gpio_instance_t * inst)

#include <gpio.h>

Get Rising Edge Interrupt Mask.

Parameters
instPointer to GPIO instance.
Returns
The current rising edge interrupt enable mask.

Definition at line 67 of file gpio.c.

◆ gpio_getOutput()

u32 gpio_getOutput ( gpio_instance_t * inst)

#include <gpio.h>

Get stored GPIO Output Value.

Parameters
instPointer to GPIO instance.
Returns
The value currently set in the output register.

Definition at line 57 of file gpio.c.

◆ gpio_getOutputEnable()

u32 gpio_getOutputEnable ( gpio_instance_t * inst)

#include <gpio.h>

Get stored GPIO Output Enable Mask.

Parameters
instPointer to GPIO instance.
Returns
The current output enable (direction) mask.

Definition at line 62 of file gpio.c.

◆ gpio_setInterruptFallEnable()

void gpio_setInterruptFallEnable ( gpio_instance_t * inst,
u32 value )

#include <gpio.h>

Set Falling Edge Interrupt Enable.

Parameters
instPointer to GPIO instance.
valueBitmask where 1 = Enable Interrupt.

Definition at line 37 of file gpio.c.

◆ gpio_setInterruptHighEnable()

void gpio_setInterruptHighEnable ( gpio_instance_t * inst,
u32 value )

#include <gpio.h>

Set High Level Interrupt Enable.

Parameters
instPointer to GPIO instance.
valueBitmask where 1 = Enable Interrupt.

Definition at line 42 of file gpio.c.

◆ gpio_setInterruptLowEnable()

void gpio_setInterruptLowEnable ( gpio_instance_t * inst,
u32 value )

#include <gpio.h>

Set Low Level Interrupt Enable.

Parameters
instPointer to GPIO instance.
valueBitmask where 1 = Enable Interrupt.

Definition at line 47 of file gpio.c.

◆ gpio_setInterruptRiseEnable()

void gpio_setInterruptRiseEnable ( gpio_instance_t * inst,
u32 value )

#include <gpio.h>

Set Rising Edge Interrupt Enable.

Parameters
instPointer to GPIO instance.
valueBitmask where 1 = Enable Interrupt.

Definition at line 32 of file gpio.c.

◆ gpio_setOutput()

void gpio_setOutput ( gpio_instance_t * inst,
u32 value )

#include <gpio.h>

Set GPIO Output Value.

Parameters
instPointer to GPIO instance.
valueBitmask of pins to set high/low.

Definition at line 22 of file gpio.c.

◆ gpio_setOutputEnable()

void gpio_setOutputEnable ( gpio_instance_t * inst,
u32 value )

#include <gpio.h>

Set GPIO Output Enable (Direction).

Parameters
instPointer to GPIO instance.
valueBitmask where 1 = Output, 0 = Input.

Definition at line 27 of file gpio.c.