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_ppm_hw.c
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 2008 Mark Griffin
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *
23  */
29 #include "actuators.h"
30 #include "paparazzi.h"
31 #include "generated/airframe.h"
32 
36 
37 #define START_TIMEOUT 0xFFFF;
38 
39 void actuators_init ( void ) {
40  /* select ppm output pin as MAT0.1 output */
42 
43  /* enable match 1 interrupt */
44  T0MCR |= TMCR_MR1_I;
45 
46  /* lower clock */
47  T0EMR &= ~TEMR_EM1;
48  /* set high on match 1 */
49  T0EMR |= TEMR_EMC1_2;
50 
51  /* set first pulse in a while */
54  /* Set all servos to their midpoints */
55  /* compulsory for unused servos */
56  uint8_t i;
57  for( i=0 ; i < _PPM_NB_CHANNELS ; i++ )
59 }
61 
unsigned short uint16_t
Definition: types.h:16
#define START_TIMEOUT
Definition: servos_ppm_hw.c:37
#define SERVO_CLOCK_PINSEL
Definition: hb_1.1.h:56
#define SERVO_CLOCK_PINSEL_BIT
Definition: hb_1.1.h:58
#define T0MCR
Definition: LPC21xx.h:55
#define TMCR_MR1_I
Definition: lpcTMR.h:62
#define SERVOS_TICS_OF_USEC(s)
uint8_t servos_PPM_idx
Definition: servos_ppm_hw.c:33
#define _PPM_NB_CHANNELS
Definition: servos_ppm_hw.h:41
unsigned long uint32_t
Definition: types.h:18
#define T0EMR
Definition: LPC21xx.h:65
#define T0MR1
Definition: LPC21xx.h:57
#define SERVO_REFRESH_TICS
unsigned char uint8_t
Definition: types.h:14
uint32_t servos_delay
Definition: servos_ppm_hw.c:35
#define TEMR_EMC1_2
Definition: lpcTMR.h:159
#define TEMR_EM1
Definition: lpcTMR.h:150
uint8_t ppm_pulse
Definition: servos_ppm_hw.c:34
#define SERVO_CLOCK_PINSEL_VAL
Definition: hb_1.1.h:57
void actuators_init(void)
Definition: servos_ppm_hw.c:39
uint16_t servos_values[_PPM_NB_CHANNELS]
Definition: servos_ppm_hw.c:60