Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
opa_controller_ap.c
Go to the documentation of this file.
1/*
2 * Copyright (C) C. De Wagter
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, see
18 * <http://www.gnu.org/licenses/>.
19 */
25
28#include "generated/airframe.h"
29#include "mcu_periph/gpio.h"
30
33
38
40 /* Enable Vision Power Control: Default Power Off */
43
44 gpio_setup_output(VISION_PWR, VISION_PWR_PIN);
45 VISION_PWR_OFF(VISION_PWR, VISION_PWR_PIN);
46}
47
49 /* Update the vision control power */
51 VISION_PWR_ON(VISION_PWR, VISION_PWR_PIN);
52 } else {
53 VISION_PWR_OFF(VISION_PWR, VISION_PWR_PIN);
54 }
55
56 /* Set the FTD Disarm state */
57 opa_controller_ftd_disarm = intermcu.cmd_status & (1 << 1);
58}
59
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
Definition gpio_arch.c:33
Some architecture independent helper functions for GPIOs.
Inter-MCU interface.
#define INTERMCU_SET_CMD_STATUS(_bit)
Definition intermcu.h:55
@ INTERMCU_CMD_DISARM
Whether or not to dis-arm the FBW.
Definition intermcu.h:49
struct intermcu_t intermcu
Definition intermcu_ap.c:45
void opa_controller_periodic()
bool opa_controller_ftd_disarm
void opa_controller_ap_disarm(bool action)
bool opa_controller_vision_power
void opa_controller_init()