void gpdma_test() {
    char buf[255];
    LPC_GPDMA->CONFIG = 1;
    while ( ! (LPC_GPDMA->CONFIG & 1) ) { }
    LPC_GPDMA->INTTCCLEAR = 0xFF;
    LPC_GPDMA->INTERRCLR = 0xFF;
    sprintf(buf, "enabled channels: 0x%X\n", LPC_GPDMA->ENBLDCHNS);
    debug_uart(buf); // gives 0

    IP_GPDMA_001_CH_T ch = LPC_GPDMA->CH[7];
    uint32_t src[512] __attribute__ ((aligned (256)));
    uint32_t dest[512] __attribute__ ((aligned (256)));
    ch.SRCADDR = src;
    ch.DESTADDR = dest;
    ch.LLI = 0;
    //           xfersize    sbsize       dbsize      swidth     dwidth      sincr       dincr
    ch.CONTROL = (64 << 0) | (2 << 12) | (2 << 15) | (2 << 18) | (2 << 21) | (1 << 26) | (1 << 27) | (1 << 31);
    //          enable     flow
    ch.CONFIG = (1 << 0) | (0 << 11);
    while ( (ch.CONFIG & 0x01) != 0 ) {
        // loop never terminates; LPC_GPDMA->ENBLDCHNS never changes from 0, ?!?
    }
    for ( int i = 0; i < 512; i++ ) {
        sprintf(buf, "got data in dest: 0x%X (should be 0x%X)\n", dest[i], src[i]);
        debug_uart(buf);
    }
}