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

📄 mac_radio.lst

📁 cc2430应用实例
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   000004                ; Auto size: 0
     90            /* variable initialization for this module */
     91            reqChannel    = MAC_RADIO_CHANNEL_DEFAULT;
   \   000004   740B         MOV     A,#0xb
   \   000006   90....       MOV     DPTR,#??reqChannel
   \   000009   F0           MOVX    @DPTR,A
     92            macPhyChannel = MAC_RADIO_CHANNEL_DEFAULT;
   \   00000A   90....       MOV     DPTR,#macPhyChannel
   \   00000D   F0           MOVX    @DPTR,A
     93            reqTxPower    = MAC_RADIO_TX_POWER_DEFAULT;
   \   00000E   741F         MOV     A,#0x1f
   \   000010   90....       MOV     DPTR,#??reqTxPower
   \   000013   F0           MOVX    @DPTR,A
     94            macPhyTxPower = MAC_RADIO_TX_POWER_DEFAULT;
   \   000014   90....       MOV     DPTR,#macPhyTxPower
   \   000017   80..         SJMP    ??Subroutine2_0
     95          }

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine2:
   \   000000   90DF4B       MOV     DPTR,#-0x20b5
   \                     ??Subroutine2_0:
   \   000003   F0           MOVX    @DPTR,A
   \   000004   80..         SJMP    ??Subroutine0_1

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine0:
   \   000000   90....       MOV     DPTR,#(??radioComputeED & 0xffff)
   \   000003   74..         MOV     A,#((??radioComputeED >> 16) & 0xff)
   \                     ??Subroutine0_0:
   \   000005   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \                     ??Subroutine0_1:
   \   000008   D083         POP     DPH
   \   00000A   D082         POP     DPL
   \   00000C   02....       LJMP    ?BRET
     96          
     97          
     98          /**************************************************************************************************
     99           * @fn          macRadioReset
    100           *
    101           * @brief       Resets the radio module.
    102           *
    103           * @param       none
    104           *
    105           * @return      none
    106           **************************************************************************************************
    107           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    108          void macRadioReset(void)
   \                     macRadioReset:
    109          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    110            macRadioStopScan();
   \   000004                ; Setup parameters for call to function macRadioStopScan
   \   000004   90....       MOV     DPTR,#(macRadioStopScan & 0xffff)
   \   000007   74..         MOV     A,#((macRadioStopScan >> 16) & 0xff)
   \   000009   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    111            macRadioEnergyDetectStop();
   \   00000C                ; Setup parameters for call to function macRadioEnergyDetectStop
   \   00000C   90....       MOV     DPTR,#(macRadioEnergyDetectStop & 0xffff)
   \   00000F   74..         MOV     A,#((macRadioEnergyDetectStop >> 16) & 0xff)
   \   000011   80..         SJMP    ??Subroutine0_0
    112          }
    113          
    114          
    115          /**************************************************************************************************
    116           * @fn          macRadioRandomByte
    117           *
    118           * @brief       Return a random byte derived from previously set random seed.
    119           *
    120           * @param       none
    121           *
    122           * @return      a random byte
    123           **************************************************************************************************
    124           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    125          uint8 macRadioRandomByte(void)
   \                     macRadioRandomByte:
    126          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    127            return(MAC_RADIO_RANDOM_BYTE());
   \   000004                ; Setup parameters for call to function macMcuRandomByte
   \   000004   90....       MOV     DPTR,#(macMcuRandomByte & 0xffff)
   \   000007   74..         MOV     A,#((macMcuRandomByte >> 16) & 0xff)
   \   000009   80..         SJMP    ??Subroutine0_0
    128          }
    129          
    130          
    131          /**************************************************************************************************
    132           * @fn          macRadioSetPanCoordinator
    133           *
    134           * @brief       Configure the pan coordinator status of the radio
    135           *
    136           * @param       panCoordFlag - non-zero to configure radio to be pan coordinator
    137           *                             zero to configure radio as NON pan coordinator
    138           *
    139           * @return      none
    140           **************************************************************************************************
    141           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    142          void macRadioSetPanCoordinator(uint8 panCoordFlag)
   \                     macRadioSetPanCoordinator:
    143          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    144            /* abstracted radio configuration */
    145            MAC_RADIO_SET_PAN_COORDINATOR(panCoordFlag);
   \   000004   90DF02       MOV     DPTR,#-0x20fe
   \   000007   E0           MOVX    A,@DPTR
   \   000008   FA           MOV     R2,A
   \   000009   E9           MOV     A,R1
   \   00000A   6004         JZ      ??macRadioSetPanCoordinator_0
   \   00000C   D2F0         SETB    B.0
   \   00000E   8002         SJMP    ??macRadioSetPanCoordinator_1
   \                     ??macRadioSetPanCoordinator_0:
   \   000010   C2F0         CLR     B.0
   \                     ??macRadioSetPanCoordinator_1:
   \   000012   A2F0         MOV     C,B.0
   \   000014   E4           CLR     A
   \   000015   92E0         MOV     0xE0 /* A   */.0,C
   \   000017   C4           SWAP    A
   \   000018   C0E0         PUSH    A
   \   00001A   74EF         MOV     A,#-0x11
   \   00001C   5A           ANL     A,R2
   \   00001D   FA           MOV     R2,A
   \   00001E   D0E0         POP     A
   \   000020   4A           ORL     A,R2
   \   000021   80..         SJMP    ??Subroutine2_0
    146          }
    147          
    148          
    149          /**************************************************************************************************
    150           * @fn          macRadioSetPanID
    151           *
    152           * @brief       Set the pan ID on the radio.
    153           *
    154           * @param       panID - 16 bit PAN identifier
    155           *
    156           * @return      none
    157           **************************************************************************************************
    158           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    159          void macRadioSetPanID(uint16 panID)
   \                     macRadioSetPanID:
    160          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    161            /* abstracted radio configuration */
    162            MAC_RADIO_SET_PAN_ID(panID);
   \   000004   EA           MOV     A,R2
   \   000005   90DF4C       MOV     DPTR,#-0x20b4
   \   000008   F0           MOVX    @DPTR,A
   \   000009   EB           MOV     A,R3
   \   00000A   80..         SJMP    ?Subroutine2
    163          }
    164          
    165          
    166          /**************************************************************************************************
    167           * @fn          macRadioSetShortAddr
    168           *
    169           * @brief       Set the short addrss on the radio.
    170           *
    171           * @param       shortAddr - 16 bit short address
    172           *
    173           * @return      none
    174           **************************************************************************************************
    175           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    176          void macRadioSetShortAddr(uint16 shortAddr)
   \                     macRadioSetShortAddr:
    177          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    178            /* abstracted radio configuration */
    179            MAC_RADIO_SET_SHORT_ADDR(shortAddr);
   \   000004   EA           MOV     A,R2
   \   000005   90DF4E       MOV     DPTR,#-0x20b2
   \   000008   F0           MOVX    @DPTR,A
   \   000009   EB           MOV     A,R3
   \   00000A   90DF4D       MOV     DPTR,#-0x20b3
   \   00000D   80..         SJMP    ??Subroutine2_0
    180          }
    181          
    182          
    183          /**************************************************************************************************
    184           * @fn          macRadioSetIEEEAddr
    185           *
    186           * @brief       Set the IEEE address on the radio.
    187           *
    188           * @param       pIEEEAddr - pointer to array holding 64 bit IEEE address; array must be little
    189           *                          endian format (starts with lowest signficant byte)
    190           *
    191           * @return      none
    192           **************************************************************************************************
    193           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    194          void macRadioSetIEEEAddr(uint8 * pIEEEAddr)
   \                     macRadioSetIEEEAddr:
    195          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
   \   000004   EA           MOV     A,R2
   \   000005   FC           MOV     R4,A
   \   000006   EB           MOV     A,R3
   \   000007   FD           MOV     R5,A
    196            /* abstracted radio configuration */
    197            MAC_RADIO_SET_IEEE_ADDR(pIEEEAddr);
   \   000008                ; Setup parameters for call to function macMemWriteRam
   \   000008   7908         MOV     R1,#0x8
   \   00000A   7A43         MOV     R2,#0x43
   \   00000C   7BDF         MOV     R3,#-0x21
   \   00000E   90....       MOV     DPTR,#(macMemWriteRam & 0xffff)
   \   000011   74..         MOV     A,#((macMemWriteRam >> 16) & 0xff)
   \   000013   80..         SJMP    ??Subroutine0_0
    198          }
    199          
    200          
    201          /**************************************************************************************************
    202           * @fn          macRadioSetTxPower
    203           *
    204           * @brief       Set transmitter power of the radio.
    205           *
    206           * @param       txPower - the minus dBm for power but as a postive integer (or if configured
    207           *                        for it, txPower is the raw register value).
    208           *
    209           * @return      none
    210           **************************************************************************************************
    211           */

⌨️ 快捷键说明

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