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 pulse * | getPulse (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) |
#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 |
Definition at line 28 of file gpio.h.
Referenced by initGPIO(), py_disablePWM(), py_enablePWM(), py_get_function(), py_get_function_string(), py_getPulse(), py_input(), py_isPWMEnabled(), py_output(), py_output_sequence(), py_pulse(), py_pulseAngle(), py_pulseMicro(), py_pulseMicroRatio(), py_pulseMilli(), py_pulseMilliRatio(), py_pulseRatio(), and py_set_function().
#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 |
Definition at line 31 of file gpio.h.
Referenced by get_function(), initGPIO(), py_output(), py_output_sequence(), py_pulseAngle(), py_pulseMicro(), py_pulseMicroRatio(), py_pulseMilli(), py_pulseMilliRatio(), py_pulseRatio(), py_set_function(), and set_function().
#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 |
Definition at line 38 of file gpio.h.
Referenced by get_function(), initGPIO(), Test::main(), py_pulseAngle(), py_pulseMicro(), py_pulseMicroRatio(), py_pulseMilli(), py_pulseMilliRatio(), py_pulseRatio(), py_set_function(), and set_function().
#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 |
Definition at line 23 of file gpio.h.
Referenced by module_setup(), py_disablePWM(), py_enablePWM(), py_get_function(), py_get_function_string(), py_getPulse(), py_input(), py_isPWMEnabled(), py_output(), py_output_sequence(), py_pulse(), py_pulseAngle(), py_pulseMicro(), py_pulseMicroRatio(), py_pulseMilli(), py_pulseMilliRatio(), py_pulseRatio(), py_set_function(), and setup().
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 | ) |
Definition at line 139 of file gpio.c.
References FSEL_OFFSET, gpio_map, isPWMEnabled(), OUT, PWM, and webiopi-client::value.
Referenced by py_get_function(), py_get_function_string(), py_output(), py_output_sequence(), py_pulseAngle(), py_pulseMicro(), py_pulseMicroRatio(), py_pulseMilli(), py_pulseMilliRatio(), and py_pulseRatio().
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 | ||
) |
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 | ||
) |
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 | ) |
Definition at line 93 of file cambot.py.
References BCM2708_GPIO_BASE, BCM2709_GPIO_BASE, BLOCK_SIZE, get_rpi_revision(), gpio_map, number_of_cores(), PAGE_SIZE, cambot::set_speed(), cambot::setup(), SETUP_DEVMEM_FAIL, SETUP_MALLOC_FAIL, SETUP_MMAP_FAIL, SETUP_OK, and cambot::stop().
Referenced by webiopi.utils.loader::loadScript(), module_setup(), and setup().