Subversion Repositories HomeAutomation

Rev

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

  1. #ifndef SNS_TCN75A
  2. #define SNS_TCN75A
  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. #include <drivers/mcu/TWI_Master.h>
  18.  
  19. //to use PCINT lib. uncomment the line below
  20. //#include <drivers/mcu/pcint.h>
  21.  
  22. void sns_TCN75A_Init(void);
  23. void sns_TCN75A_Process(void);
  24. void sns_TCN75A_HandleMessage(StdCan_Msg_t *rxMsg);
  25. void sns_TCN75A_List(uint8_t ModuleSequenceNumber);
  26.  
  27.  
  28. #define TCN75A_REG_TEMPERATURE  0
  29. #define TCN75A_REG_CONFIG       1
  30. #define TCN75A_REG_HYSTERESIS   2
  31. #define TCN75A_REG_LIMITSET     3
  32.  
  33. #define TCN75A_CNF_RESOLUTION_BIT   5
  34. #define TCN75A_CNF_RESOLUTION_9     0 /* gives 9bit resolution, 0.5deg C*/
  35. #define TCN75A_CNF_RESOLUTION_10    1 /* gives 10bit resolution, 0.25deg C*/
  36. #define TCN75A_CNF_RESOLUTION_11    2 /* gives 11bit resolution, 0.125deg C*/
  37. #define TCN75A_CNF_RESOLUTION_12    3 /* gives 12bit resolution, 0.0625deg C*/
  38.  
  39.  
  40. #ifdef sns_TCN75A_USEEEPROM
  41.     struct sns_TCN75A_Data{
  42.         ///TODO: Define EEPROM variables needed by the module
  43.         uint8_t x;
  44.         uint16_t y;
  45.     }; 
  46. #endif
  47.  
  48. #endif // SNS_TCN75A
  49.