diff options
author | Carles Cufi <carles.cufi@nordicsemi.no> | 2016-10-25 14:06:55 +0200 |
---|---|---|
committer | Anas Nashif <nashif@linux.intel.com> | 2016-10-25 18:40:56 +0000 |
commit | 33d17497d20e06837bf7632bc88a7c27d465c674 (patch) | |
tree | d5d16c3411fc690a751df150c03182292ae165df /arch | |
parent | 3daf30c912bac20828e82de022f445d242de5600 (diff) |
drivers: uart_nrf5: Use MDK baudrate divisor constants
The baudrate calculation present in set_baudrate() is
causing the UART to emit inital bytes incorrectly, for a
reason currently unknown, but directly related to the fact
that __aeabi_uldivmod is being invoked.
Since the nRF5x Product Specifications do not provide a
standard formula to calculate baudrates and instead list
a predefined set of divisor values, we opt here to use the
official values and remove the attempt at calculating them
manually.
Change-Id: Ic3ff42ea6d065e9a1d26a5350ce5bf5ad661160a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/soc/nordic_nrf5/include/nrf5_common.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/soc/nordic_nrf5/include/nrf5_common.h b/arch/arm/soc/nordic_nrf5/include/nrf5_common.h index eecbf3cf4..067705665 100644 --- a/arch/arm/soc/nordic_nrf5/include/nrf5_common.h +++ b/arch/arm/soc/nordic_nrf5/include/nrf5_common.h @@ -71,4 +71,28 @@ #define NRF52_IRQ_I2S_IRQn 37 #define NRF52_IRQ_FPU_IRQn 38 +/** + * @file UART baudrate divisors for NRF51/NRF52 family processors. + * + * Based on Nordic MDK included header file: nrf52_bitfields.h + * Uses the UARTE_BAUDRATE macros since they are more precise. + */ + +#define NRF5_UART_BAUDRATE_1200 0x0004f000 +#define NRF5_UART_BAUDRATE_2400 0x0009d000 +#define NRF5_UART_BAUDRATE_4800 0x0013b000 +#define NRF5_UART_BAUDRATE_9600 0x00275000 +#define NRF5_UART_BAUDRATE_14400 0x003af000 +#define NRF5_UART_BAUDRATE_19200 0x004ea000 +#define NRF5_UART_BAUDRATE_28800 0x0075c000 +#define NRF5_UART_BAUDRATE_38400 0x009d0000 +#define NRF5_UART_BAUDRATE_57600 0x00eb0000 +#define NRF5_UART_BAUDRATE_76800 0x013a9000 +#define NRF5_UART_BAUDRATE_115200 0x01d60000 +#define NRF5_UART_BAUDRATE_230400 0x03b00000 +#define NRF5_UART_BAUDRATE_250000 0x04000000 +#define NRF5_UART_BAUDRATE_460800 0x07400000 +#define NRF5_UART_BAUDRATE_921600 0x0f000000 +#define NRF5_UART_BAUDRATE_1000000 0x10000000 + #endif /* _NRF5_SOC_COMMON_H_ */ |