rt-thread/bsp/essemi/es8p508x/libraries/Library/Include/lib_scs.h

99 lines
2.6 KiB
C
Raw Normal View History

2019-11-07 10:00:14 +08:00
/***************************************************************
*Copyright (C), 2017, Shanghai Eastsoft Microelectronics Co., Ltd.
*<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> lib_scs.h
*<EFBFBD><EFBFBD> <EFBFBD>ߣ<EFBFBD> Liut
*<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> V1.00
*<EFBFBD><EFBFBD> <EFBFBD>ڣ<EFBFBD> 2017/07/14
*<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ں<EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>
*<EFBFBD><EFBFBD> ע<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ES8P508xоƬ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧϰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾʹ<EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>κη<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ρ<EFBFBD>
***************************************************************/
#ifndef __LIBNVIC_H__
#define __LIBNVIC_H__
#include "ES8P508x.h"
#include "type.h"
/* <20>ж<EFBFBD>Դѡ<D4B4><D1A1> */
typedef enum
{
NVIC_PINT0_IRQn = 0,
NVIC_PINT1_IRQn = 1,
NVIC_PINT2_IRQn = 2,
NVIC_PINT3_IRQn = 3,
NVIC_PINT4_IRQn = 4,
NVIC_PINT5_IRQn = 5,
NVIC_PINT6_IRQn = 6,
NVIC_PINT7_IRQn = 7,
NVIC_T16N0_IRQn = 8,
NVIC_T16N1_IRQn = 9,
NVIC_T16N2_IRQn = 10,
NVIC_T16N3_IRQn = 11,
NVIC_T32N0_IRQn = 12,
NVIC_IWDT_IRQn = 14,
NVIC_WWDT_IRQn = 15,
NVIC_CCM_IRQn = 16,
NVIC_PLK_IRQn = 17,
NVIC_LVD_IRQn = 18,
NVIC_KINT_IRQn = 19,
NVIC_RTC_IRQn = 20,
NVIC_ADC_IRQn = 21,
NVIC_AES_IRQn = 23,
NVIC_UART0_IRQn = 24,
NVIC_UART1_IRQn = 25,
NVIC_UART2_IRQn = 26,
NVIC_UART3_IRQn = 27,
NVIC_UART4_IRQn = 28,
NVIC_UART5_IRQn = 29,
NVIC_SPI0_IRQn = 30,
NVIC_I2C0_IRQn = 31,
}NVIC_IRQChannel;
/* <20><><EFBFBD>ȼ<EFBFBD> */
typedef enum
{
NVIC_Priority_0 = 0x0 ,
NVIC_Priority_1 = 0x1 ,
NVIC_Priority_2 = 0x2 ,
NVIC_Priority_3 = 0x3 ,
}NVIC_IRQPriority;
/* <20><><EFBFBD><EFBFBD>ģʽ */
typedef enum
{
SCB_LP_SleepOnExit = 0x02 , //<2F><>ISR<53>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򷵻ص<F2B7B5BB><D8B5>߳<EFBFBD>ģʽʱ<CABD><CAB1><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
SCB_LP_SleepDeep = 0x04 , //<2F><><EFBFBD><EFBFBD>˯<EFBFBD><CBAF>
SCB_LP_SEVOPend = 0x10 , //<2F>жϹ<D0B6><CFB9><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>ѵ<EFBFBD>ѡ<EFBFBD><D1A1>λ
}SCB_TYPE_SCR;
/* SysTickʱ<6B><CAB1>Դѡ<D4B4><D1A1> */
typedef enum
{
SysTick_ClkS_Base = 0x0 , //<2F><>׼ʱ<D7BC><CAB1>(Hclk/3)
SysTick_ClkS_Cpu = 0x1 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>(Hclk)
}SYST_TYPE_CLKS;
/* SysTick<63><6B>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ýṹ<C3BD><EFBFBD><E5B6A8> */
typedef struct
{
uint32_t SysTick_Value; //<2F>ݼ<EFBFBD><DDBC><EFBFBD>ֵ<EFBFBD><D6B5>24λ<34><CEBB><EFBFBD>Ҷ<EFBFBD><D2B6><EFBFBD>
SYST_TYPE_CLKS SysTick_ClkSource; //ʱ<><CAB1>Դѡ<D4B4><D1A1>
TYPE_FUNCEN SysTick_ITEnable; //<2F>ж<EFBFBD>ʹ<EFBFBD>ܡ<EFBFBD>ʧ<EFBFBD><CAA7>
}SYSTICK_InitStruType;
/**************ģ<><C4A3><EFBFBD><EFBFBD><EAB6A8>*************/
/*SysTickʹ<6B><CAB9>*/
#define SysTick_Enable() (SysTick->CTRL |= 0x00000001)
#define SysTick_Disable() (SysTick->CTRL &= 0xFFFFFFFE)
/************SCSģ<53><EFBFBD><E9BAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>***********/
void NVIC_Init(NVIC_IRQChannel Channel,NVIC_IRQPriority Priority,TYPE_FUNCEN Cmd);
void SCB_SystemLPConfig(SCB_TYPE_SCR LowPowerMode, TYPE_FUNCEN NewState);
uint32_t SCB_GetCpuID(void);
void SysTick_Init(SYSTICK_InitStruType* SysT_InitStruct);
#endif
/*************************END OF FILE**********************/