/* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. ChibiOS/RT 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. ChibiOS/RT 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, see . --- A special exception to the GPL can be applied should you wish to distribute a combined work that includes ChibiOS/RT, without being obliged to provide the source code for any proprietary components. See the file exception.txt for full details of how and when the exception can be applied. */ #ifndef _BOARD_H_ #define _BOARD_H_ /* * Config for Paatti mainboard */ /* * Board identifier. */ #define BOARD_NAME "Paatti mainboard" /* * Board frequencies. */ #define STM32_HSECLK 8000000 /* * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. */ #define STM32F10X_CL /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. * * The digits have the following meaning: * 0 - Analog input. * 1 - Push Pull output 10MHz. * 2 - Push Pull output 2MHz. * 3 - Push Pull output 50MHz. * 4 - Digital input. * 5 - Open Drain output 10MHz. * 6 - Open Drain output 2MHz. * 7 - Open Drain output 50MHz. * 8 - Digital input with PullUp or PullDown resistor depending on ODR. * 9 - Alternate Push Pull output 10MHz. * A - Alternate Push Pull output 2MHz. * B - Alternate Push Pull output 50MHz. * C - Reserved. * D - Alternate Open Drain output 10MHz. * E - Alternate Open Drain output 2MHz. * F - Alternate Open Drain output 50MHz. * Please refer to the STM32 Reference Manual for details. */ /* Port list: * PA0 to PA3: Sonar analog inputs * PA4 - SD card chip select * PA5 - SD SCK * PA6 - SD MISO * PA7 - SD MOSI * PA8 - Motor 4A * PA9 - Usart 1 TX * PA10 - Usart 1 RX * PA11 - Motor 3A * PA12 - Motor 2A * PA13 - SWDIO * PA14 - SWCLK * PA15 - Motor 1A * * PB0 - Pressure sensor analog input * PB1 - Camera analog input * PB2 - HM55B Compass chip select * PB3 - SPI3 clock * PB4 - SPI3 MISO * PB5 - SPI3 MOSI * PB6 to PB9: SPI3 external board chip selects * PB10: Usart 3 TX, to GSM * PB11: Usart 3 RX, from GSM * PB12: GSM power switch, active high * PB13: Usart 3 CTS (input) * PB14: Usart 3 RTS (output) * PB15: 1-wire * * PC0 to PC3: Free pins * PC4: Sonar power switch, active high * PC5: Sonar TX enable * PC6: Motor 4B * PC7: Motor 3B * PC8: Motor 2B * PC9: Motor 1B * PC10: Uart 4 TX, to GPS * PC11: Uart 4 RX, from GPS * PC12 to PC15: Sonar TX pins * * PD2: LIS302 Accelerometer CS */ #define VAL_GPIOACRL 0xB4B70000 /* PA7...PA0 */ #define VAL_GPIOACRH 0x200224A2 /* PA15...PA8 */ #define VAL_GPIOAODR 0x00000010 #define VAL_GPIOBCRL 0x22A4A200 /* PB7...PB0 */ #define VAL_GPIOBCRH 0x2A424A22 /* PB15...PB8 */ #define VAL_GPIOBODR 0x00000004 #define VAL_GPIOCCRL 0xAA228888 /* PC7...PC0 */ #define VAL_GPIOCCRH 0x22224AAA /* PC15...PC8 */ #define VAL_GPIOCODR 0x00000000 #define VAL_GPIODCRL 0x88888200 /* PD7...PD0 */ #define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ #define VAL_GPIODODR 0x00000004 #if !defined(_FROM_ASM_) #ifdef __cplusplus extern "C" { #endif void boardInit(void); #ifdef __cplusplus } #endif #endif /* _FROM_ASM_ */ #endif /* _BOARD_H_ */