led.c 601 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2009-12-27 rdghx mini2440
  9. */
  10. /**
  11. * @addtogroup mini2440
  12. */
  13. /*@{*/
  14. #include <s3c24x0.h>
  15. #include "led.h"
  16. void rt_hw_led_init(void)
  17. {
  18. /* GPB5,GPB6,GPB7,GPB8 for LED */
  19. GPBCON = GPBCON & (~(0xff << 10)) | (0x55 << 10);
  20. GPBUP |= (0x0f << 5);
  21. }
  22. void rt_hw_led_on(unsigned char value)
  23. {
  24. GPBDAT &= ~ ((value & 0x0f) << 5);
  25. }
  26. void rt_hw_led_off(unsigned char value)
  27. {
  28. GPBDAT |= (value & 0x0f) << 5;
  29. }
  30. /*@}*/