@
@ Mecrisp-Stellaris - A native code Forth implementation for ARM-Cortex M microcontrollers
@ Copyright (C) 2013 Matthias Koch
@
@ This program is free software: you can redistribute it and/or modify
@ it under the terms of the GNU General Public License as published by
@ the Free Software Foundation, either version 3 of the License, or
@ (at your option) any later version.
@
@ This program is distributed in the hope that it will be useful,
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ GNU General Public License for more details.
@
@ You should have received a copy of the GNU General Public License
@ along with this program. If not, see .
@
@ Terminalroutinen
@ Terminal code and initialisations.
@ Porting: Rewrite this !
@ stm32wb55 nucleo board uses PB6 and PB7 on USART1
@ -----------------------------------------------------------------------------
uart_init:
@ ( -- ) A few bits are different
@ -----------------------------------------------------------------------------
@ Enable all GPIO peripheral clock
ldr r1, =RCC_AHB2ENR
ldr r0, =BIT7+BIT6+BIT5+BIT4+BIT3+BIT2+BIT1+BIT0 @ $0 is Reset value
str r0, [r1]
@ Enable the USART1 peripheral clock
ldr r1, =RCC_APB2ENR
ldr r0, =1<