共用体的问题,求解答

问题遇到的现象和发生背景

RBR、THR、DLL公用同一块地址,
如图所示,
再uint32_t 之前加不同的__IM /__OM /__IOM

能不能这么用

问题相关代码,请勿粘贴截图

img

#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;
}


运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果