GrowNode
gn_gpio.h File Reference

Functions

gn_leaf_descriptor_handle_t gn_gpio_config (gn_leaf_handle_t leaf_config)
 
gn_leaf_handle_t gn_gpio_fastcreate (gn_node_handle_t node, const char *leaf_name, int gpio, bool inverted, bool toggled)
 

Variables

static const char GN_LEAF_GPIO_TYPE [] = "gpio"
 
static const char GN_GPIO_PARAM_TOGGLE [] = "status"
 
static const char GN_GPIO_PARAM_INVERTED [] = "inverted"
 
static const char GN_GPIO_PARAM_GPIO [] = "gpio"
 

Function Documentation

◆ gn_gpio_config()

gn_leaf_descriptor_handle_t gn_gpio_config ( gn_leaf_handle_t  leaf_config)

◆ gn_gpio_fastcreate()

gn_leaf_handle_t gn_gpio_fastcreate ( gn_node_handle_t  node,
const char *  leaf_name,
int  gpio,
bool  inverted,
bool  toggled 
)

creates a GPIO leaf defining all parameters

Parameters
nodethe parent node
leaf_namethe name of the leaf to be created
gpiothe GPIO number to attach this leaf
invertedif the GPIO need to work in inverted mode (toggle = true -> gpio = false)
toggledthe initial status
Returns
an handle to the leaf initialized
NULL in case of errors

Variable Documentation

◆ GN_GPIO_PARAM_GPIO

const char GN_GPIO_PARAM_GPIO[] = "gpio"
static

the GPIO to connect the relay

◆ GN_GPIO_PARAM_INVERTED

const char GN_GPIO_PARAM_INVERTED[] = "inverted"
static

0 = off, 1 = on

◆ GN_GPIO_PARAM_TOGGLE

const char GN_GPIO_PARAM_TOGGLE[] = "status"
static

0 = off, 1 = on

◆ GN_LEAF_GPIO_TYPE

const char GN_LEAF_GPIO_TYPE[] = "gpio"
static