Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stmhal: Some NETDUINO_PLUS_2 cleanup
- Put the I2C bus on the corect pins - Add the appropriate board_init to power the shield
- Loading branch information
Showing
4 changed files
with
31 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include STM32_HAL_H | ||
|
||
void NETDUINO_PLUS_2_board_early_init(void) { | ||
|
||
__GPIOB_CLK_ENABLE(); | ||
|
||
// Turn off the backlight. LCD_BL_CTRL = PK3 | ||
GPIO_InitTypeDef GPIO_InitStructure; | ||
GPIO_InitStructure.Speed = GPIO_SPEED_HIGH; | ||
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; | ||
GPIO_InitStructure.Pull = GPIO_PULLUP; | ||
|
||
#if MICROPY_HW_HAS_SDCARD | ||
// Turn on the power enable for the sdcard (PB1) | ||
GPIO_InitStructure.Pin = GPIO_PIN_1; | ||
HAL_GPIO_Init(GPIOB, &GPIO_InitStructure); | ||
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_SET); | ||
#endif | ||
|
||
// Turn on the power for the 5V on the expansion header (PB2) | ||
GPIO_InitStructure.Pin = GPIO_PIN_2; | ||
HAL_GPIO_Init(GPIOB, &GPIO_InitStructure); | ||
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_2, GPIO_PIN_SET); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ D10,PB10 | |
D11,PB15 | ||
D12,PB14 | ||
D13,PB13 | ||
SDA,PB6 | ||
SCL,PB7 | ||
A0,PC0 | ||
A1,PC1 | ||
A2,PC2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters