📄 im_robot.h
字号:
#ifndef __IM_ROBOT_H__
#define __IM_ROBOT_H__
#include "SPL162001.h"
#include "math.h"
void System_Init();
void Set_Clock(UInt16 Hr, UInt16 Min, UInt16 Sec);
void Set_Alarm(UInt16 Hr, UInt16 Min, UInt16 Sec);
void PWM_A_Init(UInt16 speed);
void PWM_Channel_1(UInt16 speed, UInt16 Pos_goal);
UInt16 abs(UInt16 x);
//================================================================
//Function: INT of CPU
//Example: INT_OFF();
//Example: INT_IRQ();
//Example: INT_FIQ();
//Example: INT_FIQ_IRQ();
//Example: Enable_FIQ_IRQ();
//================================================================
#define INT_OFF() asm("int off\n");
#define INT_IRQ() asm("int irq\n");
#define INT_FIQ() asm("int fiq\n");
#define INT_FIQ_IRQ() asm("int fiq,irq\n");
#define Enable_FIQ_IRQ() asm("int fiq,irq\n");
#define Disable_FIQ_IRQ() asm("int off\n");
//================================================================
//Function: Disable IRQ Flag of CPU
//Example: Disable_IRQ();
//================================================================
#define Disable_IRQ() asm("irq off\n");
#define IRQ_OFF() asm("irq off\n");
//================================================================
//Function: Enable IRQ Flag of CPU
//Example: Enable_IRQ();
//================================================================
#define Enable_IRQ() asm("irq on\n");
#define IRQ_ON() asm("irq on\n");
//================================================================
//Function: Disable FIQ Flag of CPU
//Example: Disable_FIQ();
//================================================================
#define Disable_FIQ() asm("fiq off\n");
#define FIQ_OFF() asm("fiq off\n");
//================================================================
//Function: Enable FIQ Flag of CPU
//Example: Enable_FIQ();
//================================================================
#define Enable_FIQ() asm("fiq on\n");
#define FIQ_ON() asm("fiq on\n");
//================================================================
//Function: Disable Movement Flag of FIR DSP Operation
//Example: Disable_FIRMOV();
//================================================================
#define Disable_FIRMOV() asm("fir_mov off\n");
//================================================================
//Function: Enable Movement Flag of FIR DSP Operation
//Example: Enable_FIRMOV();
//================================================================
#define Enable_FIRMOV() asm("fir_mov on\n");
//================================================================
//Function: Make CPU software interrupt (break)
//Example: SoftwareInterrupt();
//================================================================
#define SoftwareInterrupt() asm("break\n");
//================================================================
//Function: Make CPU no operation
//Example: NOP();
//================================================================
#define NOP() asm("nop\n");
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -