Yet Another WebIOPi+
 All Classes Namespaces Files Functions Variables Macros Pages
Classes | Macros | Functions
gpio.h File Reference

Go to the source code of this file.

Classes

struct  pulse
 

Macros

#define SETUP_OK   0
 
#define SETUP_DEVMEM_FAIL   1
 
#define SETUP_MALLOC_FAIL   2
 
#define SETUP_MMAP_FAIL   3
 
#define GPIO_COUNT   54
 
#define IN   0
 
#define OUT   1
 
#define ALT5   2
 
#define ALT4   3
 
#define ALT0   4
 
#define ALT1   5
 
#define ALT2   6
 
#define ALT3   7
 
#define PWM   8
 
#define LOW   0
 
#define HIGH   1
 
#define PUD_OFF   0
 
#define PUD_DOWN   1
 
#define PUD_UP   2
 
#define RATIO   1
 
#define ANGLE   2
 

Functions

int setup (void)
 
int get_function (int gpio)
 
void set_function (int gpio, int function, int pud)
 
int input (int gpio)
 
void output (int gpio, int value)
 
void outputSequence (int gpio, int period, char *sequence)
 
struct pulsegetPulse (int gpio)
 
void pulseMilli (int gpio, int up, int down)
 
void pulseMilliRatio (int gpio, int width, float ratio)
 
void pulseMicro (int gpio, int up, int down)
 
void pulseMicroRatio (int gpio, int width, float ratio)
 
void pulseAngle (int gpio, float angle)
 
void pulseRatio (int gpio, float ratio)
 
void enablePWM (int gpio)
 
void disablePWM (int gpio)
 
int isPWMEnabled (int gpio)
 
void cleanup (void)
 

Macro Definition Documentation

#define ALT0   4

Definition at line 34 of file gpio.h.

Referenced by initGPIO().

#define ALT1   5

Definition at line 35 of file gpio.h.

Referenced by initGPIO().

#define ALT2   6

Definition at line 36 of file gpio.h.

Referenced by initGPIO().

#define ALT3   7

Definition at line 37 of file gpio.h.

Referenced by initGPIO().

#define ALT4   3

Definition at line 33 of file gpio.h.

Referenced by initGPIO().

#define ALT5   2

Definition at line 32 of file gpio.h.

Referenced by initGPIO().

#define ANGLE   2

Definition at line 48 of file gpio.h.

Referenced by pulseAngle().

#define GPIO_COUNT   54
#define HIGH   1

Definition at line 41 of file gpio.h.

Referenced by initGPIO().

#define IN   0

Definition at line 30 of file gpio.h.

Referenced by initGPIO(), and py_set_function().

#define LOW   0

Definition at line 40 of file gpio.h.

Referenced by initGPIO().

#define OUT   1
#define PUD_DOWN   1

Definition at line 44 of file gpio.h.

Referenced by initGPIO(), py_set_function(), and set_pullupdn().

#define PUD_OFF   0

Definition at line 43 of file gpio.h.

Referenced by initGPIO(), and py_set_function().

#define PUD_UP   2

Definition at line 45 of file gpio.h.

Referenced by initGPIO(), py_set_function(), and set_pullupdn().

#define PWM   8
#define RATIO   1

Definition at line 47 of file gpio.h.

Referenced by pulseRatio().

#define SETUP_DEVMEM_FAIL   1

Definition at line 24 of file gpio.h.

Referenced by module_setup(), and setup().

#define SETUP_MALLOC_FAIL   2

Definition at line 25 of file gpio.h.

Referenced by module_setup(), and setup().

#define SETUP_MMAP_FAIL   3

Definition at line 26 of file gpio.h.

Referenced by module_setup(), and setup().

#define SETUP_OK   0

Function Documentation

void cleanup ( void  )

Definition at line 332 of file gpio.c.

References BLOCK_SIZE, and gpio_map.

Referenced by initGPIO().

void disablePWM ( int  gpio)

Definition at line 314 of file gpio.c.

References webiopi-client::gpio, gpio_threads, output(), and resetPWM().

Referenced by py_disablePWM(), and set_function().

void enablePWM ( int  gpio)

Definition at line 300 of file gpio.c.

References webiopi-client::gpio, gpio_threads, pwmLoop(), and resetPWM().

Referenced by py_enablePWM(), and set_function().

int get_function ( int  gpio)
struct pulse* getPulse ( int  gpio)

Definition at line 286 of file gpio.c.

References webiopi-client::gpio, and gpio_pulses.

Referenced by py_getPulse().

int input ( int  gpio)

Definition at line 153 of file gpio.c.

References gpio_map, PINLEVEL_OFFSET, and webiopi-client::value.

Referenced by py_input().

int isPWMEnabled ( int  gpio)

Definition at line 327 of file gpio.c.

References webiopi-client::gpio, and gpio_threads.

Referenced by get_function(), and py_isPWMEnabled().

void output ( int  gpio,
int  value 
)

Definition at line 163 of file gpio.c.

References CLR_OFFSET, gpio_map, and SET_OFFSET.

Referenced by disablePWM(), outputSequence(), pulseTS(), and py_output().

void outputSequence ( int  gpio,
int  period,
char *  sequence 
)

Definition at line 178 of file gpio.c.

References output(), and webiopi-client::value.

Referenced by py_output_sequence().

void pulseAngle ( int  gpio,
float  angle 
)

Definition at line 269 of file gpio.c.

References ANGLE, webiopi-client::gpio, gpio_pulses, pulseMicro(), pulse::type, and pulse::value.

Referenced by py_pulseAngle().

void pulseMicro ( int  gpio,
int  up,
int  down 
)

Definition at line 250 of file gpio.c.

References pulseOrSaveTS().

Referenced by pulseAngle(), pulseMicroRatio(), pulseRatio(), and py_pulseMicro().

void pulseMicroRatio ( int  gpio,
int  width,
float  ratio 
)

Definition at line 262 of file gpio.c.

References pulseMicro().

Referenced by py_pulseMicroRatio().

void pulseMilli ( int  gpio,
int  up,
int  down 
)

Definition at line 231 of file gpio.c.

References pulseOrSaveTS().

Referenced by pulseMilliRatio(), and py_pulseMilli().

void pulseMilliRatio ( int  gpio,
int  width,
float  ratio 
)

Definition at line 243 of file gpio.c.

References pulseMilli().

Referenced by py_pulseMilliRatio().

void pulseRatio ( int  gpio,
float  ratio 
)

Definition at line 278 of file gpio.c.

References webiopi-client::gpio, gpio_pulses, pulseMicro(), RATIO, pulse::type, and pulse::value.

Referenced by py_pulse(), and py_pulseRatio().

void set_function ( int  gpio,
int  function,
int  pud 
)

Definition at line 121 of file gpio.c.

References disablePWM(), enablePWM(), FSEL_OFFSET, gpio_map, OUT, PWM, and set_pullupdn().

Referenced by py_set_function().

int setup ( void  )