Subversion Repositories HomeAutomation

Rev

Rev 1180 | Rev 1184 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. #ifndef ACT_SOFTPWM
  2. #define ACT_SOFTPWM
  3.  
  4. /*-----------------------------------------------------------------------------
  5.  * Includes
  6.  *---------------------------------------------------------------------------*/
  7. /* system files */
  8. #include <avr/io.h>
  9. #include <avr/interrupt.h>
  10. #include <stdio.h>
  11. /* lib files */
  12. #include <config.h>
  13. #include <bios.h>
  14. #include <drivers/can/stdcan.h>
  15. #include <drivers/timer/timer.h>
  16. #include <drivers/mcu/gpio.h>
  17.  
  18. //to use PCINT lib. uncomment the line below
  19. //#include <drivers/mcu/pcint.h>
  20.  
  21. void act_softPWM_Init(void);
  22. void act_softPWM_Process(void);
  23. void act_softPWM_HandleMessage(StdCan_Msg_t *rxMsg);
  24. void act_softPWM_List(uint8_t ModuleSequenceNumber);
  25.  
  26. #define NUMBEROFCHANNELS 0
  27. #ifdef PIN_0
  28.     #define PIN_0_ID NUMBEROFCHANNELS
  29.     #undef NUMBEROFCHANNELS
  30.     #define NUMBEROFCHANNELS PIN_0_ID + 1
  31. #warning pinne0
  32. #endif
  33. #ifdef PIN_1
  34.     #define PIN_1_ID NUMBEROFCHANNELS
  35.     #undef NUMBEROFCHANNELS
  36.     #define NUMBEROFCHANNELS PIN_1_ID + 1
  37.     #warning pinne1
  38. #endif
  39. #ifdef PIN_2
  40.     #define PIN_2_ID NUMBEROFCHANNELS
  41.     #undef NUMBEROFCHANNELS
  42.     #define NUMBEROFCHANNELS PIN_2_ID + 1
  43. #warning pinne2 NUMBEROFCHANNELS
  44. #ifdef PIN_2_ID
  45. #warning Hej
  46. #endif
  47. #endif
  48. #ifdef PIN_3
  49.     #define PIN_3_ID NUMBEROFCHANNELS
  50.     #undef NUMBEROFCHANNELS
  51.     #define NUMBEROFCHANNELS PIN_3_ID + 1
  52. #endif
  53. #ifdef PIN_4
  54.     #define PIN_4_ID NUMBEROFCHANNELS
  55.     #undef NUMBEROFCHANNELS
  56.     #define NUMBEROFCHANNELS PIN_4_ID + 1
  57. #endif
  58. #ifdef PIN_5
  59.     #define PIN_5_ID NUMBEROFCHANNELS
  60.     #undef NUMBEROFCHANNELS
  61.     #define NUMBEROFCHANNELS PIN_5_ID + 1
  62. #endif
  63. #ifdef PIN_6
  64.     #define PIN_6_ID NUMBEROFCHANNELS
  65.     #undef NUMBEROFCHANNELS
  66.     #define NUMBEROFCHANNELS PIN_6_ID + 1
  67. #endif
  68. #ifdef PIN_7
  69.     #define PIN_7_ID NUMBEROFCHANNELS
  70.     #undef NUMBEROFCHANNELS
  71.     #define NUMBEROFCHANNELS PIN_7_ID + 1
  72. #endif
  73.  
  74.  
  75. #ifdef act_softPWM_USEEEPROM
  76.     struct act_softPWM_Data{
  77.         ///TODO: Define EEPROM variables needed by the module
  78.         uint16_t PwmPeriod;
  79.         uint16_t defaultPwmValue;
  80.         uint8_t defaultStates;
  81.         uint8_t ReportInterval;
  82.     }; 
  83. #endif
  84.  
  85. #endif // ACT_SOFTPWM
  86.