diff options
author | Dave Hylands <dhylands@gmail.com> | 2014-02-03 21:11:48 -0800 |
---|---|---|
committer | Dave Hylands <dhylands@gmail.com> | 2014-02-03 23:26:05 -0800 |
commit | 1570a96cad0b886f21a07eb13c3377a0f79abc1e (patch) | |
tree | 420ffc243157eb5b3d06b7e00ca0f7215fbd071a /stm/main.c | |
parent | 00c0b8a989ae54f4466d15b78a2e8729baf441ef (diff) |
Initial support for Netduino
This also fixes up the IRQ for the PYBOARD4 USERSW
although I was unable to test that functionality.
Diffstat (limited to 'stm/main.c')
-rw-r--r-- | stm/main.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/stm/main.c b/stm/main.c index b7d201cf0..5e2a3966d 100644 --- a/stm/main.c +++ b/stm/main.c @@ -602,6 +602,27 @@ int main(void) { GPIO_Init(GPIOD, &GPIO_InitStructure); } #endif +#if defined(NETDUINO_PLUS_2) + { + GPIO_InitTypeDef GPIO_InitStructure; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; + GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; + GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; + +#if MICROPY_HW_HAS_SDCARD + // Turn on the power enable for the sdcard (PB1) + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; + GPIO_Init(GPIOB, &GPIO_InitStructure); + GPIO_WriteBit(GPIOB, GPIO_Pin_1, Bit_SET); +#endif + + // Turn on the power for the 5V on the expansion header (PB2) + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; + GPIO_Init(GPIOB, &GPIO_InitStructure); + GPIO_WriteBit(GPIOB, GPIO_Pin_2, Bit_SET); + } +#endif // basic sub-system init sys_tick_init(); |