beacon
[aversive.git] / projects / microb2010 / tests / beacon_tsop / board2010.h
index 669d590..f66faa1 100644 (file)
 
 #define EICRx_TSOP EICRB /* EICRA is not ok, cannot do intr on any edge */
 
-#define INTx_TSOP_OPP  INT5
-#define ISCx0_TSOP_OPP ISC50
-#define ISCx1_TSOP_OPP ISC(1
-#define SIG_TSOP_OPP   SIG_INTERRUPT5
-#define TSOP_OPP_READ() (!(PINE & 0x20))
-
-#define INTx_TSOP_STA  INT6
-#define ISCx0_TSOP_STA ISC60
-#define ISCx1_TSOP_STA ISC61
-#define SIG_TSOP_STA   SIG_INTERRUPT6
-#define TSOP_STA_READ() (!(PINE & 0x40))
+#define INTx_TSOP_OPP  INT6
+#define ISCx0_TSOP_OPP ISC60
+#define ISCx1_TSOP_OPP ISC61
+#define SIG_TSOP_OPP   SIG_INTERRUPT6
+#define TSOP_OPP_READ() (!(PINE & 0x40))
+
+#define INTx_TSOP_STA  INT5
+#define ISCx0_TSOP_STA ISC50
+#define ISCx1_TSOP_STA ISC51
+#define SIG_TSOP_STA   SIG_INTERRUPT5
+#define TSOP_STA_READ() (!(PINE & 0x20))
 
 #define TSOP_FREQ_455_MHZ 0.455
-#define N_PERIODS_455   10.
+#define N_PERIODS_455   15.
 #define TSOP_FREQ_38_MHZ 0.038
 #define N_PERIODS_38   15.
 #define TSOP_FREQ_30_MHZ 0.030
 
 /* TSOP STATIC */
 
-#define TSOP_STA_PERIOD_US (1./TSOP_FREQ_38_MHZ)
-#define TSOP_STA_N_PERIODS  (N_PERIODS_38)
+#define TSOP_STA_PERIOD_US (1./TSOP_FREQ_455_MHZ)
+#define TSOP_STA_N_PERIODS  (N_PERIODS_455)
 
 #define TSOP_STA_TIME_SHORT_US (1.5 * TSOP_STA_N_PERIODS * TSOP_STA_PERIOD_US)
 #define TSOP_STA_TIME_LONG_US  (2.5 * TSOP_STA_N_PERIODS * TSOP_STA_PERIOD_US)
 
-#define TSOP_STA_TIME_SHORT ((uint16_t)(TSOP_STA_TIME_SHORT_US*2))
-#define TSOP_STA_TIME_LONG  ((uint16_t)(TSOP_STA_TIME_LONG_US*2))
+#define TSOP_STA_TIME_SHORT ((uint16_t)(TSOP_STA_TIME_SHORT_US/4))
+#define TSOP_STA_TIME_LONG  ((uint16_t)(TSOP_STA_TIME_LONG_US/4))
 
 #define TSOP_STA_FRAME_LEN 16
 #define TSOP_STA_FRAME_MASK ((1UL << TSOP_STA_FRAME_LEN) - 1)
 #define TSOP_OPP_TIME_SHORT_US (1.5 * TSOP_OPP_N_PERIODS * TSOP_OPP_PERIOD_US)
 #define TSOP_OPP_TIME_LONG_US  (2.5 * TSOP_OPP_N_PERIODS * TSOP_OPP_PERIOD_US)
 
-#define TSOP_OPP_TIME_SHORT ((uint16_t)(TSOP_OPP_TIME_SHORT_US*2))
-#define TSOP_OPP_TIME_LONG  ((uint16_t)(TSOP_OPP_TIME_LONG_US*2))
+#define TSOP_OPP_TIME_SHORT ((uint16_t)(TSOP_OPP_TIME_SHORT_US/4))
+#define TSOP_OPP_TIME_LONG  ((uint16_t)(TSOP_OPP_TIME_LONG_US/4))
 
 #define TSOP_OPP_FRAME_LEN 16
 #define TSOP_OPP_FRAME_MASK ((1UL << TSOP_OPP_FRAME_LEN) - 1)