Subversion Repositories HomeAutomation

Rev

Rev 1264 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. #ifndef TST_TESTPRGRIG
  2. #define TST_TESTPRGRIG
  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. #include <drivers/adc/adc.h>
  19. //to use PCINT lib. uncomment the line below
  20. //#include <drivers/mcu/pcint.h>
  21.  
  22.  
  23. #define R51 12000
  24. #define R50 47000
  25. #if (5 * (R51 + R50))/(R51) > 64
  26.     #error "ADC_FACTOR must be less then 64, change R51 and R52"
  27. #elseif (5 * (R51 + R50))/(R51) < 32
  28.     #define ADC_FACTOR  (5 * (R51 + R50))/(R51)
  29.     #define ADC_SCALE   10
  30. #else
  31.     #define ADC_FACTOR  (5 * (R51 + R50))/(R51 / 2)
  32.     #define ADC_SCALE   11
  33. #endif
  34.  
  35. #define DUTCONNSTATE_IDLE 0
  36. #define DUTCONNSTATE_QUAL1 1
  37. #define DUTCONNSTATE_QUAL2 2
  38. #define DUTCONNSTATE_ENABLED 3
  39. #define DUTCONNSTATE_FAILED_CURR 254
  40. #define DUTCONNSTATE_FAILED_VOLT 255
  41.  
  42. void tst_TestPrgRig_Init(void);
  43. void tst_TestPrgRig_Process(void);
  44. void tst_TestPrgRig_HandleMessage(StdCan_Msg_t *rxMsg);
  45. void tst_TestPrgRig_List(uint8_t ModuleSequenceNumber);
  46.  
  47.  
  48. #ifdef tst_TestPrgRig_USEEEPROM
  49.     struct tst_TestPrgRig_Data{
  50.         ///TODO: Define EEPROM variables needed by the module
  51.         uint8_t x;
  52.         uint16_t y;
  53.     }; 
  54. #endif
  55.  
  56. #endif // TST_TESTPRGRIG
  57.