1
0
mirror of git://projects.qi-hardware.com/nn-usb-fpga.git synced 2024-12-13 23:33:07 +02:00
nn-usb-fpga/plasma/gpio/gpio.c
2010-04-30 22:21:55 -05:00

62 lines
1.0 KiB
C

#include "plasma.h"
#define MemoryRead(A) (*(volatile unsigned long*)(A))
#define MemoryWrite(A,V) *(volatile unsigned long*)(A)=(V)
typedef unsigned long uint32;
typedef unsigned short uint16;
int main(void)
{
volatile unsigned char *data8;
volatile unsigned short *data16;
volatile unsigned int *data32;
unsigned char test8;
unsigned short test16;
unsigned int test32, tmp;
data8 = (unsigned char *)(0x20001000);
data16 = (unsigned short *)(0x20002000);
data32 = (unsigned int *)(0x20003000);
*data8 = 0x10;
data8++;
*data8 = 0x11;
data8++;
*data8 = 0x12;
data8++;
*data8 = 0x13;
data8++;
*data8 = 0x14;
*data16 = 0x2020;
data16++;
*data16 = 0x2121;
data16++;
*data16 = 0x2222;
data16++;
*data32 = 0x30303030;
test8 = *data8;
test16 = *data16;
test32 = *data32;
data8 += 4;
data16++;
data32++;
test8 = *data8;
test16 = *data16;
test32 = *data32;
tmp = test8 + test16 + test32;
*data32 = 0xAAAAAAAA;
return 0;
}