问题遇到的现象和发生背景
RBR、THR、DLL公用同一块地址,
如图所示,
再uint32_t 之前加不同的__IM /__OM /__IOM
能不能这么用
问题相关代码,请勿粘贴截图
#define __IM volatile const /*! Defines 'read only' structure member permissions */
#define __OM volatile /*! Defines 'write only' structure member permissions */
#define __IOM volatile
typedef struct {
union {
__IM uint32_t RBR; /*< *R eceive B u ffer Register offset 0x0 * >*/
__OM uint32_t THR; /*< *R eceive B u ffer Register offset 0x0 * >*/
__IOM uint32_t DLL; /*< *R eceive B u ffer Register offset 0x0 * >*/
}offset_0;
}