Functions | |||
![]() | ![]() | bool | getPinStatus (int pin) |
![]() | ![]() | Returns the status of the given pin. More... | |
![]() | ![]() | byte | getAllPinStatus () |
![]() | ![]() | Returns the status of all pins as a byte value. More... | |
![]() | ![]() | char* | getAllPinStatus_string () |
![]() | ![]() | Returns the status of all pins as a string. More... | |
![]() | ![]() | void | setPin (int pin, bool set) |
![]() | ![]() | Sets the given pin to the given logical value. More... | |
![]() | ![]() | void | setAllPins (byte set) |
![]() | ![]() | Sets the status of all pins through the given number. More... | |
![]() | ![]() | void | setAllPins_string (char* setString) |
![]() | ![]() | An easy function for setting the pins. More... | |
Licence: GPL
This API was developed for easy handling the IO pins of the IPC of the SC12 from Beck GmbH. The code was inspired from a snippet which I found in the examples delivered with the original API descriptions from Beck.
This API contains functions for set the pins to the On/Off status and for query their status.
Definition in file pinapi.h.
| bool getPinStatus (int pin) |
Returns the status of the given pin.
| pin | is a number between 0 and 7 |
| byte getAllPinStatus () |
Returns the status of all pins as a byte value.
For example: Assume that pin 0 and 1 are set to logical 1 and all others are set to 0. So you got with this function an byte 3 (00000011b).
| char * getAllPinStatus_string () |
Returns the status of all pins as a string.
Within the string 1 means pinset and 0 means pinunset. The first char in the string means pin0, the second pin2,...
| void setPin (int pin, bool set) |
Sets the given pin to the given logical value.
| pin | is a number between 0 and 7 |
| set | give 0 for setting a logical 0 or give 1 for setting a logical 1 |
| void setAllPins (byte set) |
Sets the status of all pins through the given number.
For example: If you want to set pin 0 and 1 to a logical 1 and all others to 0, you will give a 3 as parameter.
| set | the mask as byte number for setting the pins |
| void setAllPins_string (char * setString) |
An easy function for setting the pins.
You can give the logical 1 or 0 for every pin as char 0 or 1. For example you want to set pin 0 and 1 to logical 1 and all others to logical 0 then you define the setString as "11000000". That ist easier for humans I think. If you want to set pins in binary format you can use the setAllPins function.
| setString | with first char is the first pin and so on |
1.0.0 written by Dimitri van Heesch,
© 1997-1999