Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
servos_4015_hw.h
Go to the documentation of this file.
1 #ifndef SERVOS_4015_HW_H
2 #define SERVOS_4015_HW_H
3 
4 #include <inttypes.h>
5 #include "std.h"
6 
7 #include "LPC21xx.h"
8 #include "mcu_periph/sys_time.h"
9 
10 #include BOARD_CONFIG
11 
12 /* PWM prescaler, set PWM input clock to 15MHz, PWM_CLK = PCLK / PWM_PRESCALER */
13 
14 #if (PCLK == 15000000)
15 #define PWM_PRESCALER 1
16 #else
17 
18 #if (PCLK == 30000000)
19 #define PWM_PRESCALER 2
20 #else
21 
22 #if (PCLK == 60000000)
23 #define PWM_PRESCALER 4
24 #else
25 
26 #error unknown PCLK frequency
27 #endif
28 #endif
29 #endif
30 
31 #define PWM_TICS_OF_USEC(us) (uint32_t)((us) *1e-6 * PCLK / PWM_PRESCALER + 0.5)
32 
33 #define SERVOS_TICS_OF_USEC(s) PWM_TICS_OF_USEC(s)
34 #define ChopServo(x,a,b) Chop(x, a, b)
35 
36 #define _4015_NB_CHANNELS 8
38 #define Actuator(i) servos_values[i]
39 
40 #define ActuatorsCommit() {}
41 
42 void PWM_ISR ( void ) __attribute__((naked));
43 
44 
45 #endif /* SERVOS_4015_HW_H */
unsigned short uint16_t
Definition: types.h:16
#define _4015_NB_CHANNELS
Architecture independent timing functions.
uint16_t servos_values[_4015_NB_CHANNELS]
Definition: servos_4015_hw.c:8
void PWM_ISR(void) __attribute__((naked))
__attribute__((always_inline))
Definition: i2c_arch.c:35