Subversion Repositories HomeAutomation

Rev

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

  1. #ifndef SNS_TOUCH
  2. #define SNS_TOUCH
  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/adc/adc.h>
  18.  
  19. //to use PCINT lib. uncomment the line below
  20. //#include <drivers/mcu/pcint.h>
  21.  
  22. void sns_Touch_Init(void);
  23. void sns_Touch_Process(void);
  24. void sns_Touch_HandleMessage(StdCan_Msg_t *rxMsg);
  25. void sns_Touch_List(uint8_t ModuleSequenceNumber);
  26.  
  27. typedef struct
  28. {
  29.     uint8_t x;
  30.     uint8_t y;
  31. } point;
  32.  
  33. static __inline__ uint8_t min(uint8_t val1, uint8_t val2) {
  34.   if (val1 > val2)
  35.   {
  36.     return val2;
  37.   }
  38.   return val1;
  39. }
  40.  
  41. static __inline__ uint8_t max(uint8_t val1, uint8_t val2) {
  42.   if (val1 > val2)
  43.   {
  44.     return val1;
  45.   }
  46.   return val2;
  47. }
  48.  
  49. #ifdef sns_Touch_USEEEPROM
  50.     struct sns_Touch_Data{
  51.         ///TODO: Define EEPROM variables needed by the module
  52.         uint8_t x;
  53.         uint16_t y;
  54.     }; 
  55. #endif
  56.  
  57. #endif // SNS_TOUCH
  58.