led.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* sd2snes - SD card based universal cartridge for the SNES
  2. Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
  3. AVR firmware portion
  4. Inspired by and based on code from sd2iec, written by Ingo Korb et al.
  5. See sdcard.c|h, config.h.
  6. FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
  7. see ff.c|h.
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; version 2 of the License only.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. led.c: LED control
  19. */
  20. #ifndef LED_H
  21. #define LED_H
  22. #include "config.h"
  23. #include "uart.h"
  24. /* LED-to-bit mapping - BUSY/DIRTY are only used for SINGLE_LED */
  25. #define LED_ERROR 1
  26. #define LED_BUSY 2
  27. #define LED_DIRTY 4
  28. extern volatile uint8_t led_state;
  29. /* Update the LEDs to match the buffer state */
  30. void toggle_busy_led(void);
  31. void toggle_pwr_led(void);
  32. void set_busy_led(uint8_t);
  33. void set_pwr_led(uint8_t);
  34. void set_busy_pwm(uint8_t brightness);
  35. void bounce_busy_led(void);
  36. void led_pwm(void);
  37. void led_std(void);
  38. void led_panic(void);
  39. #endif