管脚初始化,配置中断打开SPI1 CS0 设备*/
| 341 | |
| 342 | /*管脚初始化,配置中断打开SPI1 CS0 设备*/ |
| 343 | rt_inline void touch_init(void) |
| 344 | { |
| 345 | unsigned int touch_int_gpio = TOUCH_INT_PIN; // 触摸屏中断 |
| 346 | int touch_irq = LS1C_GPIO_TO_IRQ(touch_int_gpio); |
| 347 | |
| 348 | // 初始化按键中断 |
| 349 | gpio_set_irq_type(touch_int_gpio, IRQ_TYPE_EDGE_FALLING); |
| 350 | rt_hw_interrupt_install(touch_irq, ls1c_touch_irqhandler, RT_NULL, "touch"); |
| 351 | rt_hw_interrupt_umask(touch_irq); |
| 352 | gpio_init(touch_int_gpio, gpio_mode_input); |
| 353 | |
| 354 | // 初始化led |
| 355 | gpio_init(led_gpio, gpio_mode_output); |
| 356 | gpio_set(led_gpio, gpio_level_high); |
| 357 | } |
| 358 | |
| 359 | |
| 360 | /* RT-Thread Device Interface */ |
no test coverage detected