Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
sol-gpio.h File Reference

These routines are used for GPIO access under Soletta. More...

#include <stdbool.h>
#include <stdint.h>
#include <sol-common-buildopts.h>
#include <sol-macros.h>

Go to the source code of this file.

Data Structures

struct  sol_gpio_config
 Structure to hold the configuration of a GPIO device. More...
 

Macros

#define SOL_GPIO_CONFIG_API_VERSION   (1)
 

Typedefs

typedef struct sol_gpio sol_gpio
 A handle to a GPIO. More...
 
typedef struct sol_gpio_config sol_gpio_config
 Structure to hold the configuration of a GPIO device. More...
 

Enumerations

enum  sol_gpio_direction { SOL_GPIO_DIR_OUT = 0, SOL_GPIO_DIR_IN = 1 }
 Possible values for the direction of a GPIO. More...
 
enum  sol_gpio_drive { SOL_GPIO_DRIVE_NONE = 0, SOL_GPIO_DRIVE_PULL_UP, SOL_GPIO_DRIVE_PULL_DOWN }
 Possible values for pull-up or pull-down resistor of a GPIO. More...
 
enum  sol_gpio_edge { SOL_GPIO_EDGE_NONE = 0, SOL_GPIO_EDGE_RISING, SOL_GPIO_EDGE_FALLING, SOL_GPIO_EDGE_BOTH }
 Possible values for the edge mode of a GPIO. More...
 

Functions

void sol_gpio_close (struct sol_gpio *gpio)
 Closes a given GPIO pin. More...
 
enum sol_gpio_direction sol_gpio_direction_from_str (const char *direction)
 Converts a string GPIO direction to sol_gpio_direction. More...
 
const char * sol_gpio_direction_to_str (enum sol_gpio_direction direction)
 Converts sol_gpio_direction to a string name. More...
 
enum sol_gpio_drive sol_gpio_drive_from_str (const char *drive)
 Converts a string GPIO drive to sol_gpio_drive. More...
 
const char * sol_gpio_drive_to_str (enum sol_gpio_drive drive)
 Converts sol_gpio_drive to a string name. More...
 
enum sol_gpio_edge sol_gpio_edge_from_str (const char *edge)
 Converts a string GPIO edge to sol_gpio_edge. More...
 
const char * sol_gpio_edge_to_str (enum sol_gpio_edge edge)
 Converts sol_gpio_edge to a string name. More...
 
struct sol_gpiosol_gpio_open (uint32_t pin, const struct sol_gpio_config *config)
 Opens a given pin as general purpose input or output. More...
 
struct sol_gpiosol_gpio_open_by_label (const char *label, const struct sol_gpio_config *config)
 Opens a given pin by its board label as general purpose input or output. More...
 
struct sol_gpiosol_gpio_open_raw (uint32_t pin, const struct sol_gpio_config *config)
 Opens a given pin as general purpose input or output. More...
 
int sol_gpio_read (struct sol_gpio *gpio)
 Get the current value set to pin. More...
 
bool sol_gpio_write (struct sol_gpio *gpio, bool value)
 Set an arbitrary value to pin. More...
 

Detailed Description

These routines are used for GPIO access under Soletta.

Macro Definition Documentation

#define SOL_GPIO_CONFIG_API_VERSION   (1)