MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / touch_init

Function touch_init

bsp/loongson/ls1cdev/drivers/touch.c:343–357  ·  view source on GitHub ↗

管脚初始化,配置中断打开SPI1 CS0 设备*/

Source from the content-addressed store, hash-verified

341
342/*管脚初始化,配置中断打开SPI1 CS0 设备*/
343rt_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 */

Callers 1

rtgui_touch_initFunction · 0.70

Calls 5

gpio_set_irq_typeFunction · 0.50
rt_hw_interrupt_installFunction · 0.50
rt_hw_interrupt_umaskFunction · 0.50
gpio_initFunction · 0.50
gpio_setFunction · 0.50

Tested by

no test coverage detected