(1):测试代码
#include "system.h"
#include "altera_avalon_uart_regs.h"
#include "altera_avalon_pio_regs.h"
#include "alt_types.h"
int main (void) __attribute__ ((weak, alias ("alt_main")));
int alt_main (void)
{
//unsigned char led = 0;
//unsigned int i;
while (1)
{
//led = 0;
IOWR_ALTERA_AVALON_PIO_DATA(LED_BASE, 0x55);
IOWR_ALTERA_AVALON_UART_TXDATA(UART_0_BASE, 0xaa);
//i = 0;
//while (i<10)
// i++;
//led = 1;
IOWR_ALTERA_AVALON_PIO_DATA(LED_BASE, 0xaa);
IOWR_ALTERA_AVALON_UART_TXDATA(UART_0_BASE, 0x55);
//i = 0;
//while (i<10)
// i++;
}
return 0;
}
文章评论(0条评论)
登录后参与讨论