24 #include <sys/types.h>
26 #include "libpruio/pruio.h"
27 #include "libpruio/pruio_pins.h"
43 struct timeval timeout;
47 FD_SET(STDIN_FILENO, &set);
51 timeout.tv_usec = mseconds * 1000;
53 return TEMP_FAILURE_RETRY(select(FD_SETSIZE,
59 int main(
int argc,
char **argv)
64 printf(
"initialisation failed (%s)\n",
io->Errr);
break;}
67 printf(
"GPIO configuration failed (%s)\n",
io->Errr);
break;}
70 printf(
"config failed (%s)\n",
io->Errr);
break;}
72 struct termios oldt, newt;
73 tcgetattr( STDIN_FILENO, &oldt );
75 newt.c_lflag &= ~( ICANON | ECHO );
78 tcsetattr(STDIN_FILENO, TCSANOW, &newt);
84 tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
90 printf(
"GPIO configuration failed (%s)\n",
io->Errr);
break;}
VAR io
create new driver UDT
char * pruio_config(pruIo *Io, uint32 Samp, uint32 Mask, uint32 Tmr, uint16 Mds)
Wrapper function for PruIo::config().
uint32 pruio_gpio_Value(pruIo *Io, uint8 Ball)
Wrapper function for GpioUdt::Value().
pruIo * pruio_new(uint16 Act, uint8 Av, uint32 OpD, uint8 SaD)
Wrapper function for the constructor PruIo::PruIo().
@ PRUIO_GPIO_IN_0
GPIO input (pulldown resistor).
char * pruio_gpio_config(pruIo *Io, uint8 Ball, uint8 Modus)
Wrapper function for GpioUdt::config().
void pruio_destroy(pruIo *Io)
Wrapper function for the destructor PruIo::~PruIo().
@ PRUIO_DEF_ACTIVE
Activate all subsystems.
const ANY_PTR NULL
The NULL pointer.
Wrapper structure for PruIo.