main.c 642 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2019-01-28 wangyq the first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtdevice.h>
  12. #include "drv_gpio.h"
  13. #define LED_PIN GET_PIN( C , 8 )
  14. int main(void)
  15. {
  16. int count = 1;
  17. /* set PC08 pin mode to output */
  18. rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
  19. while (count++)
  20. {
  21. rt_pin_write(LED_PIN, PIN_HIGH);
  22. rt_thread_mdelay(500);
  23. rt_pin_write(LED_PIN, PIN_LOW);
  24. rt_thread_mdelay(500);
  25. }
  26. return RT_EOK;
  27. }