Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
icp_scale.h
Go to the documentation of this file.
1 #ifndef ICP_SCALE_H
2 #define ICP_SCALE_H
3 
4 /* INPUT CAPTURE on P0.6*/
5 #define ICP_PINSEL PINSEL0
6 #define ICP_PINSEL_VAL 0x02
7 #define ICP_PINSEL_BIT 12
8 
9 #include "led.h"
10 
12 
13 static inline void icp_scale_init(void)
14 {
15  /* select pin for capture */
17  /* enable capture 0.2 on falling edge + trigger interrupt */
19 }
20 
21 
22 #define ICP_ISR() { \
23  static uint32_t last; \
24  uint32_t now = T0CR2; \
25  pulse_len = now - last; \
26  last = now; \
27  LED_TOGGLE(2); \
28  }
29 
30 
31 
32 #endif /* ICP_SCALE_H */
#define T0CCR
Definition: LPC21xx.h:60
#define ICP_PINSEL
Definition: icp_scale.h:5
unsigned long uint32_t
Definition: types.h:18
volatile uint32_t pulse_len
Definition: icp_scale.h:11
#define ICP_PINSEL_BIT
Definition: icp_scale.h:7
#define TCCR_CR2_I
Definition: lpcTMR.h:142
arch independent LED (Light Emitting Diodes) API
#define TCCR_CR2_F
Definition: lpcTMR.h:141
#define ICP_PINSEL_VAL
Definition: icp_scale.h:6
static void icp_scale_init(void)
Definition: icp_scale.h:13