AnsweredAssumed Answered

Bug in MKL25Z4.h for Initializing UART0 BDH?

Question asked by Alex Dean on Nov 14, 2016
Latest reply on Dec 8, 2016 by Alex Dean

I'm looking at the MKL25Z4.H macros for UART0 Baud Rate Generation. The UART0_BDH_SBR(x) macro doesn't seem to take the upper five bits of x, but I believe it should. Is this a bug, am I misusing the macro, or is there a newer version of the file available?

#define UART0_BDH_SBR_MASK  0x1Fu
#define UART0_BDH_SBR_SHIFT 0
#define UART0_BDH_SBR_WIDTH 5
#define UART0_BDH_SBR(x)    (((uint8_t)(((uint8_t)(x))<<UART0_BDH_SBR_SHIFT))&UART0_BDH_SBR_MASK)

 

Here's the version information for the file:

/*
** ###################################################################
**     Processors:          MKL25Z128FM4
**                          MKL25Z128FT4
**                          MKL25Z128LH4
**                          MKL25Z128VLK4
**
**     Compilers:           Keil ARM C/C++ Compiler
**                          Freescale C/C++ for Embedded ARM
**                          GNU C Compiler
**                          GNU C Compiler - CodeSourcery Sourcery G++
**                          IAR ANSI C/C++ Compiler for ARM
**
**     Reference manual:    KL25P80M48SF0RM, Rev.3, Sep 2012
**     Version:             rev. 2.5, 2015-02-19
**     Build:               b150721
**
**     Abstract:
**         CMSIS Peripheral Access Layer for MKL25Z4
**
**     Copyright (c) 1997 - 2015 Freescale Semiconductor, Inc.
**     All rights reserved.
*/

Outcomes