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
ppm_arch.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 The Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
24 
28 
29 void ppm_arch_init ( void ) {
30  /* select pin for capture */
32  /* enable capture 0.2 on falling or rising edge + trigger interrupt */
33 #if defined PPM_PULSE_TYPE && PPM_PULSE_TYPE == PPM_PULSE_TYPE_POSITIVE
35 #elif defined PPM_PULSE_TYPE && PPM_PULSE_TYPE == PPM_PULSE_TYPE_NEGATIVE
37 #else
38 #error "ppm_arch.h: Unknown PPM_PULSE_TYPE"
39 #endif
44 
45 #ifdef USE_PPM_RSSI_GPIO
46  /* select pin as GPIO (input) : should be default ?*/
47  //PPM_RSSI_PINSEL |= PPM_RSSI_VAL << PPM_RSSI_PINSEL_BIT;
48  //ClearBit(PPM_RSSI_IODIR, PPM_RSSI_BIT);
49 #endif
50 }
#define T0CCR
Definition: LPC21xx.h:60
#define PPM_PINSEL_VAL
Definition: booz_1.0.h:64
uint32_t ppm_last_pulse_time
Definition: ppm_arch.c:26
bool_t ppm_data_valid
Definition: ppm_arch.c:27
void ppm_arch_init(void)
Architecture dependant code.
Definition: ppm_arch.c:29
#define PPM_PINSEL
Definition: booz_1.0.h:63
#define PPM_CCR_CRI
Definition: booz_1.0.h:69
#define FALSE
Definition: imu_chimu.h:141
uint8_t ppm_cur_pulse
State machine for decoding ppm frames.
Definition: ppm_arch.c:25
#define PPM_PINSEL_BIT
Definition: booz_1.0.h:65
volatile bool_t ppm_frame_available
Definition: ppm.c:26
unsigned long uint32_t
Definition: types.h:18
#define RADIO_CONTROL_NB_CHANNEL
Definition: spektrum_arch.h:34
unsigned char uint8_t
Definition: types.h:14
#define PPM_CCR_CRR
Definition: booz_1.0.h:68
#define PPM_CCR_CRF
Definition: booz_1.0.h:67