Subversion Repositories HomeAutomation

Rev

Rev 1276 | 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. typedef struct
  34. {
  35.     uint8_t f1;
  36.     uint8_t f2;
  37.     uint8_t f3;
  38.     uint8_t f4;
  39.     uint8_t f5;
  40.     uint8_t f6;
  41.     uint8_t f7;
  42.     uint8_t f8;
  43.     uint8_t f9;
  44. } gesture;
  45.  
  46. static __inline__ uint8_t min(uint8_t val1, uint8_t val2) {
  47.   if (val1 > val2)
  48.   {
  49.     return val2;
  50.   }
  51.   return val1;
  52. }
  53.  
  54. static __inline__ uint8_t max(uint8_t val1, uint8_t val2) {
  55.   if (val1 > val2)
  56.   {
  57.     return val1;
  58.   }
  59.   return val2;
  60. }
  61.  
  62. #ifdef sns_Touch_USEEEPROM
  63.     struct sns_Touch_Data{
  64.         ///TODO: Define EEPROM variables needed by the module
  65.         uint8_t x;
  66.         uint16_t y;
  67.     }; 
  68. #endif
  69.  
  70. #endif // SNS_TOUCH
  71.