16 from libpruio
import *
25 io =
pruio_new(PRUIO_DEF_ACTIVE, 4, 0x98, 0)
29 if IO.Errr:
raise AssertionError(
"pruio_new failed (%s)" % IO.Errr)
31 raise AssertionError(
"config failed (%s)" % IO.Errr)
34 AdcV = IO.Adc.contents.Value
36 GpiV = IO.Gpio.contents.Raw
39 stdscr.addstr(5,0,
"Press any key to quit")
42 stdscr.addstr(i,0,
"{:032b}".format(GpiV[i].contents.Mix))
44 stdscr.addstr(4,(i-1)*5,
"{:04X}".format(AdcV[i]))
49 if __name__ ==
"__main__":
50 curses.wrapper(io_input)
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().