wiringPi-sim
|
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... | |
void | wiringpi_helper_timespec_diff (struct timespec *start, struct timespec *stop, struct timespec *result) |
unsigned int | millis (void) |
Get time in milliseconds. More... | |
unsigned int | micros (void) |
Get time in microseconds. More... | |
void | delay (unsigned int howLongMillis) |
Wait for an amount of milliseconds. More... | |
void | delayMicroseconds (unsigned int howLongMicros) |
Wait for an amount of microseconds. More... | |
void | wiringPiVersion (int *major, int *minor) |
Get the current major and minor version number. More... | |
Variables | |
struct timespec | wiring_pi_setup_time |
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 |
void wiringpi_helper_timespec_diff | ( | struct timespec * | start, |
struct timespec * | stop, | ||
struct timespec * | result | ||
) |
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 |
struct timespec wiring_pi_setup_time |