led.c 798 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * File : led.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2009-12-27 rdghx mini2440
  13. */
  14. /**
  15. * @addtogroup mini2440
  16. */
  17. /*@{*/
  18. #include <s3c24x0.h>
  19. #include "led.h"
  20. void rt_hw_led_init(void)
  21. {
  22. /* GPB5,GPB6,GPB7,GPB8 for LED */
  23. GPBCON = GPBCON & (~(0xff << 10)) | (0x55 << 10);
  24. GPBUP |= (0x0f << 5);
  25. }
  26. void rt_hw_led_on(unsigned char value)
  27. {
  28. GPBDAT &= ~ ((value & 0x0f) << 5);
  29. }
  30. void rt_hw_led_off(unsigned char value)
  31. {
  32. GPBDAT |= (value & 0x0f) << 5;
  33. }
  34. /*@}*/