You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

yc059.h 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. Copyright 2014 Kai Ryu <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef YC059_H
  15. #define YC059_H
  16. #include <stdint.h>
  17. #define YC059_FREQ 38000
  18. #define YC059_ADDRESS 0x00EF
  19. #define YC059_HDR_MARK 9000
  20. #define YC059_HDR_SPACE 4500
  21. #define YC059_BIT_MARK 560
  22. #define YC059_ONE_SPACE 1600
  23. #define YC059_ZERO_SPACE 560
  24. #define YC059_RPT_SPACE 2250
  25. #define YC059_IR_DDR DDRC
  26. #define YC059_IR_PORT PORTC
  27. #define YC059_IR_BIT PC6
  28. enum yc059_id {
  29. YC059_INCREASE = 0,
  30. YC059_DECREASE,
  31. YC059_OFF,
  32. YC059_ON,
  33. YC059_FIXED_RED,
  34. YC059_FIXED_GREEN,
  35. YC059_FIXED_BLUE,
  36. YC059_FIXED_WHITE,
  37. YC059_FIXED_RED_1,
  38. YC059_FIXED_GREEN_1,
  39. YC059_FIXED_BLUE_1,
  40. YC059_FLASH,
  41. YC059_FIXED_RED_2,
  42. YC059_FIXED_GREEN_2,
  43. YC059_FIXED_BLUE_2,
  44. YC059_STROBE,
  45. YC059_FIXED_RED_3,
  46. YC059_FIXED_GREEN_3,
  47. YC059_FIXED_BLUE_3,
  48. YC059_FADE,
  49. YC059_FIXED_RED_4,
  50. YC059_FIXED_GREEN_4,
  51. YC059_FIXED_BLUE_4,
  52. YC059_SMOOTH
  53. };
  54. void yc059_init(void);
  55. void yc059_send(uint8_t data);
  56. void yc059_send_header(void);
  57. void yc059_send_address(void);
  58. void yc059_send_byte(uint8_t byte);
  59. void yc059_send_word(uint16_t word);
  60. void yc059_send_stop(void);
  61. #endif