Can you tell us what digital board you are using? This could help us find an appropriate example to point you to, if one exists. At least we will have a better idea about whether your board supports DMA transfers for DIO and what functions apply to your board.
Also, next time you might have a better response if you post to one of Measurements Devices categories.