123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- /*
- * Copyright (C) 2020, Huada Semiconductor Co., Ltd.
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2020-10-30 CDT first version
- */
- /*******************************************************************************
- * Include files
- ******************************************************************************/
- #include "hc32_ddl.h"
- #include "board.h"
- #include <rtthread.h>
- #include <rtdevice.h>
- /*******************************************************************************
- * Local type definitions ('typedef')
- ******************************************************************************/
- /*******************************************************************************
- * Local pre-processor symbols/macros ('#define')
- ******************************************************************************/
- /* defined the LED pin: PC9 */
- #define LED_PIN (41)
- #define DELAY_MS (RT_TICK_PER_SECOND) /* 1s */
- /*******************************************************************************
- * Global variable definitions (declared in header file with 'extern')
- ******************************************************************************/
- /*******************************************************************************
- * Local function prototypes ('static')
- ******************************************************************************/
- /*******************************************************************************
- * Local variable definitions ('static')
- ******************************************************************************/
- /*******************************************************************************
- * Function implementation - global ('extern') and local ('static')
- ******************************************************************************/
- /**
- *******************************************************************************
- ** \brief Main function of GPIO output
- **
- ** \param None
- **
- ** \retval int32_t Return value, if needed
- **
- ******************************************************************************/
- int32_t main(void)
- {
- rt_kprintf("Os is Start!!! \n");
- while(1)
- {
- rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
- rt_pin_write(LED_PIN, PIN_HIGH);
- rt_thread_delay(DELAY_MS);
- rt_pin_write(LED_PIN, PIN_LOW);
- rt_thread_delay(DELAY_MS);
- };
- }
- /*******************************************************************************
- * EOF (not truncated)
- ******************************************************************************/
|