C/C++,在 Doxygen 的结构中记录结构

问题描述

我对 doxygen 还很陌生。我正在尝试为我们的 Onethinx LoRaWAN 模块记录一些库。我们在联合内部的结构中使用 struct 在两个内核(ARM Cortex M4 和 M0+)之间传递一些数据。结构紧凑,可根据需要使用尽可能少的空间。

    typedef union {
    struct  __attribute__ ((__packed__)) {
        struct  __attribute__ ((__packed__)) {
            bool                    Confirmed           : 1;            //!< Conformation of the uplink message
            uint8_t                                     : 7;            //!< Reserved,do not use
            Radio_DataRate_e        DataRate            : 8;            //!< LoRaWAN Send data rate
            Radio_TXpower_e         Power               : 8;            //!< LoRaWAN Send output power
            uint8_t                 FPort               : 8;            //!< Port Field for distinguishing different messages (0 = reserved for MAC commands)
        } TX;
        struct  __attribute__ ((__packed__)) {
            LoRaWAN_keys_t *        KeysPtr;
            Radio_DataRate_e        DataRate            : 8;            //!< LoRaWAN Join Data Rate. Not used for US version (defined by LoRaWAN spec)
            Radio_TXpower_e         Power               : 8;            //!< LoRaWAN Join output power
            uint8_t                 MAXTries            : 8;            //!< Maximum tries before Join fails. Join requests are spaced out according to the LoRaWAN specification.
            uint8_t                 SubBand_1st         : 4;            //!< LoRaWAN First Sub-Band
            uint8_t                 SubBand_2nd         : 4;            //!< LoRaWAN Second Sub-Band
        } Join;
        struct  __attribute__ ((__packed__)) {
            struct {
                IdleMode_e              Mode            : 2;            //!< Set Idle Mode to idleActive,idleSleep or idleDeepSleep
                bool                    BleEcoON        : 1;            //!< Leaves BLE ECO ON during idle. Consumes additional power,enable only when ECO/BLE functionality is needed
                bool                    DebugON         : 1;            //!< Leaves Debug Port active during idle. Consumes additional power,enable only for debugging purposes
        
            } Idle;
        } System;
    };
    uint8_t reserved[32];
} coreConfiguration_t;

我在用 doxygen 区分什么是可变的,什么不是。有人可以推荐一种方法来解决这个问题吗?你会如何记录这个?

我宁愿不分享我在记录这一点时所做的糟糕尝试。任何帮助都是好的!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)