3 #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 13 #include <drivers/drv_led.h> 14 #include <drivers/drv_tone_alarm.h> 15 #include <drivers/drv_gpio.h> 16 #include <modules/px4iofirmware/protocol.h> 17 #include <arch/board/board.h> 18 #include <board_config.h> 32 #if defined(CONFIG_ARCH_BOARD_PX4FMU_V1) || defined(CONFIG_ARCH_BOARD_PX4FMU_V4) 43 #ifdef CONFIG_ARCH_BOARD_PX4FMU_V4 45 hal.
console->
printf(
"GPIO: Unable to setup GPIO LED GREEN\n");
49 #if !defined(CONFIG_ARCH_BOARD_AEROFC_V1) 60 #ifdef CONFIG_ARCH_BOARD_PX4FMU_V1 66 #ifdef PX4IO_DEVICE_PATH 81 uint8_t old_value =
read(pin);
112 return (relays & GPIO_EXT_1)?
HIGH:
LOW;
120 return (relays & GPIO_EXT_2)?
HIGH:
LOW;
124 #ifdef PX4IO_P_SETUP_RELAYS_POWER1 131 return (relays & PX4IO_P_SETUP_RELAYS_POWER1)?
HIGH:
LOW;
135 #ifdef PX4IO_P_SETUP_RELAYS_POWER2 142 return (relays & PX4IO_P_SETUP_RELAYS_POWER2)?
HIGH:
LOW;
146 #ifdef PX4IO_P_SETUP_RELAYS_ACC1 153 return (relays & PX4IO_P_SETUP_RELAYS_ACC1)?
HIGH:
LOW;
157 #ifdef PX4IO_P_SETUP_RELAYS_ACC2 164 return (relays & PX4IO_P_SETUP_RELAYS_ACC2)?
HIGH:
LOW;
181 #if defined(CONFIG_ARCH_BOARD_PX4FMU_V1) || defined(CONFIG_ARCH_BOARD_PX4FMU_V4) 228 #ifdef PX4IO_P_SETUP_RELAYS_POWER1 231 ioctl(
_gpio_io_fd, value==
LOW?GPIO_CLEAR:GPIO_SET, PX4IO_P_SETUP_RELAYS_POWER1);
236 #ifdef PX4IO_P_SETUP_RELAYS_POWER2 239 ioctl(
_gpio_io_fd, value==
LOW?GPIO_CLEAR:GPIO_SET, PX4IO_P_SETUP_RELAYS_POWER2);
244 #ifdef PX4IO_P_SETUP_RELAYS_ACC1 247 ioctl(
_gpio_io_fd, value==
LOW?GPIO_CLEAR:GPIO_SET, PX4IO_P_SETUP_RELAYS_ACC1);
252 #ifdef PX4IO_P_SETUP_RELAYS_ACC2 255 ioctl(
_gpio_io_fd, value==
LOW?GPIO_CLEAR:GPIO_SET, PX4IO_P_SETUP_RELAYS_ACC2);
316 #endif // CONFIG_HAL_BOARD #define PX4_GPIO_FMU_SERVO_PIN(n)
AP_HAL::DigitalSource * channel(uint16_t n) override
#define PX4_GPIO_EXT_FMU_RELAY1_PIN
#define PX4_GPIO_EXT_IO_ACC2_PIN
int open(const char *pathname, int flags)
POSIX Open a file with integer mode flags.
AP_HAL::UARTDriver * console
int8_t analogPinToDigitalPin(uint8_t pin) override
#define HAL_GPIO_A_LED_PIN
uint8_t read(uint8_t pin) override
#define HAL_GPIO_C_LED_PIN
void pinMode(uint8_t pin, uint8_t output) override
#define PX4_GPIO_EXT_IO_RELAY2_PIN
void toggle(uint8_t pin) override
virtual void printf(const char *,...) FMT_PRINTF(2
#define PX4_GPIO_EXT_FMU_RELAY2_PIN
bool attach_interrupt(uint8_t interrupt_num, AP_HAL::Proc p, uint8_t mode) override
#define PX4_GPIO_PIEZO_PIN
void write(uint8_t pin, uint8_t value) override
void mode(uint8_t output)
bool usb_connected(void) override
#define HAL_GPIO_B_LED_PIN
void panic(const char *errormsg,...) FMT_PRINTF(1
void write(uint8_t value)
#define PX4_GPIO_EXT_IO_RELAY1_PIN
#define PX4_GPIO_EXT_IO_ACC1_PIN
PX4DigitalSource(uint8_t v)