1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00
This commit is contained in:
James Cotton 2011-08-06 19:53:46 -05:00
parent 1ccb9a1947
commit f23ec059fe

View File

@ -1,220 +1,220 @@
/** /**
****************************************************************************** ******************************************************************************
* @addtogroup OpenPilotSystem OpenPilot System * @addtogroup OpenPilotSystem OpenPilot System
* @{ * @{
* @addtogroup OpenPilotCore OpenPilot Core * @addtogroup OpenPilotCore OpenPilot Core
* @{ * @{
* @file pios_board.h * @file pios_board.h
* @author David "Buzz" Carlson (buzz@chebuzz.com) * @author David "Buzz" Carlson (buzz@chebuzz.com)
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
* @brief Defines board hardware for the OpenPilot Version 1.1 hardware. * @brief Defines board hardware for the OpenPilot Version 1.1 hardware.
* @see The GNU Public License (GPL) Version 3 * @see The GNU Public License (GPL) Version 3
* *
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * 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., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef STM3210E_INS_H_ #ifndef STM3210E_INS_H_
#define STM3210E_INS_H_ #define STM3210E_INS_H_
//------------------------ //------------------------
// Timers and Channels Used // Timers and Channels Used
//------------------------ //------------------------
/* /*
Timer | Channel 1 | Channel 2 | Channel 3 | Channel 4 Timer | Channel 1 | Channel 2 | Channel 3 | Channel 4
------+-----------+-----------+-----------+---------- ------+-----------+-----------+-----------+----------
TIM1 | | | | TIM1 | | | |
TIM2 | --------------- PIOS_DELAY ----------------- TIM2 | --------------- PIOS_DELAY -----------------
TIM3 | | | | TIM3 | | | |
TIM4 | | | | TIM4 | | | |
TIM5 | | | | TIM5 | | | |
TIM6 | | | | TIM6 | | | |
TIM7 | | | | TIM7 | | | |
TIM8 | | | | TIM8 | | | |
------+-----------+-----------+-----------+---------- ------+-----------+-----------+-----------+----------
*/ */
//------------------------ //------------------------
// DMA Channels Used // DMA Channels Used
//------------------------ //------------------------
/* Channel 1 - */ /* Channel 1 - */
/* Channel 2 - SPI1 RX */ /* Channel 2 - SPI1 RX */
/* Channel 3 - SPI1 TX */ /* Channel 3 - SPI1 TX */
/* Channel 4 - SPI2 RX */ /* Channel 4 - SPI2 RX */
/* Channel 5 - SPI2 TX */ /* Channel 5 - SPI2 TX */
/* Channel 6 - */ /* Channel 6 - */
/* Channel 7 - */ /* Channel 7 - */
/* Channel 8 - */ /* Channel 8 - */
/* Channel 9 - */ /* Channel 9 - */
/* Channel 10 - */ /* Channel 10 - */
/* Channel 11 - */ /* Channel 11 - */
/* Channel 12 - */ /* Channel 12 - */
//------------------------ //------------------------
// BOOTLOADER_SETTINGS // BOOTLOADER_SETTINGS
//------------------------ //------------------------
#define BOARD_READABLE TRUE #define BOARD_READABLE TRUE
#define BOARD_WRITABLE TRUE #define BOARD_WRITABLE TRUE
#define MAX_DEL_RETRYS 3 #define MAX_DEL_RETRYS 3
#define EKF_RATE 75 #define EKF_RATE 75
//------------------------ //------------------------
// PIOS_LED // PIOS_LED
//------------------------ //------------------------
#define PIOS_LED_LED1_GPIO_PORT GPIOA #define PIOS_LED_LED1_GPIO_PORT GPIOA
#define PIOS_LED_LED1_GPIO_PIN GPIO_Pin_3 #define PIOS_LED_LED1_GPIO_PIN GPIO_Pin_3
#define PIOS_LED_LED1_GPIO_CLK RCC_APB2Periph_GPIOA #define PIOS_LED_LED1_GPIO_CLK RCC_APB2Periph_GPIOA
#define PIOS_LED_LED2_GPIO_PORT GPIOA #define PIOS_LED_LED2_GPIO_PORT GPIOA
#define PIOS_LED_LED2_GPIO_PIN GPIO_Pin_2 #define PIOS_LED_LED2_GPIO_PIN GPIO_Pin_2
#define PIOS_LED_LED2_GPIO_CLK RCC_APB2Periph_GPIOA #define PIOS_LED_LED2_GPIO_CLK RCC_APB2Periph_GPIOA
#define PIOS_LED_NUM 2 #define PIOS_LED_NUM 2
#define PIOS_LED_PORTS { PIOS_LED_LED1_GPIO_PORT, PIOS_LED_LED2_GPIO_PORT } #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_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 } #define PIOS_LED_CLKS { PIOS_LED_LED1_GPIO_CLK, PIOS_LED_LED2_GPIO_CLK }
//------------------------ //------------------------
// PIOS_SPI // PIOS_SPI
// See also pios_board.c // See also pios_board.c
//------------------------ //------------------------
#define PIOS_SPI_MAX_DEVS 2 #define PIOS_SPI_MAX_DEVS 2
//------------------------ //------------------------
// PIOS_I2C // PIOS_I2C
// See also pios_board.c // See also pios_board.c
//------------------------ //------------------------
#define PIOS_I2C_MAX_DEVS 3 #define PIOS_I2C_MAX_DEVS 3
extern uint32_t pios_i2c_pres_mag_adapter_id; extern uint32_t pios_i2c_pres_mag_adapter_id;
#define PIOS_I2C_MAIN_ADAPTER (pios_i2c_pres_mag_adapter_id) #define PIOS_I2C_MAIN_ADAPTER (pios_i2c_pres_mag_adapter_id)
extern uint32_t pios_i2c_gyro_adapter_id; extern uint32_t pios_i2c_gyro_adapter_id;
#define PIOS_I2C_GYRO_ADAPTER (pios_i2c_gyro_adapter_id) #define PIOS_I2C_GYRO_ADAPTER (pios_i2c_gyro_adapter_id)
//------------------------ //------------------------
// PIOS_BMP085 // PIOS_BMP085
//------------------------ //------------------------
#define PIOS_BMP085_EOC_GPIO_PORT GPIOC #define PIOS_BMP085_EOC_GPIO_PORT GPIOC
#define PIOS_BMP085_EOC_GPIO_PIN GPIO_Pin_2 #define PIOS_BMP085_EOC_GPIO_PIN GPIO_Pin_2
#define PIOS_BMP085_EOC_PORT_SOURCE GPIO_PortSourceGPIOC #define PIOS_BMP085_EOC_PORT_SOURCE GPIO_PortSourceGPIOC
#define PIOS_BMP085_EOC_PIN_SOURCE GPIO_PinSource2 #define PIOS_BMP085_EOC_PIN_SOURCE GPIO_PinSource2
#define PIOS_BMP085_EOC_CLK RCC_APB2Periph_GPIOC #define PIOS_BMP085_EOC_CLK RCC_APB2Periph_GPIOC
#define PIOS_BMP085_EOC_EXTI_LINE EXTI_Line2 #define PIOS_BMP085_EOC_EXTI_LINE EXTI_Line2
#define PIOS_BMP085_EOC_IRQn EXTI15_10_IRQn #define PIOS_BMP085_EOC_IRQn EXTI15_10_IRQn
#define PIOS_BMP085_EOC_PRIO PIOS_IRQ_PRIO_LOW #define PIOS_BMP085_EOC_PRIO PIOS_IRQ_PRIO_LOW
#define PIOS_BMP085_XCLR_GPIO_PORT GPIOC #define PIOS_BMP085_XCLR_GPIO_PORT GPIOC
#define PIOS_BMP085_XCLR_GPIO_PIN GPIO_Pin_1 #define PIOS_BMP085_XCLR_GPIO_PIN GPIO_Pin_1
#define PIOS_BMP085_OVERSAMPLING 3 #define PIOS_BMP085_OVERSAMPLING 3
//------------------------- //-------------------------
// PIOS_USART // PIOS_USART
// //
// See also pios_board.c // See also pios_board.c
//------------------------- //-------------------------
#define PIOS_USART_MAX_DEVS 2 #define PIOS_USART_MAX_DEVS 2
//------------------------- //-------------------------
// PIOS_COM // PIOS_COM
// //
// See also pios_board.c // See also pios_board.c
//------------------------- //-------------------------
#define PIOS_COM_MAX_DEVS 2 #define PIOS_COM_MAX_DEVS 2
extern uint32_t pios_com_aux_id; extern uint32_t pios_com_aux_id;
#define PIOS_COM_AUX (pios_com_aux_id) #define PIOS_COM_AUX (pios_com_aux_id)
#define PIOS_COM_DEBUG PIOS_COM_AUX #define PIOS_COM_DEBUG PIOS_COM_AUX
//------------------------- //-------------------------
// System Settings // System Settings
//------------------------- //-------------------------
#define PIOS_MASTER_CLOCK 72000000 #define PIOS_MASTER_CLOCK 72000000
#define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2) #define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2)
//------------------------- //-------------------------
// Interrupt Priorities // Interrupt Priorities
//------------------------- //-------------------------
#define PIOS_IRQ_PRIO_LOW 12 // lower than RTOS #define PIOS_IRQ_PRIO_LOW 12 // lower than RTOS
#define PIOS_IRQ_PRIO_MID 8 // higher 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_HIGH 5 // for SPI, ADC, I2C etc...
#define PIOS_IRQ_PRIO_HIGHEST 4 // for USART etc... #define PIOS_IRQ_PRIO_HIGHEST 4 // for USART etc...
//------------------------- //-------------------------
// ADC // ADC
// None. // None.
//------------------------- //-------------------------
//------------------------- //-------------------------
// GPIO // GPIO
// Not used, but pios_gpio.c expects something // Not used, but pios_gpio.c expects something
//------------------------- //-------------------------
#define PIOS_GPIO_1_PORT GPIOA #define PIOS_GPIO_1_PORT GPIOA
#define PIOS_GPIO_1_PIN GPIO_Pin_1 #define PIOS_GPIO_1_PIN GPIO_Pin_1
#define PIOS_GPIO_1_GPIO_CLK RCC_APB2Periph_GPIOA #define PIOS_GPIO_1_GPIO_CLK RCC_APB2Periph_GPIOA
#define PIOS_GPIO_PORTS { PIOS_GPIO_1_PORT } #define PIOS_GPIO_PORTS { PIOS_GPIO_1_PORT }
#define PIOS_GPIO_PINS { PIOS_GPIO_1_PIN } #define PIOS_GPIO_PINS { PIOS_GPIO_1_PIN }
#define PIOS_GPIO_CLKS { PIOS_GPIO_1_GPIO_CLK } #define PIOS_GPIO_CLKS { PIOS_GPIO_1_GPIO_CLK }
#define PIOS_GPIO_NUM 1 #define PIOS_GPIO_NUM 1
//------------------------ //------------------------
// BMA180 // BMA180
//------------------------ //------------------------
#define PIOS_BMA180_ENABLE PIOS_SPI_RC_PinSet(PIOS_SPI_ACCEL,0) #define PIOS_BMA180_ENABLE PIOS_SPI_RC_PinSet(PIOS_SPI_ACCEL,0)
#define PIOS_BMA180_DISABLE PIOS_SPI_RC_PinSet(PIOS_SPI_ACCEL,1) #define PIOS_BMA180_DISABLE PIOS_SPI_RC_PinSet(PIOS_SPI_ACCEL,1)
#define PIOS_BMA180_DRDY_GPIO_PORT GPIOC #define PIOS_BMA180_DRDY_GPIO_PORT GPIOC
#define PIOS_BMA180_DRDY_GPIO_PIN GPIO_Pin_4 #define PIOS_BMA180_DRDY_GPIO_PIN GPIO_Pin_4
#define PIOS_BMA180_DRDY_PORT_SOURCE GPIO_PortSourceGPIOC #define PIOS_BMA180_DRDY_PORT_SOURCE GPIO_PortSourceGPIOC
#define PIOS_BMA180_DRDY_PIN_SOURCE GPIO_PinSource4 #define PIOS_BMA180_DRDY_PIN_SOURCE GPIO_PinSource4
#define PIOS_BMA180_DRDY_CLK RCC_APB2Periph_GPIOC #define PIOS_BMA180_DRDY_CLK RCC_APB2Periph_GPIOC
#define PIOS_BMA180_DRDY_EXTI_LINE EXTI_Line4 #define PIOS_BMA180_DRDY_EXTI_LINE EXTI_Line4
#define PIOS_BMA180_DRDY_IRQn EXTI4_IRQn #define PIOS_BMA180_DRDY_IRQn EXTI4_IRQn
#define PIOS_BMA180_DRDY_PRIO PIOS_IRQ_PRIO_LOW #define PIOS_BMA180_DRDY_PRIO PIOS_IRQ_PRIO_LOW
//------------------------ //------------------------
// PIOS_HMC5883 // PIOS_HMC5883
//------------------------ //------------------------
#define PIOS_HMC5883_DRDY_GPIO_PORT GPIOB #define PIOS_HMC5883_DRDY_GPIO_PORT GPIOB
#define PIOS_HMC5883_DRDY_GPIO_PIN GPIO_Pin_8 #define PIOS_HMC5883_DRDY_GPIO_PIN GPIO_Pin_8
#define PIOS_HMC5883_DRDY_PORT_SOURCE GPIO_PortSourceGPIOB #define PIOS_HMC5883_DRDY_PORT_SOURCE GPIO_PortSourceGPIOB
#define PIOS_HMC5883_DRDY_PIN_SOURCE GPIO_PinSource8 #define PIOS_HMC5883_DRDY_PIN_SOURCE GPIO_PinSource8
#define PIOS_HMC5883_DRDY_CLK RCC_APB2Periph_GPIOB #define PIOS_HMC5883_DRDY_CLK RCC_APB2Periph_GPIOB
#define PIOS_HMC5883_DRDY_EXTI_LINE EXTI_Line8 #define PIOS_HMC5883_DRDY_EXTI_LINE EXTI_Line8
#define PIOS_HMC5883_DRDY_IRQn EXTI9_5_IRQn #define PIOS_HMC5883_DRDY_IRQn EXTI9_5_IRQn
#define PIOS_HMC5883_DRDY_PRIO PIOS_IRQ_PRIO_LOW #define PIOS_HMC5883_DRDY_PRIO PIOS_IRQ_PRIO_LOW
//------------------------ //------------------------
// PIOS_IMU3000 // PIOS_IMU3000
//------------------------ //------------------------
#define PIOS_IMU3000_INT_GPIO_PORT GPIOB #define PIOS_IMU3000_INT_GPIO_PORT GPIOB
#define PIOS_IMU3000_INT_GPIO_PIN GPIO_Pin_1 #define PIOS_IMU3000_INT_GPIO_PIN GPIO_Pin_1
#define PIOS_IMU3000_INT_PORT_SOURCE GPIO_PortSourceGPIOB #define PIOS_IMU3000_INT_PORT_SOURCE GPIO_PortSourceGPIOB
#define PIOS_IMU3000_INT_PIN_SOURCE GPIO_PinSource1 #define PIOS_IMU3000_INT_PIN_SOURCE GPIO_PinSource1
#define PIOS_IMU3000_INT_CLK RCC_APB2Periph_GPIOB #define PIOS_IMU3000_INT_CLK RCC_APB2Periph_GPIOB
#define PIOS_IMU3000_INT_EXTI_LINE EXTI_Line1 #define PIOS_IMU3000_INT_EXTI_LINE EXTI_Line1
#define PIOS_IMU3000_INT_IRQn EXTI1_IRQn #define PIOS_IMU3000_INT_IRQn EXTI1_IRQn
#define PIOS_IMU3000_INT_PRIO PIOS_IRQ_PRIO_HIGH #define PIOS_IMU3000_INT_PRIO PIOS_IRQ_PRIO_HIGH
#endif /* STM3210E_INS_H_ */ #endif /* STM3210E_INS_H_ */
/** /**
* @} * @}
* @} * @}
*/ */