Mercurial > louis > kiibohd-controller
comparison Output/uartOut/arm/uart_serial.c @ 334:9ac304aa1ab5
Adding initial dfu-upload code and debugging for Bootloader.
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Mon, 27 Apr 2015 00:57:34 -0700 |
parents | 5b66d1da5377 |
children | e8841d3c6db5 |
comparison
equal
deleted
inserted
replaced
333:772f9bea482b | 334:9ac304aa1ab5 |
---|---|
190 UART_C4 = 0x02; | 190 UART_C4 = 0x02; |
191 | 191 |
192 #elif defined(_mk20dx256vlh7_) // UART2 Debug | 192 #elif defined(_mk20dx256vlh7_) // UART2 Debug |
193 // Setup baud rate - 115200 Baud | 193 // Setup baud rate - 115200 Baud |
194 // Uses Bus Clock | 194 // Uses Bus Clock |
195 // 24 MHz / ( 16 * Baud ) = BDH/L | 195 // 36 MHz / ( 16 * Baud ) = BDH/L |
196 // Baud: 115200 -> 24 MHz / ( 16 * 115200 ) = 13.021 | 196 // Baud: 115200 -> 36 MHz / ( 16 * 115200 ) = 19.53125 |
197 // Thus baud setting = 13 | 197 // Thus baud setting = 19 |
198 // NOTE: If finer baud adjustment is needed see UARTx_C4 -> BRFA in the datasheet | 198 // NOTE: If finer baud adjustment is needed see UARTx_C4 -> BRFA in the datasheet |
199 uint16_t baud = 13; // Max setting of 8191 | 199 uint16_t baud = 19; // Max setting of 8191 |
200 UART_BDH = (uint8_t)(baud >> 8); | 200 UART_BDH = (uint8_t)(baud >> 8); |
201 UART_BDL = (uint8_t)baud; | 201 UART_BDL = (uint8_t)baud; |
202 UART_C4 = 0x01; | 202 UART_C4 = 0x11; |
203 | 203 |
204 #endif | 204 #endif |
205 | 205 |
206 // 8 bit, No Parity, Idle Character bit after stop | 206 // 8 bit, No Parity, Idle Character bit after stop |
207 UART_C1 = UART_C1_ILT; | 207 UART_C1 = UART_C1_ILT; |