mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-10 18:24:11 +01:00
7637e9f669
BMA180 driver.
218 lines
7.0 KiB
C
218 lines
7.0 KiB
C
/**
|
|
******************************************************************************
|
|
* @addtogroup OpenPilotSystem OpenPilot System
|
|
* @{
|
|
* @addtogroup OpenPilotCore OpenPilot Core
|
|
* @{
|
|
* @file pios_board.h
|
|
* @author David "Buzz" Carlson (buzz@chebuzz.com)
|
|
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
|
|
* @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
|
|
* (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
|
|
* 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.,
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
|
|
#ifndef STM3210E_INS_H_
|
|
#define STM3210E_INS_H_
|
|
|
|
|
|
|
|
//------------------------
|
|
// Timers and Channels Used
|
|
//------------------------
|
|
/*
|
|
Timer | Channel 1 | Channel 2 | Channel 3 | Channel 4
|
|
------+-----------+-----------+-----------+----------
|
|
TIM1 | | | |
|
|
TIM2 | --------------- PIOS_DELAY -----------------
|
|
TIM3 | | | |
|
|
TIM4 | | | |
|
|
TIM5 | | | |
|
|
TIM6 | | | |
|
|
TIM7 | | | |
|
|
TIM8 | | | |
|
|
------+-----------+-----------+-----------+----------
|
|
*/
|
|
|
|
//------------------------
|
|
// DMA Channels Used
|
|
//------------------------
|
|
/* Channel 1 - */
|
|
/* Channel 2 - SPI1 RX */
|
|
/* Channel 3 - SPI1 TX */
|
|
/* Channel 4 - SPI2 RX */
|
|
/* Channel 5 - SPI2 TX */
|
|
/* Channel 6 - */
|
|
/* Channel 7 - */
|
|
/* Channel 8 - */
|
|
/* Channel 9 - */
|
|
/* Channel 10 - */
|
|
/* Channel 11 - */
|
|
/* Channel 12 - */
|
|
|
|
//------------------------
|
|
// BOOTLOADER_SETTINGS
|
|
//------------------------
|
|
#define BOARD_READABLE TRUE
|
|
#define BOARD_WRITABLE TRUE
|
|
#define MAX_DEL_RETRYS 3
|
|
|
|
|
|
//------------------------
|
|
// PIOS_LED
|
|
//------------------------
|
|
#define PIOS_LED_LED1_GPIO_PORT GPIOE
|
|
#define PIOS_LED_LED1_GPIO_PIN GPIO_Pin_2
|
|
#define PIOS_LED_LED1_GPIO_CLK RCC_APB2Periph_GPIOE
|
|
#define PIOS_LED_LED2_GPIO_PORT GPIOE
|
|
#define PIOS_LED_LED2_GPIO_PIN GPIO_Pin_3
|
|
#define PIOS_LED_LED2_GPIO_CLK RCC_APB2Periph_GPIOE
|
|
#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 }
|
|
|
|
//------------------------
|
|
// PIOS_SPI
|
|
// See also pios_board.c
|
|
//------------------------
|
|
#define PIOS_SPI_MAX_DEVS 3
|
|
|
|
//------------------------
|
|
// PIOS_WDG
|
|
//------------------------
|
|
#define PIOS_WATCHDOG_TIMEOUT 250
|
|
#define PIOS_WDG_REGISTER RTC_BKP_DR4
|
|
#define PIOS_WDG_ACTUATOR 0x0001
|
|
#define PIOS_WDG_STABILIZATION 0x0002
|
|
#define PIOS_WDG_ATTITUDE 0x0004
|
|
#define PIOS_WDG_MANUAL 0x0008
|
|
|
|
//------------------------
|
|
// PIOS_I2C
|
|
// See also pios_board.c
|
|
//------------------------
|
|
#define PIOS_I2C_MAX_DEVS 3
|
|
extern uint32_t pios_i2c_mag_adapter_id;
|
|
#define PIOS_I2C_MAIN_ADAPTER (pios_i2c_mag_adapter_id)
|
|
|
|
//-------------------------
|
|
// PIOS_USART
|
|
//
|
|
// See also pios_board.c
|
|
//-------------------------
|
|
#define PIOS_USART_MAX_DEVS 2
|
|
|
|
//-------------------------
|
|
// PIOS_COM
|
|
//
|
|
// See also pios_board.c
|
|
//-------------------------
|
|
#define PIOS_COM_MAX_DEVS 4
|
|
extern uint32_t pios_com_telem_rf_id;
|
|
extern uint32_t pios_com_gps_id;
|
|
extern uint32_t pios_com_aux_id;
|
|
extern uint32_t pios_com_telem_usb_id;
|
|
#define PIOS_COM_AUX (pios_com_aux_id)
|
|
#define PIOS_COM_TELEM_USB (pios_com_telem_usb_id)
|
|
#define PIOS_COM_TELEM_RF (pios_com_telem_rf_id)
|
|
#define PIOS_COM_DEBUG PIOS_COM_AUX
|
|
|
|
//------------------------
|
|
// TELEMETRY
|
|
//------------------------
|
|
#define TELEM_QUEUE_SIZE 20
|
|
#define PIOS_TELEM_STACK_SIZE 624
|
|
|
|
//-------------------------
|
|
// System Settings
|
|
//-------------------------
|
|
#define PIOS_MASTER_CLOCK 168000000
|
|
#define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2)
|
|
|
|
//-------------------------
|
|
// Interrupt Priorities
|
|
//-------------------------
|
|
#define PIOS_IRQ_PRIO_LOW 12 // lower than RTOS
|
|
#define PIOS_IRQ_PRIO_MID 8 // higher than RTOS
|
|
#define PIOS_IRQ_PRIO_HIGH 5 // for SPI, ADC, I2C etc...
|
|
#define PIOS_IRQ_PRIO_HIGHEST 4 // for USART etc...
|
|
|
|
//------------------------
|
|
// PIOS_RCVR
|
|
// See also pios_board.c
|
|
//------------------------
|
|
#define PIOS_RCVR_MAX_DEVS 3
|
|
#define PIOS_RCVR_MAX_CHANNELS 12
|
|
|
|
//-------------------------
|
|
// Receiver PPM input
|
|
//-------------------------
|
|
#define PIOS_PPM_MAX_DEVS 1
|
|
#define PIOS_PPM_NUM_INPUTS 12
|
|
|
|
//-------------------------
|
|
// Receiver PWM input
|
|
//-------------------------
|
|
#define PIOS_PWM_MAX_DEVS 1
|
|
#define PIOS_PWM_NUM_INPUTS 8
|
|
|
|
//-------------------------
|
|
// Receiver SPEKTRUM input
|
|
//-------------------------
|
|
#define PIOS_SPEKTRUM_MAX_DEVS 2
|
|
#define PIOS_SPEKTRUM_NUM_INPUTS 12
|
|
|
|
//-------------------------
|
|
// Receiver S.Bus input
|
|
//-------------------------
|
|
#define PIOS_SBUS_MAX_DEVS 1
|
|
#define PIOS_SBUS_NUM_INPUTS (16+2)
|
|
|
|
//-------------------------
|
|
// Servo outputs
|
|
//-------------------------
|
|
#define PIOS_SERVO_UPDATE_HZ 50
|
|
#define PIOS_SERVOS_INITIAL_POSITION 0 /* dont want to start motors, have no pulse till settings loaded */
|
|
|
|
//--------------------------
|
|
// Timer controller settings
|
|
//--------------------------
|
|
#define PIOS_TIM_MAX_DEVS 6
|
|
|
|
//-------------------------
|
|
// ADC
|
|
// None.
|
|
//-------------------------
|
|
|
|
//--------------------------
|
|
// Flash chip
|
|
//--------------------------
|
|
#define PIOS_FLASH_ENABLE PIOS_SPI_RC_PinSet(PIOS_SPI_FLASH,0,0)
|
|
#define PIOS_FLASH_DISABLE PIOS_SPI_RC_PinSet(PIOS_SPI_FLASH,0,1);
|
|
|
|
|
|
|
|
|
|
#endif /* STM3210E_INS_H_ */
|
|
/**
|
|
* @}
|
|
* @}
|
|
*/
|