C

Qt Quick Ultralite freertos_multitask Example

/****************************************************************************** ** ** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Ultralite module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ******************************************************************************/
#include <fsl_gpio.h> #include <fsl_iomuxc.h> #define LOGIC_LED_ON (0U) #define LOGIC_LED_OFF (1U) #ifndef BOARD_USER_LED_GPIO #define BOARD_USER_LED_GPIO GPIO1 #endif #ifndef BOARD_USER_LED_GPIO_PIN #define BOARD_USER_LED_GPIO_PIN (9U) #endif namespace BoardUtils { void initLED() { gpio_pin_config_t USER_LED_config = {.direction = kGPIO_DigitalOutput, .outputLogic = 0U, .interruptMode = kGPIO_NoIntmode}; GPIO_PinInit(GPIO1, 9U, &USER_LED_config); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_09_GPIO1_IO09, 0U); IOMUXC_GPR->GPR26 = ((IOMUXC_GPR->GPR26 & (~(IOMUXC_GPR_GPR26_GPIO_MUX1_GPIO_SEL_MASK))) | IOMUXC_GPR_GPR26_GPIO_MUX1_GPIO_SEL(0x00U)); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_09_GPIO1_IO09, 0x10B0U); GPIO_PinWrite(BOARD_USER_LED_GPIO, BOARD_USER_LED_GPIO_PIN, LOGIC_LED_OFF); BOARD_USER_LED_GPIO->GDIR |= (1U << BOARD_USER_LED_GPIO_PIN); } void toggleLED() { GPIO_PinWrite(BOARD_USER_LED_GPIO, BOARD_USER_LED_GPIO_PIN, 0x1 ^ GPIO_PinRead(BOARD_USER_LED_GPIO, BOARD_USER_LED_GPIO_PIN)); } } // namespace BoardUtils