📄 timac1.h
字号:
#define TIM__u8PwmOut PORTD5
#define TIM__u8OffsetLevel OCR1AL
/* Initial level for trace offset: TDB */
#define TIM__nInitPwmLevel 0x7f
#define nClk 40000000
#define nSamplesPerDivision 20
#define f (nClk)/(nSamplesPerDivision)
#define TIM__astTimeBase \
{\
/* Prescaler Counter Text*/ \
{ 5, 62499, " 1 s "}, \
{ 4, 62499, "500 ms"},\
{ 3, 49999, "200 ms"},\
{ 2, 49999, "100 ms"},\
{ 1, 49999, " 50 ms"}, \
{ 0, 39999, " 20 ms"}, \
{ 0, 19999, " 10 ms"}, \
{ 0, 9999, " 5 ms"}, \
{ 0, 3999, " 2 ms"}, \
{ 0, 1999, " 1 ms"}, \
{ 0, 999, "500 us"},\
{ 0, 399, "200 us"},\
{ 0, 199, "100 us"},\
{ 0, 99, " 50 us"}, \
{ 0, 39, " 20 us"}, \
{ 0, 19, " 10 us"}, \
{ 0, 9, " 5 us"}, \
{ 0, 3, " 2 us"}, \
{ 0, 1, " 1 us"}, \
{ 7, 0, "500 ns"} \
}
typedef struct TIM__tstTimeBaseTag
{
uint8_t u8Prescaler; /* Primary divider of main clock: selects divider as 2,4,8,16... */
uint16_t u16Counter; /* Comparation value for counter: at match the output will toggle*/
char sText[10]; /* Text to be displayed as time base */
} TIM__tstTimeBase;
extern TIM__tstTimeBase TIM__stTimeBase[];
void TIM_vInitTimer1(uint16_t);
void TIM_vInitTimer3(uint16_t);
void TIM_vDelay(uint8_t);
void TIM_vInitPwmOnTimer1A(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -