Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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  /* select pin for capture */
16  /* enable capture 0.2 on falling edge + trigger interrupt */
18 }
19 
20 
21 #define ICP_ISR() { \
22  static uint32_t last; \
23  uint32_t now = T0CR2; \
24  pulse_len = now - last; \
25  last = now; \
26  LED_TOGGLE(2); \
27  }
28 
29 
30 
31 #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