1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00
LibrePilot/flight/targets/boards/oplinkmini/firmware/inc/pios_board_posix.h

82 lines
2.9 KiB
C
Raw Normal View History

2013-04-05 22:46:56 +02:00
/**
******************************************************************************
*
* @file pios_board.h
2013-04-05 22:46:56 +02:00
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Defines board hardware for the OpenPilot Version 1.1 hardware.
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2013-04-05 22:46:56 +02:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2013-04-05 22:46:56 +02:00
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
2013-04-05 22:46:56 +02:00
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef PIOS_BOARD_H
#define PIOS_BOARD_H
// ------------------------
2013-04-05 22:46:56 +02:00
// PIOS_LED
// ------------------------
// #define PIOS_LED_LED1_GPIO_PORT GPIOC
// #define PIOS_LED_LED1_GPIO_PIN GPIO_Pin_12
// #define PIOS_LED_LED1_GPIO_CLK RCC_APB2Periph_GPIOC
// #define PIOS_LED_LED2_GPIO_PORT GPIOC
// #define PIOS_LED_LED2_GPIO_PIN GPIO_Pin_13
// #define PIOS_LED_LED2_GPIO_CLK RCC_APB2Periph_GPIOC
#define PIOS_LED_NUM 2
// #define PIOS_LED_PORTS { PIOS_LED_LED1_GPIO_PORT, PIOS_LED_LED2_GPIO_PORT }
// #define PIOS_LED_PINS { PIOS_LED_LED1_GPIO_PIN, PIOS_LED_LED2_GPIO_PIN }
// #define PIOS_LED_CLKS { PIOS_LED_LED1_GPIO_CLK, PIOS_LED_LED2_GPIO_CLK }
// -------------------------
2013-04-05 22:46:56 +02:00
// COM
//
// See also pios_board_posix.c
// -------------------------
// #define PIOS_USART_TX_BUFFER_SIZE 256
#define PIOS_COM_BUFFER_SIZE 1024
#define PIOS_UDP_RX_BUFFER_SIZE PIOS_COM_BUFFER_SIZE
2013-04-05 22:46:56 +02:00
#define PIOS_COM_TELEM_RF 0
#define PIOS_COM_GPS 1
#define PIOS_COM_TELEM_USB 2
2013-04-05 22:46:56 +02:00
#ifdef PIOS_ENABLE_AUX_UART
#define PIOS_COM_AUX 3
#define PIOS_COM_DEBUG PIOS_COM_AUX
2013-04-05 22:46:56 +02:00
#endif
/**
* glue macros for file IO
* STM32 uses DOSFS for file IO
*/
#define PIOS_FOPEN_READ(filename, file) (file = fopen((char *)filename, "r")) == NULL
2013-04-05 22:46:56 +02:00
#define PIOS_FOPEN_WRITE(filename, file) (file = fopen((char *)filename, "w")) == NULL
2013-04-05 22:46:56 +02:00
#define PIOS_FREAD(file, bufferadr, length, resultadr) (*resultadr = fread((uint8_t *)bufferadr, 1, length, *file)) != length
2013-04-05 22:46:56 +02:00
#define PIOS_FWRITE(file, bufferadr, length, resultadr) *resultadr = fwrite((uint8_t *)bufferadr, 1, length, *file)
2013-04-05 22:46:56 +02:00
#define PIOS_FCLOSE(file) fclose(file)
2013-04-05 22:46:56 +02:00
#define PIOS_FUNLINK(file) unlink((char *)filename)
2013-04-05 22:46:56 +02:00
#endif /* PIOS_BOARD_H */