Skip to content

Commit c122ca1

Browse files
committed
restore missing board.c file
1 parent bb8e0ae commit c122ca1

File tree

1 file changed

+51
-0
lines changed
  • ports/stm/boards/stm32f746g_discovery

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
* Copyright (c) 2020 Mark Olsson <[email protected]>
8+
*
9+
* Permission is hereby granted, free of charge, to any person obtaining a copy
10+
* of this software and associated documentation files (the "Software"), to deal
11+
* in the Software without restriction, including without limitation the rights
12+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
* copies of the Software, and to permit persons to whom the Software is
14+
* furnished to do so, subject to the following conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be included in
17+
* all copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
*/
27+
28+
#include "supervisor/board.h"
29+
#include "stm32f7xx_hal.h"
30+
#include "common-hal/microcontroller/Pin.h"
31+
32+
void board_init(void) {
33+
GPIO_InitTypeDef GPIO_InitStructure;
34+
35+
__HAL_RCC_GPIOK_CLK_ENABLE();
36+
37+
/*
38+
* Turn off the backlight as it is distracting during development.
39+
* LCD_BL_CTRL = PK3
40+
*/
41+
GPIO_InitStructure.Pin = GPIO_PIN_3;
42+
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
43+
GPIO_InitStructure.Pull = GPIO_PULLUP;
44+
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
45+
HAL_GPIO_Init(GPIOK, &GPIO_InitStructure);
46+
HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_RESET);
47+
48+
never_reset_pin_number(10, 3);
49+
}
50+
51+
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.

0 commit comments

Comments
 (0)