###############################################################################
#                                                                             #
# IAR 8051 C/C++ Compiler V7.30B/W32                    12/Sep/2010  21:57:29 #
# Copyright 2004-2007 IAR Systems. All rights reserved.                       #
#                                                                             #
#    Core               =  plain                                              #
#    Code model         =  banked                                             #
#    Data model         =  large                                              #
#    Calling convention =  xdata reentrant                                    #
#    Constant location  =  data                                               #
#    Dptr setup         =  1,16                                               #
#    Source file        =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Compone #
#                          nts\mac\low_level\srf03\mac_low_level.c            #
#    Command line       =  -f "C:\Texas Instruments                           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\Tools\CC2430DB\f8wRouter.cf #
#                          g" (-DCPU32MHZ -DFORCE_MAC_NEAR                    #
#                          -DROOT=__near_func -DMAC_CFG_APP_PENDING_QUEUE=TRU #
#                          E -DRTR_NWK -DBLINK_LEDS "-DCONST=const __code"    #
#                          -DGENERIC=__generic) -f "C:\Texas Instruments      #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\Tools\CC2430DB\f8wConfig.cf #
#                          g" (-DSECURE=1 -DDEFAULT_CHANLIST=0x04000000       #
#                          -DZDAPP_CONFIG_PAN_ID=0x00FF                       #
#                          -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_MA #
#                          SK=0x007F -DBEACON_REQUEST_DELAY=100               #
#                          -DBEACON_REQ_DELAY_MASK=0x00FF                     #
#                          -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_PO #
#                          LLED=3000 -DNWK_INDIRECT_MSG_TIMEOUT=7             #
#                          -DMAX_RREQ_ENTRIES=10 -DAPSC_MAX_FRAME_RETRIES=3   #
#                          -DNWK_MAX_DATA_RETRIES=2                           #
#                          -DMAX_POLL_FAILURE_RETRIES=2 -DMAX_BCAST=9         #
#                          -DAPS_MAX_GROUPS=16 -DMAX_RTG_ENTRIES=20           #
#                          -DNWK_MAX_BINDING_ENTRIES=10                       #
#                          -DMAX_BINDING_CLUSTER_IDS=5 "-DDEFAULT_KEY={0x02,  #
#                          0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00,    #
#                          0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"         #
#                          -DRFD_RCVC_ALWAYS_ON=FALSE -DPOLL_RATE=1000        #
#                          -DQUEUED_POLL_RATE=100 -DRESPONSE_POLL_RATE=100)   #
#                          -DREJOIN_POLL_RATE=440 "C:\Texas Instruments       #
#                          33\ZStack-1.4.3-1.2.1\Components\mac\low_level\srf #
#                          03\mac_low_level.c" -D CC2430EB -D                 #
#                          LOCATION_REFNODE -D xNV_RESTORE -D ZTOOL_P1 -D     #
#                          MT_TASK -D POWER_SAVING -D HAL_UART_BIG_TX_BUF=1   #
#                          -D SPI_MGR_DEFAULT_MAX_TX_BUFF=1024 -D             #
#                          SPI_MGR_DEFAULT_OVERFLOW=1 -lC "C:\Texas           #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\RefNode\List\" -lA       #
#                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Project\Location\CC2430DB\RefNode\List\" #
#                           --diag_suppress Pe001,Pa010 --diag_remark pe550   #
#                          -o "C:\Texas Instruments                           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\RefNode\Obj\" -e                     #
#                          --require_prototypes -z9 --no_code_motion --debug  #
#                          --core=plain --dptr=16,1 --data_model=large        #
#                          --code_model=banked --calling_convention=xdata_ree #
#                          ntrant --place_constants=data --nr_virtual_regs 8  #
#                          -I "C:\Texas Instruments                           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\" -I "C:\Texas Instruments           #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\SOURCE\" -I "C:\Texas             #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\..\..\..\ZMAIN\TI2430DB\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MT\" -I    #
#                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Project\Location\CC2430DB\..\..\..\..\.. #
#                          \COMPONENTS\HAL\INCLUDE\" -I "C:\Texas             #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\..\..\..\..\..\COMPONENT #
#                          S\HAL\TARGET\CC2430BB\" -I "C:\Texas Instruments   #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\MCU\C #
#                          CSOC\" -I "C:\Texas Instruments                    #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\INCLU #
#                          DE\" -I "C:\Texas Instruments                      #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\AF\" #
#                           -I "C:\Texas Instruments                          #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\NWK\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SEC\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SYS\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\ZDO\ #
#                          " -I "C:\Texas Instruments                         #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\F8W\" #
#                           -I "C:\Texas Instruments                          #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\" -I  #
#                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Project\Location\CC2430DB\..\..\..\..\.. #
#                          \COMPONENTS\SERVICES\SADDR\" -I "C:\Texas          #
#                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack\ #
#                          Project\Location\CC2430DB\..\..\..\..\..\COMPONENT #
#                          S\SERVICES\SDATA\" -I "C:\Texas Instruments        #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\INCLUD #
#                          E\" -I "C:\Texas Instruments                       #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\HIGH_L #
#                          EVEL\" -I "C:\Texas Instruments                    #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_LE #
#                          VEL\SRF03\" -I "C:\Texas Instruments               #
#                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loca #
#                          tion\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_LE #
#                          VEL\SRF03\SINGLE_CHIP\" -I "C:\Program Files\IAR   #
#                          Systems\Embedded Workbench 4.0 Evaluation          #
#                          version\8051\INC\" -I "C:\Program Files\IAR        #
#                          Systems\Embedded Workbench 4.0 Evaluation          #
#                          version\8051\INC\CLIB\"                            #
#    List file          =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Project #
#                          s\zstack\Project\Location\CC2430DB\RefNode\List\ma #
#                          c_low_level.lst                                    #
#    Object file        =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Project #
#                          s\zstack\Project\Location\CC2430DB\RefNode\Obj\mac #
#                          _low_level.r51                                     #
#                                                                             #
#                                                                             #
###############################################################################

