我刚接触到SOPC 我的请教帖有好几个了 呵呵
我想用timer 弄出一个中断 但是在网上找的程序我看不懂啊 虽然是学了C语言 还是很懵啊
还请高手给解释一下 这些是什么东西啊
特别是一些 * 是什么东西啊 不可能也是指针吧
static void init_button_pio() {
void* edge_capture_ptr = (void*)&edge_capture; // 这个(void*)什么东西啊
IOWR_ALTERA_AVALON_PIO_IRQ_MASK(BUTTON_PIO_BASE,0xf);
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(BUTTON_PIO_BASE,0x0);
//注册一个中断处理子程序handle_button_interrupts()
alt_irq_register(BUTTON_PIO_IRQ,edge_capture_ptr,handle_button_interrupts);
static void handle_button_interrupts(void* context,alt_u32 id)
{
volatile int* edge_capture_ptr = (volatile int*)context;
*edge_capture_ptr = IORD_ALTERA_AVALON_PIO_EDGE_CAP(BUTTON_PIO_BASE);
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(BUTTON_PIO_BASE,0);
} |