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

📄 hal_drivers.lst

📁 用IAR开发的ZIGBEE网络路由例子
💻 LST
📖 第 1 页 / 共 3 页
字号:
     60          
     61          extern void HalLedUpdate( void ); /* Notes: This for internal only so it shouldn't be in hal_led.h */
     62          
     63          /**************************************************************************************************
     64           *                                      FUNCTIONS - API
     65           **************************************************************************************************/
     66          
     67          /**************************************************************************************************
     68           * @fn      Hal_Init
     69           *
     70           * @brief   Hal Initialization function.
     71           *
     72           * @param   task_id - Hal TaskId
     73           *
     74           * @return  None
     75           **************************************************************************************************/

   \                                 In segment BANKED_CODE, align 1, keep-with-next
     76          void Hal_Init( uint8 task_id )
   \                     Hal_Init:
     77          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
     78            /* Register task ID */
     79            Hal_TaskID = task_id;
   \   000004   E9           MOV     A,R1
   \   000005   90....       MOV     DPTR,#Hal_TaskID
   \   000008   F0           MOVX    @DPTR,A
     80          
     81          }
   \   000009   80..         SJMP    ??Subroutine0_0

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine0:
   \   000000   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \                     ??Subroutine0_0:
   \   000003   D083         POP     DPH
   \   000005   D082         POP     DPL
   \   000007   02....       LJMP    ?BRET
     82          
     83          /**************************************************************************************************
     84           * @fn      Hal_DriverInit
     85           *
     86           * @brief   Initialize HW - These need to be initialized before anyone.
     87           *
     88           * @param   task_id - Hal TaskId
     89           *
     90           * @return  None
     91           **************************************************************************************************/

   \                                 In segment BANKED_CODE, align 1, keep-with-next
     92          void HalDriverInit (void)
   \                     HalDriverInit:
     93          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
     94            /* TIMER */
     95            HalTimerInit();
   \   000004                ; Setup parameters for call to function HalTimerInit
   \   000004   90....       MOV     DPTR,#(HalTimerInit & 0xffff)
   \   000007   74..         MOV     A,#((HalTimerInit >> 16) & 0xff)
   \   000009   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
     96          
     97            /* ADC */
     98          #if (defined HAL_ADC) && (HAL_ADC == TRUE)
     99            HalAdcInit();
   \   00000C                ; Setup parameters for call to function HalAdcInit
   \   00000C   90....       MOV     DPTR,#(HalAdcInit & 0xffff)
   \   00000F   74..         MOV     A,#((HalAdcInit >> 16) & 0xff)
   \   000011   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    100          #endif
    101          
    102            /* DMA */
    103          #if (defined HAL_DMA) && (HAL_DMA == TRUE)
    104            // Must be called before the init call to any module that uses DMA.
    105            HalDmaInit();
   \   000014                ; Setup parameters for call to function HalDmaInit
   \   000014   90....       MOV     DPTR,#(HalDmaInit & 0xffff)
   \   000017   74..         MOV     A,#((HalDmaInit >> 16) & 0xff)
   \   000019   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    106          #endif
    107          
    108            /* AES */
    109          #if (defined HAL_AES) && (HAL_AES == TRUE)
    110            HalAesInit();
   \   00001C                ; Setup parameters for call to function HalAesInit
   \   00001C   90....       MOV     DPTR,#(HalAesInit & 0xffff)
   \   00001F   74..         MOV     A,#((HalAesInit >> 16) & 0xff)
   \   000021   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    111          #endif
    112          
    113            /* LCD */
    114          #if (defined HAL_LCD) && (HAL_LCD == TRUE)
    115            HalLcdInit();
   \   000024                ; Setup parameters for call to function HalLcdInit
   \   000024   90....       MOV     DPTR,#(HalLcdInit & 0xffff)
   \   000027   74..         MOV     A,#((HalLcdInit >> 16) & 0xff)
   \   000029   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    116          #endif
    117          
    118            /* LED */
    119          #if (defined HAL_LED) && (HAL_LED == TRUE)
    120            HalLedInit();
   \   00002C                ; Setup parameters for call to function HalLedInit
   \   00002C   90....       MOV     DPTR,#(HalLedInit & 0xffff)
   \   00002F   74..         MOV     A,#((HalLedInit >> 16) & 0xff)
   \   000031   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    121          #endif
    122          
    123            /* UART */
    124          #if (defined HAL_UART) && (HAL_UART == TRUE)
    125            HalUARTInit();
   \   000034                ; Setup parameters for call to function HalUARTInit
   \   000034   90....       MOV     DPTR,#(HalUARTInit & 0xffff)
   \   000037   74..         MOV     A,#((HalUARTInit >> 16) & 0xff)
   \   000039   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    126          #endif
    127          
    128            /* KEY */
    129          #if (defined HAL_KEY) && (HAL_KEY == TRUE)
    130            HalKeyInit();
   \   00003C                ; Setup parameters for call to function HalKeyInit
   \   00003C   90....       MOV     DPTR,#(HalKeyInit & 0xffff)
   \   00003F   74..         MOV     A,#((HalKeyInit >> 16) & 0xff)
   \   000041                REQUIRE ?Subroutine0
   \   000041                ; // Fall through to label ?Subroutine0
    131          #endif
    132          }
    133          
    134          
    135          /**************************************************************************************************
    136           * @fn      Hal_ProcessEvent
    137           *
    138           * @brief   Hal Process Event
    139           *
    140           * @param   task_id - Hal TaskId
    141           *          events - events
    142           *
    143           * @return  None
    144           **************************************************************************************************/

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    145          uint16 Hal_ProcessEvent( uint8 task_id, uint16 events )
   \                     Hal_ProcessEvent:
    146          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 0
   \   000005   EA           MOV     A,R2
   \   000006   FE           MOV     R6,A
   \   000007   EB           MOV     A,R3
   \   000008   FF           MOV     R7,A
    147            uint8 *msgPtr;
    148          
    149            if ( events & SYS_EVENT_MSG )
   \   000009   7480         MOV     A,#-0x80
   \   00000B   5F           ANL     A,R7
   \   00000C   F9           MOV     R1,A
   \   00000D   E4           CLR     A
   \   00000E   7001         JNZ     ??Hal_ProcessEvent_0
   \   000010   E9           MOV     A,R1
   \                     ??Hal_ProcessEvent_0:
   \   000011   701D         JNZ     ??Hal_ProcessEvent_1
    150            {
    151              msgPtr = osal_msg_receive(Hal_TaskID);
    152          
    153              while (msgPtr)
    154              {
    155                /* Do something here - for now, just deallocate the msg and move on */
    156          
    157                /* De-allocate */
    158                osal_msg_deallocate( msgPtr );
    159                /* Next */
    160                msgPtr = osal_msg_receive( Hal_TaskID );
    161              }
    162              return events ^ SYS_EVENT_MSG;
    163            }
    164          
    165            if ( events & HAL_LED_BLINK_EVENT )
   \   000013   EE           MOV     A,R6
   \   000014   5402         ANL     A,#0x2
   \   000016   6032         JZ      ??Hal_ProcessEvent_2
    166            {
    167          #if (defined (BLINK_LEDS)) && (HAL_LED == TRUE)

⌨️ 快捷键说明

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