# __DRIVER_CODE__ imports
import portio

# __DRIVER_CODE__ variables

# temporary pointer to pass to output APIs
cdef uint8_t *outBuf
cdef size_t sentBytes
cdef size_t outBufLen


# __DRIVER_CODE__ setup

# make sure parport is writeable
if (portio.ioperm(0x{{out_signal['args']['addr']}}, 1, 1)):
  die("io permission denied\n")

# __DRIVER_CODE__ write

  portio.outb(<unsigned char>outBuf[0],0x{{out_signal['args']['addr']}})


# __DRIVER_CODE__ exit_handler
