rt-thread/bsp/stm32/stm32mp157a-st-discovery/applications/main.c

31 lines
608 B
C
Raw Normal View History

2020-06-20 14:08:14 +08:00
/*
2021-03-14 15:33:55 +08:00
* Copyright (c) 2006-2021, RT-Thread Development Team
2020-06-20 14:08:14 +08:00
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-06-05 thread-liu first version
*/
2020-06-23 10:43:18 +08:00
2020-06-20 14:08:14 +08:00
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
2020-10-13 15:10:55 +08:00
/* defined the LD7 pin: PH7 */
#define LED7_PIN GET_PIN(H, 7)
2020-06-20 14:08:14 +08:00
2021-03-14 15:33:55 +08:00
int main(void)
2020-06-20 14:08:14 +08:00
{
2020-10-13 15:10:55 +08:00
/* set LD7 pin mode to output */
rt_pin_mode(LED7_PIN, PIN_MODE_OUTPUT);
2021-03-14 15:33:55 +08:00
while (1)
2020-06-20 14:08:14 +08:00
{
2020-10-13 15:10:55 +08:00
rt_pin_write(LED7_PIN, PIN_HIGH);
2021-03-14 15:33:55 +08:00
rt_thread_mdelay(500);
2020-10-13 15:10:55 +08:00
rt_pin_write(LED7_PIN, PIN_LOW);
2020-06-20 14:08:14 +08:00
rt_thread_mdelay(500);
}
}