dmx.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*********************************************************************
  2. *
  3. * DMX library for Fraise pic18f device
  4. *
  5. *********************************************************************
  6. * Author Date Comment
  7. *********************************************************************
  8. * Antoine Rousseau may 2012 Original.
  9. ********************************************************************/
  10. /*
  11. # This program is free software; you can redistribute it and/or
  12. # modify it under the terms of the GNU General Public License
  13. # as published by the Free Software Foundation; either version 2
  14. # of the License, or (at your option) any later version.
  15. #
  16. # This program is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU General Public License for more details.
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  23. # MA 02110-1301, USA.
  24. */
  25. #ifndef _DMX_H_
  26. #define _DMX_H_
  27. /** @file */
  28. /** @defgroup dmx DMX master module
  29. *
  30. * Example :
  31. * **config.h** :
  32. * \include dmx/examples/example1/config.h
  33. * **main.c** :
  34. * \include dmx/examples/example1/main.c
  35. * @{
  36. */
  37. #include <fruit.h>
  38. /** \name Settings to put in config.h
  39. You must define the serial port :
  40. ~~~~
  41. #define DMX_UART_NUM [1/2]
  42. #define DMX_UART_PIN [pin]
  43. ~~~~
  44. */
  45. //@{
  46. #ifndef DMX_NBCHAN
  47. #define DMX_NBCHAN 128 /**< @brief DMX_NBCHAN default is 128, maybe overloaded up to 256 (TODO:512 but memory issue at compile time when tested). */
  48. #endif
  49. //@}
  50. /** \name Initialization
  51. */
  52. //@{
  53. /** @brief Init the module in **setup()** */
  54. void DMXInit();
  55. //@}
  56. /** \name Main loop functions
  57. */
  58. //@{
  59. void DMXService(); ///< @brief Module service routine, to be called by the main **loop()**.
  60. //@}
  61. /** \name Utilities
  62. */
  63. //@{
  64. /** @brief Set value of a DMX channel.
  65. @param channel DMX channel (starting from 1)
  66. @param value New value for this channel (0-255)
  67. */
  68. void DMXSet(unsigned int channel, unsigned char value);
  69. //@}
  70. /** @}
  71. */
  72. #endif // _DMX_H_