大家好、
我´mn´t 配置 Ebyte 模块 E18-MS1PA2 CC2530 (其中包含 PA 和 LNA)、但我没有成功正确设置它。 根据亿字节数据表、需要更改这些文件 hal_board_cfg.h、 mac_radio_defs.c 和 mac_PIB.c 即使在设置之后,也没有什么事情发生!
注意:我会选择使用 HAL_PA_LNA 或 HAL_PA_LNA_CC2590、每次一个、在 IAR 编译器选项上、但我在 mac_PIB.c 上看到了 erros 我n´t 知道是否有必要这样做!
我现在使用的是 Z-Stack Home 1.2.2a.44539。
我对文件执行了 te2e.ti.com/.../E18_2D00_MS1PA2_2D00_PCB_5F00_UserManual_5F00_EN_5F00_v1.0.pdfhose 配置:
在 HAL_board_cfg.c 上-全局变量。
/* ------------------------------------------------------------------------------------------------ * CC2590/CC2591 support * * Define HAL_PA_LNA_CC2590 if CC2530+CC2590EM is used * Define HAL_PA_LNA if CC2530+CC2591EM is used * Note that only one of them can be defined * ------------------------------------------------------------------------------------------------ */ #define HAL_PA_LNA #define xHAL_PA_LNA_CC2590
在 mac_radio_defs.c 上- InSite macRadioTurnOnPower (void)函数
,我在函数末尾设置了 P1.1和 P1.0设置(从第46行到第52行)。
注意:这些引脚上的 CC2530上没有物理连接任何东西。
MAC_INTERNAL_API void macRadioTurnOnPower(void) { /* Enable RF error trap */ MAC_MCU_RFERR_ENABLE_INTERRUPT(); #if defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 || \ defined MAC_RUNTIME_SE2431L || defined MAC_RUNTIME_CC2592 /* table ID is referenced only when runtime configuration is enabled */ if (macRadioDefsRefTableId & 0xf0) #endif /* defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 */ #if defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 || \ defined MAC_RUNTIME_SE2431L || defined MAC_RUNTIME_CC2592 || \ defined HAL_PA_LNA || defined HAL_PA_LNA_CC2590 || \ defined HAL_PA_LNA_SE2431L || defined HAL_PA_LNA_CC2592 { /* either if compound statement or non-conditional compound statement */ /* (Re-)Configure PA and LNA control signals to RF frontend chips. * Note that The register values are not retained during sleep. */ if (paLnaChip == PA_LNA_SE2431L) { /* CPS or P0_7 maps closely to the HGM line */ HAL_PA_LNA_RX_HGM(); /* EN or CSD line is controlled via software so setting it high here to start the SE2431L frontend */ HAL_PA_LNA_RX_CSD_HIGH(); /* CTX or P1_1 maps closely to PAEN */ RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV; OBSSEL1 = OBSSEL_OBS_CTRL0; } else if(paLnaChip == PA_LNA_CC2592) { /* P1_1 -> PAEN */ RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV; OBSSEL1 = OBSSEL_OBS_CTRL0; /* P1_0 -> EN (LNA control) */ RFC_OBS_CTRL1 = RFC_OBS_CTRL_LNAMIX_PD_INV; OBSSEL0 = OBSSEL_OBS_CTRL1; } else { /* P1_1 -> PAEN */ RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV; OBSSEL1 = OBSSEL_OBS_CTRL0; /* P1_0 -> EN (LNA control) */ RFC_OBS_CTRL1 = RFC_OBS_CTRL_LNAMIX_PD_INV; OBSSEL0 = OBSSEL_OBS_CTRL1; } /* For any RX, change CCA settings for CC2591 compression workaround. * This will override LNA control if CC2591_COMPRESSION_WORKAROUND * flag is defined. */ }
在 mac_PIB.c 上- macPib_t macPibDefaults 局部变量内
/* ------------------------------------------------------------------------------------------------ * Local Variables * ------------------------------------------------------------------------------------------------ */ /* PIB default values */ static CODE const macPib_t macPibDefaults = { 54, /* ackWaitDuration */ FALSE, /* associationPermit */ TRUE, /* autoRequest */ FALSE, /* battLifeExt */ #if defined (HAL_PA_LNA) /*Proprietary Ebyte*/ 20, #elif defined (HAL_PA_LNA_CC2590) 11, #else #endif 6, /* battLifeExtPeriods */ NULL, /* *pMacBeaconPayload */ 0, /* beaconPayloadLength */ MAC_BO_NON_BEACON, /* beaconOrder */ 0, /* beaconTxTime */ 0, /* bsn */ {0, SADDR_MODE_EXT}, /* coordExtendedAddress */ MAC_SHORT_ADDR_NONE, /* coordShortAddress */ 0, /* dsn */ FALSE, /* gtsPermit */ 4, /* maxCsmaBackoffs */ 3, /* minBe */ 0xFFFF, /* panId */ FALSE, /* promiscuousMode */ FALSE, /* rxOnWhenIdle */ MAC_SHORT_ADDR_NONE, /* shortAddress */ MAC_SO_NONE, /* superframeOrder */ 0x01F4, /* transactionPersistenceTime */ FALSE, /* assocciatedPanCoord */ 5, /* maxBe */ 1220, /* maxFrameTotalWaitTime */ 3, /* maxFrameRetries */ 32, /* ResponseWaitTime */ 0, /* syncSymbolOffset */ TRUE, /* timeStampSupported */ FALSE, /* securityEnabled */ /* Proprietary */ 0, /* phyTransmitPower */ MAC_CHAN_11, /* logicalChannel */ {0, SADDR_MODE_EXT}, /* extendedAddress */ 1, /* altBe */ MAC_BO_NON_BEACON, /* deviceBeaconOrder */ 0, /* power savings for rf4ce */ 0, /* default is frame Ver is always 0, except for security enabled packets */ 0, /* diagsRxCrcPass */ 0, /* diagsRxCrcFail */ 0, /* diagsRxBcast */ 0, /* diagsTxBcast */ 0, /* diagsRxUcast */ 0, /* diagsTxUcast */ 0, /* diagsTxUcastRetry */ 0 /* diagsTxUcastFail */ };