stm32f10x_nvic.lst

来自「完成数据的采集」· LST 代码 · 共 886 行 · 第 1/4 页

LST
886
字号
    196          void NVIC_RESETPRIMASK(void)
    197          {
    198            __RESETPRIMASK();
    199          }
    200          
    201          /*******************************************************************************
    202          * Function Name  : NVIC_SETFAULTMASK
    203          * Description    : Enables the FAULTMASK priority: Raises the execution priority to -1.
    204          * Input          : None
    205          * Output         : None
    206          * Return         : None
    207          *******************************************************************************/
    208          void NVIC_SETFAULTMASK(void)
    209          {
    210            __SETFAULTMASK();
    211          }
    212          
    213          /*******************************************************************************
    214          * Function Name  : NVIC_RESETFAULTMASK
    215          * Description    : Disables the FAULTMASK priority.
    216          * Input          : None
    217          * Output         : None
    218          * Return         : None
    219          *******************************************************************************/
    220          void NVIC_RESETFAULTMASK(void)
    221          {
    222            __RESETFAULTMASK();
    223          }
    224          
    225          /*******************************************************************************
    226          * Function Name  : NVIC_BASEPRICONFIG
    227          * Description    : The execution priority can be changed from 15 (lowest 
    228                             configurable priority) to 1.
    229          * Input          : None
    230          * Output         : None
    231          * Return         : None
    232          *******************************************************************************/
    233          void NVIC_BASEPRICONFIG(u32 NewPriority)
    234          {
    235            /* Check the parameters */
    236            assert_param(IS_NVIC_BASE_PRI(NewPriority));
    237            
    238            __BASEPRICONFIG(NewPriority << 0x04);
    239          }
    240          
    241          /*******************************************************************************
    242          * Function Name  : NVIC_GetBASEPRI
    243          * Description    : Returns the BASEPRI mask value.
    244          * Input          : None
    245          * Output         : None
    246          * Return         : BASEPRI register value
    247          *******************************************************************************/
    248          u32 NVIC_GetBASEPRI(void)
    249          {
    250            return (__GetBASEPRI());
    251          }
    252          
    253          /*******************************************************************************
    254          * Function Name  : NVIC_GetCurrentPendingIRQChannel
    255          * Description    : Returns the current pending IRQ channel identifier.
    256          * Input          : None
    257          * Output         : None
    258          * Return         : Pending IRQ Channel Identifier.
    259          *******************************************************************************/
    260          u16 NVIC_GetCurrentPendingIRQChannel(void)
    261          {
    262            return ((u16)((SCB->ICSR & (u32)0x003FF000) >> 0x0C));
    263          }
    264          
    265          /*******************************************************************************
    266          * Function Name  : NVIC_GetIRQChannelPendingBitStatus
    267          * Description    : Checks whether the specified IRQ Channel pending bit is set
    268          *                  or not.
    269          * Input          : - NVIC_IRQChannel: specifies the interrupt pending bit to check.
    270          * Output         : None
    271          * Return         : The new state of IRQ Channel pending bit(SET or RESET).
    272          *******************************************************************************/
    273          ITStatus NVIC_GetIRQChannelPendingBitStatus(u8 NVIC_IRQChannel)
    274          {
    275            ITStatus pendingirqstatus = RESET;
    276            u32 tmp = 0x00;
    277            
    278            /* Check the parameters */
    279            assert_param(IS_NVIC_IRQ_CHANNEL(NVIC_IRQChannel));
    280            
    281            tmp = ((u32)0x01 << (NVIC_IRQChannel & (u32)0x1F));
    282          
    283            if (((NVIC->ISPR[(NVIC_IRQChannel >> 0x05)]) & tmp) == tmp)
    284            {
    285              pendingirqstatus = SET;
    286            }
    287            else
    288            {
    289              pendingirqstatus = RESET;
    290            }
    291            return pendingirqstatus;
    292          }
    293          
    294          /*******************************************************************************
    295          * Function Name  : NVIC_SetIRQChannelPendingBit
    296          * Description    : Sets the NVIC抯 interrupt pending bit.
    297          * Input          : - NVIC_IRQChannel: specifies the interrupt pending bit to Set.
    298          * Output         : None
    299          * Return         : None
    300          *******************************************************************************/
    301          void NVIC_SetIRQChannelPendingBit(u8 NVIC_IRQChannel)
    302          {
    303            /* Check the parameters */
    304            assert_param(IS_NVIC_IRQ_CHANNEL(NVIC_IRQChannel));
    305            
    306            *(u32*)0xE000EF00 = (u32)NVIC_IRQChannel;
    307          }
    308          
    309          /*******************************************************************************
    310          * Function Name  : NVIC_ClearIRQChannelPendingBit
    311          * Description    : Clears the NVIC抯 interrupt pending bit.
    312          * Input          : - NVIC_IRQChannel: specifies the interrupt pending bit to clear.
    313          * Output         : None
    314          * Return         : None
    315          *******************************************************************************/
    316          void NVIC_ClearIRQChannelPendingBit(u8 NVIC_IRQChannel)
    317          {
    318            /* Check the parameters */
    319            assert_param(IS_NVIC_IRQ_CHANNEL(NVIC_IRQChannel));
    320            
    321            NVIC->ICPR[(NVIC_IRQChannel >> 0x05)] = (u32)0x01 << (NVIC_IRQChannel & (u32)0x1F);
    322          }
    323          
    324          /*******************************************************************************
    325          * Function Name  : NVIC_GetCurrentActiveHandler
    326          * Description    : Returns the current active Handler (IRQ Channel and
    327          *                  SystemHandler) identifier.
    328          * Input          : None
    329          * Output         : None
    330          * Return         : Active Handler Identifier.
    331          *******************************************************************************/
    332          u16 NVIC_GetCurrentActiveHandler(void)
    333          {
    334            return ((u16)(SCB->ICSR & (u32)0x3FF));
    335          }
    336          
    337          /*******************************************************************************
    338          * Function Name  : NVIC_GetIRQChannelActiveBitStatus
    339          * Description    : Checks whether the specified IRQ Channel active bit is set
    340          *                  or not.
    341          * Input          : - NVIC_IRQChannel: specifies the interrupt active bit to check.
    342          * Output         : None
    343          * Return         : The new state of IRQ Channel active bit(SET or RESET).
    344          *******************************************************************************/
    345          ITStatus NVIC_GetIRQChannelActiveBitStatus(u8 NVIC_IRQChannel)
    346          {
    347            ITStatus activeirqstatus = RESET;
    348            u32 tmp = 0x00;
    349          
    350            /* Check the parameters */
    351            assert_param(IS_NVIC_IRQ_CHANNEL(NVIC_IRQChannel));
    352            
    353            tmp = ((u32)0x01 << (NVIC_IRQChannel & (u32)0x1F));
    354          
    355            if (((NVIC->IABR[(NVIC_IRQChannel >> 0x05)]) & tmp) == tmp )
    356            {
    357              activeirqstatus = SET;
    358            }
    359            else
    360            {
    361              activeirqstatus = RESET;
    362            }
    363            return activeirqstatus;
    364          }
    365          
    366          /*******************************************************************************
    367          * Function Name  : NVIC_GetCPUID
    368          * Description    : Returns the ID number, the version number and the implementation
    369          *                  details of the Cortex-M3 core.
    370          * Input          : None
    371          * Output         : None
    372          * Return         : CPU ID.
    373          *******************************************************************************/
    374          u32 NVIC_GetCPUID(void)
    375          {
    376            return (SCB->CPUID);
    377          }
    378          
    379          /*******************************************************************************
    380          * Function Name  : NVIC_SetVectorTable
    381          * Description    : Sets the vector table location and Offset.
    382          * Input          : - NVIC_VectTab: specifies if the vector table is in RAM or
    383          *                    FLASH memory.
    384          *                    This parameter can be one of the following values:
    385          *                       - NVIC_VectTab_RAM
    386          *                       - NVIC_VectTab_FLASH
    387          *                  - Offset: Vector Table base offset field. 
    388          *                            This value must be a multiple of 0x100.
    389          * Output         : None
    390          * Return         : None
    391          *******************************************************************************/
    392          void NVIC_SetVectorTable(u32 NVIC_VectTab, u32 Offset)
    393          { 
    394            /* Check the parameters */
    395            assert_param(IS_NVIC_VECTTAB(NVIC_VectTab));
    396            assert_param(IS_NVIC_OFFSET(Offset));  
    397             
    398            SCB->VTOR = NVIC_VectTab | (Offset & (u32)0x1FFFFF80);
    399          }
    400          
    401          /*******************************************************************************
    402          * Function Name  : NVIC_GenerateSystemReset
    403          * Description    : Generates a system reset.
    404          * Input          : None
    405          * Output         : None
    406          * Return         : None
    407          *******************************************************************************/
    408          void NVIC_GenerateSystemReset(void)
    409          {
    410            SCB->AIRCR = AIRCR_VECTKEY_MASK | (u32)0x04;
    411          }
    412          
    413          /*******************************************************************************
    414          * Function Name  : NVIC_GenerateCoreReset
    415          * Description    : Generates a Core (Core + NVIC) reset.
    416          * Input          : None
    417          * Output         : None

⌨️ 快捷键说明

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