22 #include <sys/types.h>
24 #include "libpruio/pruio.h"
38 struct timeval timeout;
42 FD_SET(STDIN_FILENO, &set);
46 timeout.tv_usec = mseconds * 1000;
48 return TEMP_FAILURE_RETRY(select(FD_SETSIZE,
54 int main(
int argc,
char **argv)
59 printf(
"initialisation failed (%s)\n",
io->Errr);
break;}
62 printf(
"config failed (%s)\n",
io->Errr);
break;}
64 struct termios oldt, newt;
65 tcgetattr( STDIN_FILENO, &oldt );
67 newt.c_lflag &= ~( ICANON | ECHO );
70 tcsetattr(STDIN_FILENO, TCSANOW, &newt);
73 printf(
"\r%8X %8X %8X %8X %4X %4X %4X %4X %4X %4X %4X %4X"
74 ,
io->Gpio->Raw[0]->Mix,
io->Gpio->Raw[1]->Mix,
io->Gpio->Raw[2]->Mix,
io->Gpio->Raw[3]->Mix
75 ,
io->Adc->Value[1],
io->Adc->Value[2],
io->Adc->Value[3],
io->Adc->Value[4]
76 ,
io->Adc->Value[5],
io->Adc->Value[6],
io->Adc->Value[7],
io->Adc->Value[8]);
79 tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
VAR io
create new driver UDT
char * pruio_config(pruIo *Io, uint32 Samp, uint32 Mask, uint32 Tmr, uint16 Mds)
Wrapper function for PruIo::config().
pruIo * pruio_new(uint16 Act, uint8 Av, uint32 OpD, uint8 SaD)
Wrapper function for the constructor PruIo::PruIo().
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.