libpifacedigital  v0.3.0
A simple static C library for controlling PiFace Digital.
 All Files Functions Pages
pifacedigital.h
Go to the documentation of this file.
1 
22 #ifndef _PIFACEDIGITAL_H
23 #define _PIFACEDIGITAL_H
24 
25 #include <stdint.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
32 #define OUTPUT 0x12 // GPIOA
33 #define INPUT 0x13 // GPIOB
34 
35 
48 int pifacedigital_open(uint8_t hw_addr);
49 
62 int pifacedigital_open_noinit(uint8_t hw_addr);
63 
74 void pifacedigital_close(uint8_t hw_addr);
75 
86 uint8_t pifacedigital_read_reg(uint8_t reg, uint8_t hw_addr);
87 
99 void pifacedigital_write_reg(uint8_t data, uint8_t reg, uint8_t hw_addr);
100 
112 uint8_t pifacedigital_read_bit(uint8_t bit_num, uint8_t reg, uint8_t hw_addr);
113 
126 void pifacedigital_write_bit(uint8_t data,
127  uint8_t bit_num,
128  uint8_t reg,
129  uint8_t hw_addr);
130 
142 uint8_t pifacedigital_digital_read(uint8_t pin_num);
143 
156 void pifacedigital_digital_write(uint8_t pin_num, uint8_t value);
157 
169 
181 
212 int pifacedigital_wait_for_input(uint8_t *data,
213  int timeout,
214  uint8_t hw_addr);
215 
216 
217 #ifdef __cplusplus
218 }
219 #endif
220 
221 #endif
uint8_t pifacedigital_read_reg(uint8_t reg, uint8_t hw_addr)
Definition: pifacedigital.c:90
int pifacedigital_open(uint8_t hw_addr)
Definition: pifacedigital.c:37
void pifacedigital_digital_write(uint8_t pin_num, uint8_t value)
Definition: pifacedigital.c:118
void pifacedigital_close(uint8_t hw_addr)
Definition: pifacedigital.c:68
int pifacedigital_wait_for_input(uint8_t *data, int timeout, uint8_t hw_addr)
Definition: pifacedigital.c:133
void pifacedigital_write_reg(uint8_t data, uint8_t reg, uint8_t hw_addr)
Definition: pifacedigital.c:95
uint8_t pifacedigital_read_bit(uint8_t bit_num, uint8_t reg, uint8_t hw_addr)
Definition: pifacedigital.c:100
uint8_t pifacedigital_digital_read(uint8_t pin_num)
Definition: pifacedigital.c:113
void pifacedigital_write_bit(uint8_t data, uint8_t bit_num, uint8_t reg, uint8_t hw_addr)
Definition: pifacedigital.c:105
int pifacedigital_disable_interrupts(void)
Definition: pifacedigital.c:128
int pifacedigital_open_noinit(uint8_t hw_addr)
Definition: pifacedigital.c:22
int pifacedigital_enable_interrupts(void)
Definition: pifacedigital.c:123