C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Components\mac\low_level\srf03\mac_low_level.c
      1          /**************************************************************************************************
      2            Filename:       mac_low_level.c
      3            Revised:        $Date: 2007-10-29 22:38:47 -0700 (Mon, 29 Oct 2007) $
      4            Revision:       $Revision: 15812 $
      5          
      6            Description:    Describe the purpose and contents of the file.
      7          
      8          
      9            Copyright 2006-2007 Texas Instruments Incorporated. All rights reserved.
     10          
     11            IMPORTANT: Your use of this Software is limited to those specific rights
     12            granted under the terms of a software license agreement between the user
     13            who downloaded the software, his/her employer (which must be your employer)
     14            and Texas Instruments Incorporated (the "License").  You may not use this
     15            Software unless you agree to abide by the terms of the License. The License
     16            limits your use, and you acknowledge, that the Software may not be modified,
     17            copied or distributed unless embedded on a Texas Instruments microcontroller
     18            or used solely and exclusively in conjunction with a Texas Instruments radio
     19            frequency transceiver, which is integrated into your product.  Other than for
     20            the foregoing purpose, you may not use, reproduce, copy, prepare derivative
     21            works of, modify, distribute, perform, display or sell this Software and/or
     22            its documentation for any purpose.
     23          
     24            YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
     25            PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, 
     26            INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, 
     27            NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
     28            TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
     29            NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
     30            LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
     31            INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
     32            OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
     33            OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
     34            (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
     35          
     36            Should you have any questions regarding your right to use this Software,
     37            contact Texas Instruments Incorporated at www.TI.com. 
     38          **************************************************************************************************/
     39          
     40          /* ------------------------------------------------------------------------------------------------
     41           *                                          Includes
     42           * ------------------------------------------------------------------------------------------------
     43           */
     44          
     45          /* hal */
     46          #include "hal_types.h"
     47          #include "hal_mcu.h"

   \                                 In  segment SFR_AN, at 0xa8
   \   union <unnamed> volatile __sfr _A_IEN0
   \                     _A_IEN0:
   \   000000                DS 1
     48          
     49          /* exported low-level */
     50          #include "mac_low_level.h"
     51          
     52          /* low-level specific */
     53          #include "mac_radio.h"
     54          #include "mac_rx.h"
     55          #include "mac_tx.h"
     56          #include "mac_rx_onoff.h"
     57          #include "mac_backoff_timer.h"
     58          #include "mac_sleep.h"
     59          
     60          /* target specific */
     61          #include "mac_radio_defs.h"
     62          
     63          /* debug */
     64          #include "mac_assert.h"
     65          
     66          
     67          /**************************************************************************************************
     68           * @fn          macLowLevelInit
     69           *
     70           * @brief       Initialize low-level MAC.  Called only once on system power-up.
     71           *
     72           * @param       none
     73           *
     74           * @return      none
     75           **************************************************************************************************
     76           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
     77          void macLowLevelInit(void)
   \                     macLowLevelInit:
     78          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
     79            /* initialize mcu before anything else */
     80            MAC_RADIO_MCU_INIT();
   \   000004                ; Setup parameters for call to function macMcuInit
   \   000004   12....       LCALL   ??macMcuInit?relay
     81          
     82            /* software initialziation */
     83            macRadioInit();
   \   000007                ; Setup parameters for call to function macRadioInit
   \   000007   12....       LCALL   ??macRadioInit?relay
     84            macRxOnOffInit();
   \   00000A                ; Setup parameters for call to function macRxOnOffInit
   \   00000A   12....       LCALL   ??macRxOnOffInit?relay
     85            macRxInit();
   \   00000D                ; Setup parameters for call to function macRxInit
   \   00000D   12....       LCALL   ??macRxInit?relay
     86            macTxInit();
   \   000010                ; Setup parameters for call to function macTxInit
   \   000010   12....       LCALL   ??macTxInit?relay
     87            macBackoffTimerInit();
   \   000013                ; Setup parameters for call to function macBackoffTimerInit
   \   000013   12....       LCALL   ??macBackoffTimerInit?relay
     88          }
   \   000016                REQUIRE ?Subroutine0
   \   000016                ; // Fall through to label ?Subroutine0

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine0:
   \   000000   D083         POP     DPH
   \   000002   D082         POP     DPL
   \   000004   02....       LJMP    ?BRET
     89          
     90          
     91          /**************************************************************************************************
     92           * @fn          macLowLevelReset
     93           *
     94           * @brief       Reset low-level MAC.
     95           *
     96           * @param       none
     97           *
     98           * @return      none
     99           **************************************************************************************************
    100           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    101          void macLowLevelReset(void)
   \                     macLowLevelReset:
    102          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    103            MAC_ASSERT(!HAL_INTERRUPTS_ARE_ENABLED());   /* interrupts must be disabled */
   \   000004   A2AF         MOV     C,0xa8.7
   \   000006   5003         JNC     ??macLowLevelReset_0
   \   000008                ; Setup parameters for call to function halAssertHandler
   \   000008   12....       LCALL   ??halAssertHandler?relay
    104          
    105            /* reset radio modules;  if not awake, skip this */
    106            if (macSleepState == MAC_SLEEP_STATE_AWAKE)
   \                     ??macLowLevelReset_0:
   \   00000B   90....       MOV     DPTR,#macSleepState
   \   00000E   E0           MOVX    A,@DPTR
   \   00000F   7006         JNZ     ??macLowLevelReset_1
    107            {
    108              macRxTxReset();
   \   000011                ; Setup parameters for call to function macRxTxReset
   \   000011   12....       LCALL   ??macRxTxReset?relay
    109              macRadioReset();
   \   000014                ; Setup parameters for call to function macRadioReset
   \   000014   12....       LCALL   ??macRadioReset?relay
    110            }
    111          
    112            /* reset timer */
    113            macBackoffTimerReset();
   \                     ??macLowLevelReset_1:
   \   000017                ; Setup parameters for call to function macBackoffTimerReset
   \   000017   12....       LCALL   ??macBackoffTimerReset?relay
    114          
    115            /* power up the radio */
    116            macSleepWakeUp();
   \   00001A                ; Setup parameters for call to function macSleepWakeUp
   \   00001A   12....       LCALL   ??macSleepWakeUp?relay
    117          }
   \   00001D   80..         SJMP    ?Subroutine0
   \   00001F                REQUIRE _A_IEN0

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macLowLevelInit?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macLowLevelInit

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??macLowLevelReset?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    macLowLevelReset
    118          
    119          
    120          /**************************************************************************************************
    121          */

   Maximum stack usage in bytes:

     Function                  ISTACK PSTACK XSTACK
     --------                  ------ ------ ------
     macLowLevelInit               2      0      0
       -> macMcuInit               4      0      0
       -> macRadioInit             4      0      0
       -> macRxOnOffInit           4      0      0
       -> macRxInit                4      0      0
       -> macTxInit                4      0      0
       -> macBackoffTimerInit      4      0      0
     macLowLevelReset              2      0      0
       -> halAssertHandler         4      0      0
       -> macRxTxReset             4      0      0
       -> macRadioReset            4      0      0
       -> macBackoffTimerReset     4      0      0
       -> macSleepWakeUp           4      0      0


   Segment part sizes:

     Function/Label           Bytes
     --------------           -----
     _A_IEN0                     1
     macLowLevelInit            22
     ?Subroutine0                7
     macLowLevelReset           31
     ??macLowLevelInit?relay     6
     ??macLowLevelReset?relay    6

 
 60 bytes in segment BANKED_CODE
 12 bytes in segment BANK_RELAYS
  1 byte  in segment SFR_AN
 
 72 bytes of CODE memory
  0 bytes of DATA memory (+ 1 byte shared)

Errors: none
Warnings: none
