set the UART1 pin directions in uart1_init()
patch from Hedde Bosman
This commit is contained in:
parent
81a0a0356d
commit
a3412a0b81
|
@ -50,6 +50,14 @@ void uart1_init(uint16_t inc, uint16_t mod, uint8_t samp) {
|
|||
*UART1_UCON = 0;
|
||||
*UART1_UBRCNT = ( inc << 16 ) | mod;
|
||||
|
||||
/* TX and CTS as outputs */
|
||||
GPIO->PAD_DIR_SET.GPIO_14 = 1;
|
||||
GPIO->PAD_DIR_SET.GPIO_16 = 1;
|
||||
|
||||
/* RX and RTS as inputs */
|
||||
GPIO->PAD_DIR_RESET.GPIO_15 = 1;
|
||||
GPIO->PAD_DIR_RESET.GPIO_17 = 1;
|
||||
|
||||
/* see Section 11.5.1.2 Alternate Modes */
|
||||
/* you must enable the peripheral first BEFORE setting the function in GPIO_FUNC_SEL */
|
||||
/* From the datasheet: "The peripheral function will control operation of the pad IF */
|
||||
|
|
Loading…
Reference in a new issue