summaryrefslogtreecommitdiff
path: root/bsp/wch/risc-v/ch32v208w-r0/applications/main.c
blob: 6e40dcefca9a5dbaeedf55273bcde63b4bfe1fd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright (c) 2006-2023, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-11-03     WangShun       first version
 */

#include "ch32v20x.h"
#include <rtthread.h>
#include <rthw.h>
#include "drivers/dev_pin.h"
#include <board.h>

#define LED0 rt_pin_get("PA.0")

int main(void)
{
    rt_pin_mode(LED0,PIN_MODE_OUTPUT);
    rt_kprintf("MCU-CH32V208WBU6\r\n");
    while(1)
    {
        rt_pin_write(LED0, PIN_HIGH);
        rt_thread_mdelay(500);
        rt_pin_write(LED0, PIN_LOW);
        rt_thread_mdelay(500);
    }
}