gpio_arch.h File Reference

Architecture specific GPIO functions for ESP32. More...

Detailed Description

Architecture specific GPIO functions for ESP32.

Author
Gunar Schorcht gunar.nosp@m.@sch.nosp@m.orcht.nosp@m..net

Definition in file gpio_arch.h.

#include "gpio_arch_common.h"
#include "periph/gpio.h"
#include "soc/io_mux_reg.h"
#include "soc/gpio_sig_map.h"
+ Include dependency graph for gpio_arch.h:

Go to the source code of this file.

Enumerations

enum  gpio_drive_strength_t { GPIO_DRIVE_5 = 0, GPIO_DRIVE_10 = 1, GPIO_DRIVE_20 = 2, GPIO_DRIVE_30 = 2 }
 Current an output pin can drive in active and sleep modes. More...
 

Functions

int gpio_set_drive_capability (gpio_t pin, gpio_drive_strength_t drive)
 Set the drive-strength of an output-capable pin. More...
 
void gpio_pm_sleep_enter (unsigned mode)
 Called before the power management enters a light or deep sleep mode. More...
 
void gpio_pm_sleep_exit (uint32_t cause)
 Called after the power management left light sleep mode. More...
 

Enumeration Type Documentation

◆ gpio_drive_strength_t

Current an output pin can drive in active and sleep modes.

Enumerator
GPIO_DRIVE_5 

5 mA

GPIO_DRIVE_10 

10 mA

GPIO_DRIVE_20 

20 mA (default)

GPIO_DRIVE_30 

30 mA

Definition at line 35 of file gpio_arch.h.

Function Documentation

◆ gpio_pm_sleep_enter()

void gpio_pm_sleep_enter ( unsigned  mode)

Called before the power management enters a light or deep sleep mode.

Parameters
modesleep mode that is entered

◆ gpio_pm_sleep_exit()

void gpio_pm_sleep_exit ( uint32_t  cause)

Called after the power management left light sleep mode.

Parameters
causewake-up cause

◆ gpio_set_drive_capability()

int gpio_set_drive_capability ( gpio_t  pin,
gpio_drive_strength_t  drive 
)

Set the drive-strength of an output-capable pin.

Sets the drive-strength for an output-capable pin in active and sleep modes. The default drive-strength is GPIO_DRIVE_20 (20 mA).

Parameters
pinGPIO pin
drivedrive-strength GPIO_DRIVE_5 for 5 mA GPIO_DRIVE_10 for 10 mA GPIO_DRIVE_20 for 20 mA (default) GPIO_DRIVE_30 for 30 mA
Precondition
pin is an output-capable pin
Postcondition
an assertion blows up if the pin is not output-capable
Returns
0 on success -1 on error