Subversion Repositories chibiosIgnition

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.     ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
  3.                  2011,2012 Giovanni Di Sirio.
  4.  
  5.     This file is part of ChibiOS/RT.
  6.  
  7.     ChibiOS/RT is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation; either version 3 of the License, or
  10.     (at your option) any later version.
  11.  
  12.     ChibiOS/RT is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.  
  17.     You should have received a copy of the GNU General Public License
  18.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19.  
  20.                                       ---
  21.  
  22.     A special exception to the GPL can be applied should you wish to distribute
  23.     a combined work that includes ChibiOS/RT, without being obliged to provide
  24.     the source code for any proprietary components. See the file exception.txt
  25.     for full details of how and when the exception can be applied.
  26. */
  27.  
  28. #ifndef _BOARD_H_
  29. #define _BOARD_H_
  30.  
  31. /*
  32.  * Setup for the bluePill STM32F103 proto board.
  33.  */
  34.  
  35. /*
  36.  * Board identifier.
  37.  */
  38. #define BOARD_ST_BLUE_PILL_F103
  39. #define BOARD_NAME              "Blue Pill STM32F103"
  40.  
  41. /*
  42.  * Board frequencies.
  43.  */
  44. #define STM32_LSECLK            32768
  45. #define STM32_HSECLK            8000000
  46.  
  47. /*
  48.  * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
  49.  */
  50. #define STM32F103xB
  51.  
  52. /*
  53.  * IO pins assignments.
  54.  */
  55.  
  56.  #define GPIOC_LED               13
  57.  
  58. #define GPIOA_STROBE            0
  59. #define GPIOA_COIL              6
  60.  
  61.  
  62. /*
  63.  * I/O ports initial setup, this configuration is established soon after reset
  64.  * in the initialization code.
  65.  *
  66.  * The digits have the following meaning:
  67.  *   0 - Analog input.
  68.  *   1 - Push Pull output 10MHz.
  69.  *   2 - Push Pull output 2MHz.
  70.  *   3 - Push Pull output 50MHz.
  71.  *   4 - Digital input.
  72.  *   5 - Open Drain output 10MHz.
  73.  *   6 - Open Drain output 2MHz.
  74.  *   7 - Open Drain output 50MHz.
  75.  *   8 - Digital input with PullUp or PullDown resistor depending on ODR.
  76.  *   9 - Alternate Push Pull output 10MHz.
  77.  *   A - Alternate Push Pull output 2MHz.
  78.  *   B - Alternate Push Pull output 50MHz.
  79.  *   C - Reserved.
  80.  *   D - Alternate Open Drain output 10MHz.
  81.  *   E - Alternate Open Drain output 2MHz.
  82.  *   F - Alternate Open Drain output 50MHz.
  83.  * Please refer to the STM32 Reference Manual for details.
  84.  */
  85.  
  86. /*
  87.  * Port A setup.
  88.  * Everything input with pull-up except:
  89.  * PA0  - Alternate open drain output  Timer 2 Channel 1    (STROBE).
  90.  * PA1  - Digital Input Timer 2 Channel 2
  91.  * PA2  - ADC channel 2
  92.  * PA3  - ADC channel 3
  93.  * PA8 - Timer 1 output 1
  94.  *
  95.  */
  96. #define VAL_GPIOACRL            0x8488008B   /*  PA7...PA0 */
  97. #define VAL_GPIOACRH            0x8888888B   /* PA15...PA8 */
  98. #define VAL_GPIOAODR            0xFFFFFFFF
  99.  
  100. /*
  101.  * Port B setup.
  102.  * Everything input with pull-up except:
  103.  * PB5 - SPI1 MOSI  2MHz
  104.  * PB3- SPI1 SCK1  2MHz
  105.  * PB6  Display CS
  106.  * PB7  Display CD
  107.  * PB8  Display Reset
  108.   */
  109. #define VAL_GPIOBCRL            0x11989888      /*  PB7...PB0 */
  110. #define VAL_GPIOBCRH            0x88888881     /* PB15...PB8 */
  111. #define VAL_GPIOBODR            0xFFFFFFFF
  112.  
  113. /*
  114.  * Port C setup.
  115.  * Everything input with pull-up except:
  116.  
  117.  * PC13 - Push Pull output (LED).
  118.  */
  119. #define VAL_GPIOCCRL            0x88888888      /*  PC7...PC0 */
  120. #define VAL_GPIOCCRH            0x88388888      /* PC15...PC8 */
  121. #define VAL_GPIOCODR            0xFFFFFFFF
  122.  
  123. /*
  124.  * Port D setup.
  125.  * Everything input with pull-up except:
  126.  * PD0  - Normal input (XTAL).
  127.  * PD1  - Normal input (XTAL).
  128.  */
  129. #define VAL_GPIODCRL            0x88888844      /*  PD7...PD0 */
  130. #define VAL_GPIODCRH            0x88888888      /* PD15...PD8 */
  131. #define VAL_GPIODODR            0xFFFFFFFF
  132.  
  133. /*
  134.  * Port E setup.
  135.  * Everything input with pull-up except:
  136.  */
  137. #define VAL_GPIOECRL            0x88888888      /*  PE7...PE0 */
  138. #define VAL_GPIOECRH            0x88888888      /* PE15...PE8 */
  139. #define VAL_GPIOEODR            0xFFFFFFFF
  140.  
  141.  
  142. /*
  143.  * USB bus activation macro, required by the USB driver.
  144.  */
  145. #define usb_lld_connect_bus(usbp) {}
  146.  
  147. /*
  148.  * USB bus de-activation macro, required by the USB driver.
  149.  */
  150. #define usb_lld_disconnect_bus(usbp) {}
  151.  
  152.  
  153. #if !defined(_FROM_ASM_)
  154. #ifdef __cplusplus
  155. extern "C" {
  156. #endif
  157.   void boardInit(void);
  158. #ifdef __cplusplus
  159. }
  160. #endif
  161. #endif /* _FROM_ASM_ */
  162.  
  163. #endif /* _BOARD_H_ */
  164.