blacksasi_f411m.cpp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /******************************************************************************
  2. * The MIT License
  3. *
  4. * Copyright (c) 2011 LeafLabs, LLC.
  5. *
  6. * Permission is hereby granted, free of charge, to any person
  7. * obtaining a copy of this software and associated documentation
  8. * files (the "Software"), to deal in the Software without
  9. * restriction, including without limitation the rights to use, copy,
  10. * modify, merge, publish, distribute, sublicense, and/or sell copies
  11. * of the Software, and to permit persons to whom the Software is
  12. * furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be
  15. * included in all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  18. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  20. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  21. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  22. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  23. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  24. * SOFTWARE.
  25. *****************************************************************************/
  26. /**
  27. * @file blacksasi_f411m.cpp
  28. * @author stevestrong
  29. * @brief blacksasi_f411m board file.
  30. */
  31. #include "blacksasi_f411m.h"
  32. #include <libmaple/gpio.h>
  33. #include <libmaple/timer.h>
  34. #include <libmaple/rccF4.h>
  35. #include <libmaple/rtc.h>
  36. #include <libmaple/dmaF4.h>
  37. #include <libmaple/libmaple_types.h>
  38. //static void initSRAMChip(void);
  39. /*****************************************************************************/
  40. // Alternate functions, see DocID022152 Rev 8, Table 9.
  41. /*****************************************************************************/
  42. void boardInit(void) {
  43. return;
  44. }
  45. /* to be defined
  46. const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = {
  47. 0, 1, 2, 3, 15, 16, 17, 19, 20, 21, 38, 39, 49, 41, 60, 61, 62, 63, 73, 75, 77, 78
  48. };
  49. */
  50. extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] = {
  51. PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PB0, PB1, PC0, PC1, PC2, PC3, PC4, PC5
  52. };
  53. const uint8 boardUsedPins[BOARD_NR_USED_PINS] = {
  54. BOARD_LED_PIN, BOARD_LED2_PIN, BOARD_LED2_PIN,BOARD_SWITCH1_PIN, BOARD_SWITCH2_PIN, BOARD_SWITCH3_PIN,
  55. BOARD_SWITCH4_PIN, BOARD_JTMS_SWDIO_PIN, BOARD_JTCK_SWCLK_PIN,PB0,PB1,
  56. USB_DM_PIN, USB_DP_PIN
  57. };
  58. // BOARD_SDIO_D0, BOARD_SDIO_D1, BOARD_SDIO_D2, BOARD_SDIO_D3, BOARD_SDIO_CLK, BOARD_SDIO_CMD,
  59. /*
  60. static void initSRAMChip(void) {
  61. fsmc_nor_psram_reg_map *regs = FSMC_NOR_PSRAM1_BASE;
  62. fsmc_sram_init_gpios();
  63. rcc_clk_enable(RCC_FSMC);
  64. regs->BCR = (FSMC_BCR_WREN | FSMC_BCR_MWID_16BITS | FSMC_BCR_MTYP_SRAM |
  65. FSMC_BCR_MBKEN);
  66. fsmc_nor_psram_set_addset(regs, 0);
  67. fsmc_nor_psram_set_datast(regs, 3);
  68. }
  69. */