⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mac_radio.lst

📁 CC2431无线定位程序非常有参考价值
💻 LST
📖 第 1 页 / 共 5 页
字号:
    449           *
    450           * @return      highest energy detect measurement
    451           **************************************************************************************************
    452           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    453          uint8 macRadioEnergyDetectStop(void)
   \                     macRadioEnergyDetectStop:
    454          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    455            uint8 rssiDbm;
    456            uint8 energyDetectMeasurement;
    457            
    458            rssiDbm = MAC_RADIO_RECORD_MAX_RSSI_STOP() + MAC_RADIO_RSSI_OFFSET;
   \   000004                ; Setup parameters for call to function macMcuRecordMaxRssiStop
   \   000004   90....       MOV     DPTR,#(macMcuRecordMaxRssiStop & 0xffff)
   \   000007   74..         MOV     A,#((macMcuRecordMaxRssiStop >> 16) & 0xff)
   \   000009   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   00000C   E9           MOV     A,R1
   \   00000D   24D3         ADD     A,#-0x2d
   \   00000F   F9           MOV     R1,A
    459            energyDetectMeasurement = radioComputeED(rssiDbm);
    460            
    461            return(energyDetectMeasurement);
   \   000010                ; Setup parameters for call to function radioComputeED
   \   000010   02....       LJMP    ?Subroutine0 & 0xFFFF
    462          }
    463          
    464          /*=================================================================================================
    465           * @fn          radioComputeED
    466           *
    467           * @brief       Compute energy detect measurement.
    468           *
    469           * @param       rssi - raw RSSI value from radio hardware
    470           *
    471           * @return      energy detect measurement in the range of 0x00-0xFF
    472           *=================================================================================================
    473           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    474          static uint8 radioComputeED(int8 rssiDbm)
   \                     ??radioComputeED:
    475          {
   \   000000                ; Saved register size: 0
   \   000000                ; Auto size: 0
    476            uint8 ed;
    477            
    478            /*
    479             *  Keep RF power between minimum and maximum values.
    480             *  This min/max range is derived from datasheet and specification.
    481             */
    482            if (rssiDbm < ED_RF_POWER_MIN_DBM)
   \   000000   E9           MOV     A,R1
   \   000001   C3           CLR     C
   \   000002   94AF         SUBB    A,#-0x51
   \   000004   A2D2         MOV     C,0xD0 /* PSW */.2
   \   000006   65D0         XRL     A,PSW
   \   000008   33           RLC     A
   \   000009   5004         JNC     ??radioComputeED_1
    483            {
    484              rssiDbm = ED_RF_POWER_MIN_DBM;
   \   00000B   79AF         MOV     R1,#-0x51
   \   00000D   800D         SJMP    ??radioComputeED_2
    485            }
    486            else if (rssiDbm > ED_RF_POWER_MAX_DBM)
   \                     ??radioComputeED_1:
   \   00000F   E9           MOV     A,R1
   \   000010   C3           CLR     C
   \   000011   940B         SUBB    A,#0xb
   \   000013   A2D2         MOV     C,0xD0 /* PSW */.2
   \   000015   65D0         XRL     A,PSW
   \   000017   33           RLC     A
   \   000018   4002         JC      ??radioComputeED_2
    487            {
    488              rssiDbm = ED_RF_POWER_MAX_DBM;
   \   00001A   790A         MOV     R1,#0xa
    489            }
    490            
    491            /*
    492             *  Create energy detect measurement by normalizing and scaling RF power level.
    493             *
    494             *  Note : The division operation below is designed for maximum accuracy and
    495             *         best granularity.  This is done by grouping the math operations to
    496             *         compute the entire numerator before doing any division.
    497             */
    498            ed = (MAC_SPEC_ED_MAX * (rssiDbm - ED_RF_POWER_MIN_DBM)) / (ED_RF_POWER_MAX_DBM - ED_RF_POWER_MIN_DBM);
    499          
    500            return(ed);
   \                     ??radioComputeED_2:
   \   00001C   E9           MOV     A,R1
   \   00001D   F8           MOV     R0,A
   \   00001E   33           RLC     A
   \   00001F   95E0         SUBB    A,0xE0 /* A   */
   \   000021   F9           MOV     R1,A
   \   000022   7451         MOV     A,#0x51
   \   000024   28           ADD     A,R0
   \   000025   F8           MOV     R0,A
   \   000026   E4           CLR     A
   \   000027   39           ADDC    A,R1
   \   000028   F9           MOV     R1,A
   \   000029   E8           MOV     A,R0
   \   00002A   75F0FF       MOV     B,#-0x1
   \   00002D   A4           MUL     AB
   \   00002E   F8           MOV     R0,A
   \   00002F   AAF0         MOV     R2,B
   \   000031   75F0FF       MOV     B,#-0x1
   \   000034   E9           MOV     A,R1
   \   000035   A4           MUL     AB
   \   000036   2A           ADD     A,R2
   \   000037   F9           MOV     R1,A
   \   000038   7A5B         MOV     R2,#0x5b
   \   00003A   7B00         MOV     R3,#0x0
   \   00003C   12....       LCALL   ?S_DIV_MOD
   \   00003F   E8           MOV     A,R0
   \   000040   F9           MOV     R1,A
   \   000041   02....       LJMP    ?BRET
    501          }
    502          
    503          
    504          /**************************************************************************************************
    505           * @fn          macRadioComputeLQI
    506           *
    507           * @brief       Compute link quality indication.
    508           *
    509           * @param       rssi - raw RSSI value from radio hardware
    510           *              corr - correlation value from radio hardware
    511           *
    512           * @return      link quality indicator value
    513           **************************************************************************************************
    514           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    515          uint8 macRadioComputeLQI(int8 rssiDbm, uint8 corr)
   \                     macRadioComputeLQI:
    516          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    517            (void) corr; /* suppress compiler warning of unused parameter */
    518            
    519            /*
    520             *  Note : Currently the LQI value is simply the energy detect measurement.
    521             *         A more accurate value could be derived by using the correlation
    522             *         value along with the RSSI value.
    523             */  
    524            return(radioComputeED(rssiDbm));
   \   000004                ; Setup parameters for call to function radioComputeED
   \   000004   02....       LJMP    ?Subroutine0 & 0xFFFF
    525          }

   \                                 In segment SFR_AN, at 0xa8
   \   union <unnamed> volatile __sfr _A_IEN0
   \                     _A_IEN0:
   \   000000                DS 1
    526          
    527          
    528          /**************************************************************************************************
    529          */

   Maximum stack usage in bytes:

     Function                      ISTACK PSTACK XSTACK
     --------                      ------ ------ ------
     macRadioComputeLQI                2      0      0
       -> radioComputeED               4      0      0
     macRadioEnergyDetectStart         2      0      0
       -> macMcuRecordMaxRssiStart     4      0      0
     macRadioEnergyDetectStop          4      0      0
       -> macMcuRecordMaxRssiStop      4      0      0
       -> radioComputeED               4      0      0
     macRadioInit                      2      0      0
     macRadioRandomByte                2      0      0
       -> macMcuRandomByte             4      0      0
     macRadioReset                     2      0      0
       -> macRadioStopScan             4      0      0
       -> macRadioEnergyDetectStop     4      0      0
     macRadioSetChannel                0      0      9
       -> halAssertHandler             0      0     18
       -> macRadioUpdateChannel        0      0     18
     macRadioSetIEEEAddr               2      0      0
       -> macMemWriteRam               4      0      0
     macRadioSetPanCoordinator         3      0      0
     macRadioSetPanID                  2      0      0
     macRadioSetShortAddr              2      0      0
     macRadioSetTxPower                0      0     10
       -> macRadioUpdateTxPower        0      0     20
     macRadioStartScan                 0      0      9
       -> halAssertHandler             0      0     18
       -> halAssertHandler             0      0     18
       -> halAssertHandler             0      0     18
     macRadioStopScan                  4      0      0
     macRadioUpdateChannel             2      0      9
       -> halAssertHandler             4      0      0
       -> macRxOff                     4      0      0
       -> macRxOnRequest               4      0      0
     macRadioUpdateTxPower             2      0     10
     radioComputeED                    2      0      0


   Segment part sizes:

     Function/Label            Bytes
     --------------            -----
     macPhyTxPower                1
     macPhyChannel                1
     reqChannel                   1
     reqTxPower                   1
     macRadioInit                25
     ?Subroutine2                 6
     ?Subroutine0                15
     macRadioReset               19
     macRadioRandomByte          11
     macRadioSetPanCoordinator   35
     macRadioSetPanID            12
     macRadioSetShortAddr        15
     macRadioSetIEEEAddr         21
     macRadioSetTxPower          58
     macRadioUpdateTxPower       58
     macRadioSetChannel          58
     ?Subroutine1                 5
     macRadioUpdateChannel       84
     macRadioStartScan           91
     macRadioStopScan            24
     macRadioEnergyDetectStart   12
     macRadioEnergyDetectStop    19
     radioComputeED              68
     macRadioComputeLQI           7
     _A_IEN0                      1

 
 643 bytes in segment BANKED_CODE
   1 byte  in segment SFR_AN
   4 bytes in segment XDATA_Z
 
 643 bytes of CODE  memory
   0 bytes of DATA  memory (+ 1 byte shared)
   4 bytes of XDATA memory

Errors: none
Warnings: none

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -