wiringPi-sim
|
#include <wiringPi/version.h>
Go to the source code of this file.
Macros | |
#define | TRUE (1==1) |
Logical TRUE. More... | |
#define | FALSE (!TRUE) |
Logical FALSE. More... | |
#define | INPUT 0 |
Pin type: input. More... | |
#define | OUTPUT 1 |
Pin type: output. More... | |
#define | PWM_OUTPUT 2 |
Pin type: PWM output. More... | |
#define | GPIO_CLOCK 3 |
Pin type: GPIO clock. More... | |
#define | SOFT_PWM_OUTPUT 4 |
Pin type: soft PWM output. More... | |
#define | SOFT_TONE_OUTPUT 5 |
Pin type: soft tone ouput. More... | |
#define | PWM_TONE_OUTPUT 6 |
Pin type: PWM tone output. More... | |
#define | LOW 0 |
Digital LOW. More... | |
#define | HIGH 1 |
Digital HIGH. More... | |
#define | PUD_OFF 0 |
Pull Up/Down resistor: off. More... | |
#define | PUD_DOWN 1 |
Pull Up/Down resistor: down. More... | |
#define | PUD_UP 2 |
Pull Up/Down resistor: up. More... | |
#define | PWM_MODE_MS 0 |
PWM milliseconds mode. More... | |
#define | PWM_MODE_BAL 1 |
PWM balanced mode. More... | |
#define | INT_EDGE_SETUP 0 |
#define | INT_EDGE_FALLING 1 |
Interrupt triggered on the falling edge. More... | |
#define | INT_EDGE_RISING 2 |
Interrupt triggered on the rising edge. More... | |
#define | INT_EDGE_BOTH 3 |
Interrupt triggered on BOTH edges. More... | |
Functions | |
int | wiringPiSetup (void) |
Must be called once at the start of your program execution. More... | |
int | wiringPiSetupGpio (void) |
Must be called once at the start of your program execution. More... | |
int | wiringPiSetupPhys (void) |
Must be called once at the start of your program execution. More... | |
int | wiringPiSetupSys (void) |
Must be called once at the start of your program execution. More... | |
int | wiringPiISR (int pin, int edgeType, void(*function)(void)) |
Register a Interrupt Service Routine (ISR) - Pi Specific. More... | |
void | pinMode (int pin, int mode) |
Sets the mode of a pin to be input, output or PWM output. More... | |
void | pullUpDnControl (int pin, int pud) |
Control the internal pull-up/down resistors on a GPIO pin. More... | |
void | digitalWrite (int pin, int value) |
Set an output bit. More... | |
void | pwmWrite (int pin, int value) |
Set an output PWM value. More... | |
int | digitalRead (int pin) |
Read the value of a given Pin. More... | |
int | analogRead (int pin) |
Read the analogue value of a given Pin. More... | |
void | analogWrite (int pin, int value) |
Write the analog value to the given Pin. More... | |
int | waitForInterrupt (int pin, int timeOut, int mode) |
When called, it will wait for an interrupt event to happen on that pin and your program will be stalled.. More... | |
unsigned int | millis (void) |
Get time in milliseconds. More... | |
unsigned int | micros (void) |
Get time in microseconds. More... | |
void | delay (unsigned int howLong) |
Wait for an amount of milliseconds. More... | |
void | delayMicroseconds (unsigned int howLong) |
Wait for an amount of microseconds. More... | |
void | wiringPiVersion (int *major, int *minor) |
Get the current major and minor version number. More... | |
#define FALSE (!TRUE) |
Logical FALSE.
#define GPIO_CLOCK 3 |
Pin type: GPIO clock.
#define HIGH 1 |
Digital HIGH.
#define INPUT 0 |
Pin type: input.
#define INT_EDGE_BOTH 3 |
Interrupt triggered on BOTH edges.
#define INT_EDGE_FALLING 1 |
Interrupt triggered on the falling edge.
#define INT_EDGE_RISING 2 |
Interrupt triggered on the rising edge.
#define INT_EDGE_SETUP 0 |
If INT_EDGE_SETUP is used for wiringPiISR, it is assumed that the pin is assumed that you have already setup the pin elsewhere (e.g. with the gpio program)
#define LOW 0 |
Digital LOW.
#define OUTPUT 1 |
Pin type: output.
#define PUD_DOWN 1 |
Pull Up/Down resistor: down.
#define PUD_OFF 0 |
Pull Up/Down resistor: off.
#define PUD_UP 2 |
Pull Up/Down resistor: up.
#define PWM_MODE_BAL 1 |
PWM balanced mode.
#define PWM_MODE_MS 0 |
PWM milliseconds mode.
#define PWM_OUTPUT 2 |
Pin type: PWM output.
#define PWM_TONE_OUTPUT 6 |
Pin type: PWM tone output.
#define SOFT_PWM_OUTPUT 4 |
Pin type: soft PWM output.
#define SOFT_TONE_OUTPUT 5 |
Pin type: soft tone ouput.
#define TRUE (1==1) |
Logical TRUE.
int analogRead | ( | int | pin | ) |
void analogWrite | ( | int | pin, |
int | value | ||
) |
Write the analog value to the given Pin.
There is no on-board Pi analog hardware, so this needs to go to a new node.
pin | Pin number |
value | Value |
void delay | ( | unsigned int | howLong | ) |
Wait for an amount of milliseconds.
howLong | Milliseconds to wait |
void delayMicroseconds | ( | unsigned int | howLong | ) |
Wait for an amount of microseconds.
howLong | Microseconds to wait |
int digitalRead | ( | int | pin | ) |
void digitalWrite | ( | int | pin, |
int | value | ||
) |
Set an output bit.
pin | Pin number |
value | PWM value |
unsigned int micros | ( | void | ) |
Get time in microseconds.
Wraps after 71 minutes.
unsigned int millis | ( | void | ) |
Get time in milliseconds.
Wraps after 49 days.
void pinMode | ( | int | pin, |
int | mode | ||
) |
Sets the mode of a pin to be input, output or PWM output.
pin | Pin number |
mode | Pin type (INPUT, OUTPUT, PWM_OUTPUT, etc.) |
void pullUpDnControl | ( | int | pin, |
int | pud | ||
) |
void pwmWrite | ( | int | pin, |
int | value | ||
) |
int waitForInterrupt | ( | int | pin, |
int | timeOut, | ||
int | mode | ||
) |
When called, it will wait for an interrupt event to happen on that pin and your program will be stalled..
The timeOut parameter is given in milliseconds, or can be -1 which means to wait forever.
pin | Pin number |
timeout | Timeout (milliseconds) |
mode | INT_EDGE_SETUP, INT_EDGE_FALLING, INT_EDGE_RISING, INT_EDGE_BOTH |
int wiringPiISR | ( | int | pin, |
int | edgeType, | ||
void(*)(void) | function | ||
) |
Register a Interrupt Service Routine (ISR) - Pi Specific.
pin | Pin number |
edgeType | INT_EDGE_SETUP, INT_EDGE_FALLING, INT_EDGE_RISING, INT_EDGE_BOTH |
function | The ISR callback function |
int wiringPiSetup | ( | void | ) |
Must be called once at the start of your program execution.
Default setup: Initialises the system into wiringPi Pin mode and uses the memory mapped hardware directly.
int wiringPiSetupGpio | ( | void | ) |
Must be called once at the start of your program execution.
GPIO setup: Initialises the system into GPIO Pin mode and uses the memory mapped hardware directly.
int wiringPiSetupPhys | ( | void | ) |
Must be called once at the start of your program execution.
Phys setup: Initialises the system into Physical Pin mode and uses the memory mapped hardware directly.
int wiringPiSetupSys | ( | void | ) |
Must be called once at the start of your program execution.
Initialisation (again), however this time we are using the /sys/class/gpio interface to the GPIO systems - slightly slower, but always usable as a non-root user, assuming the devices are already exported and setup correctly.
void wiringPiVersion | ( | int * | major, |
int * | minor | ||
) |
Get the current major and minor version number.
[out] | major | Major version number |
[out] | minor | Minor version number |