led.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright 2017 skully <skullydazed@gmail.com>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #include "hal.h"
  18. #include "backlight.h"
  19. #include "led.h"
  20. #include "printf.h"
  21. void backlight_init_ports(void) {
  22. printf("backlight_init_ports()\n");
  23. /*
  24. palSetPadMode(GPIOA, 6, PAL_MODE_OUTPUT_PUSHPULL);
  25. palSetPadMode(GPIOA, 3, PAL_MODE_OUTPUT_PUSHPULL);
  26. palSetPadMode(GPIOA, 15, PAL_MODE_OUTPUT_PUSHPULL);
  27. palSetPadMode(GPIOB, 5, PAL_MODE_OUTPUT_PUSHPULL);
  28. // Set them high to turn off the LEDs
  29. palClearPad(GPIOA, 6);
  30. //palSetPad(GPIOA, 6);
  31. palSetPad(GPIOA, 3);
  32. palSetPad(GPIOA, 15);
  33. palSetPad(GPIOB, 5);
  34. */
  35. }
  36. void backlight_set(uint8_t level) {
  37. printf("backlight_set(%d)\n", level);
  38. /*
  39. if (level == 0) {
  40. palSetPad(GPIOA, 6);
  41. palSetPad(GPIOA, 3);
  42. palSetPad(GPIOA, 15);
  43. palSetPad(GPIOB, 5);
  44. } else {
  45. palClearPad(GPIOA, 6);
  46. palClearPad(GPIOA, 3);
  47. palClearPad(GPIOA, 15);
  48. palClearPad(GPIOB, 5);
  49. }
  50. */
  51. }