⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 board.h

📁 ucos 在arca方舟芯片(mips)上的移植。
💻 H
字号:
#include "hal_regs.h"#include "hal_io.h"#define plf_gpio_init()				\do {						\    unsigned int gpio;				\    /* turn off the dancing leds. */		\    outb(UCOS_REG_GPDR_A, 0xff);			\    /* gpio init */				\    gpio = inl(UCOS_REG_GPCR_C);		\    /* bit7-3 as UART/SCC */			\    outl(UCOS_REG_GPCR_C, gpio | 0x0000C000);	\    gpio = inl(UCOS_REG_GPCR_D);		\    /* bit3-0 as UART/IRDA */			\    outl(UCOS_REG_GPCR_D, gpio | 0x00000F00);   \}while(0)#define hal_led_dancing()						\do {									\    static unsigned char led_dancing_timer1 = 0;			\    static unsigned char led_dancing_timer2 = 0;			\    volatile unsigned char *gpio_b = (unsigned char *)UCOS_REG_GPDR_A;	\    led_dancing_timer1 ++;						\    if (led_dancing_timer1 == 50) {					\	led_dancing_timer1 = 0;						\	(*gpio_b) = 0x0f & ~(1 << led_dancing_timer2);			\	led_dancing_timer2 ++;						\	if (led_dancing_timer2 == 4) led_dancing_timer2 = 0;		\    }                                                                   \} while (0)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -