Packages
circuits_gpio
2.0.0-pre.0
2.3.0
2.2.0
2.1.3
2.1.2
retired
2.1.1
retired
2.1.0
retired
2.0.2
retired
2.0.1
retired
2.0.0
retired
2.0.0-pre.6
retired
2.0.0-pre.5
retired
2.0.0-pre.4
retired
2.0.0-pre.3
retired
2.0.0-pre.2
retired
2.0.0-pre.1
retired
2.0.0-pre.0
retired
1.2.2
1.2.1
1.2.0
1.1.0
1.0.1
1.0.0
0.4.8
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.1
0.3.0
0.2.0
0.1.0
Use GPIOs in Elixir
Retired package: Release invalid - Use v2.0.0 or later
Current section
Files
Jump to
Current section
Files
c_src/hal_sysfs.h
// SPDX-FileCopyrightText: 2018 Frank Hunleth, Mark Sebald, Matt Ludwigs
//
// SPDX-License-Identifier: Apache-2.0
#ifndef HAL_SYSFS_H
#define HAL_SYSFS_H
#include <stdint.h>
#include "erl_nif.h"
struct sysfs_priv {
ErlNifTid poller_tid;
int pipe_fds[2];
#ifdef TARGET_RPI
uint32_t *gpio_mem;
int gpio_fd;
#endif
};
struct gpio_pin;
int sysfs_read_gpio(int fd);
void *gpio_poller_thread(void *arg);
int update_polling_thread(struct gpio_pin *pin);
#ifdef TARGET_RPI
ERL_NIF_TERM rpi_info(ErlNifEnv *env, struct sysfs_priv *priv, ERL_NIF_TERM info);
int rpi_load(struct sysfs_priv *priv);
void rpi_unload(struct sysfs_priv *priv);
int rpi_apply_pull_mode(struct gpio_pin *pin);
#endif
#endif // HAL_SYSFS_H