Synchronous Port Manipulation on Due

stimmer:
You're almost there - what you have to do is use REG_PIOC_OWER and REG_PIOC_OWDR to mask off which pins you want to alter before writing REG_PIOC_ODSR to change them - the other bits will stay as outputs and stay unchanged.
REG_PIOC_OWER = 0x000003FC ; REG_PIOC_OWDR = 0x000FF000 ; lets you change 2-9 leaving 12-19 unchanged
REG_PIOC_OWER = 0x000FF000 ; REG_PIOC_OWDR = 0x000003FC ; lets you change 12-19 leaving 2-9 unchanged

how can i do the same thing but instead of setting them as output, use them as input?
I have tried this but it does not seem to work

    REG_PIOC_ODR = 0x3fc;
    REG_PIOC_PER = 0x3fc;
    int pixelData = REG_PIOC_PDSR >> 2;