📄 ui.h
字号:
//*****************************************************************************
#define FLAG_PWM_FREQUENCY_8K 0x00000000
//*****************************************************************************
//
//! The value of the #FLAG_PWM_FREQUENCY_MASK bit field that indicates that the
//! PWM frequency is 12.5 KHz.
//
//*****************************************************************************
#define FLAG_PWM_FREQUENCY_12K 0x00000001
//*****************************************************************************
//
//! The value of the #FLAG_PWM_FREQUENCY_MASK bit field that indicates that the
//! PWM frequency is 16 KHz.
//
//*****************************************************************************
#define FLAG_PWM_FREQUENCY_16K 0x00000002
//*****************************************************************************
//
//! The value of the #FLAG_PWM_FREQUENCY_MASK bit field that indicates that the
//! PWM frequency is 20 KHz.
//
//*****************************************************************************
#define FLAG_PWM_FREQUENCY_20K 0x00000003
//*****************************************************************************
//
//! The bit number of the flag in the usFlags member of #tDriveParameters that
//! defines the decay mode for the trapezoid motor drive. This field will be
//! one of #FLAG_DECAY_FAST or #FLAG_DECAY_SLOW
//
//*****************************************************************************
#define FLAG_DECAY_BIT 2
//*****************************************************************************
//
//! The value of the #FLAG_DECAY_BIT flag that indicates that the motor is to
//! be driven with fast decay in trapezoid mode.
//
//*****************************************************************************
#define FLAG_DECAY_FAST 0
//*****************************************************************************
//
//! The value of the #FLAG_DECAY_BIT flag that indicates that the motor is to
//! be driven with slow decay in trapezoid mode.
//
//*****************************************************************************
#define FLAG_DECAY_SLOW 1
//*****************************************************************************
//
//! The bit number of the flag in the usFlags member of #tDriveParameters that
//! defines the type of drive waveform for the motor drive. This field will be
//! one of #FLAG_DRIVE_SINE or #FLAG_DRIVE_TRAPEZOID.
//
//*****************************************************************************
#define FLAG_DRIVE_BIT 3
//*****************************************************************************
//
//! The value of the #FLAG_DRIVE_BIT flag that indicates that the motor is to
//! be driven with sine wave modulation.
//
//*****************************************************************************
#define FLAG_DRIVE_SINE 0
//*****************************************************************************
//
//! The value of the #FLAG_DRIVE_BIT flag that indicates that the motor is to
//! be driven with trapezoid modulation.
//
//*****************************************************************************
#define FLAG_DRIVE_TRAPEZOID 1
//*****************************************************************************
//
//! The bit number of the flag in the usFlags member of #tDriveParameters that
//! defines the direction the motor is to be driven. The field will be one of
//! #FLAG_DIR_FORWARD or #FLAG_DIR_BACKWARD.
//
//*****************************************************************************
#define FLAG_DIR_BIT 4
//*****************************************************************************
//
//! The value of the #FLAG_DIR_BIT flag that indicates that the motor is to be
//! driven in the forward direction.
//
//*****************************************************************************
#define FLAG_DIR_FORWARD 0
//*****************************************************************************
//
//! The value of the #FLAG_DIR_BIT flag that indicates that the motor is to be
//! driven in the backward direction.
//
//*****************************************************************************
#define FLAG_DIR_BACKWARD 1
//*****************************************************************************
//
//! The bit number of the flag in the usFlags member of #tDriveParameters that
//! defines the presence of an encoder for speed feedback. This field will be
//! one of #FLAG_ENCODER_ABSENT or #FLAG_ENCODER_PRESENT.
//
//*****************************************************************************
#define FLAG_ENCODER_BIT 5
//*****************************************************************************
//
//! The value of the #FLAG_ENCODER_BIT flag that indicates that the encoder is
//! absent.
//
//*****************************************************************************
#define FLAG_ENCODER_ABSENT 0
//*****************************************************************************
//
//! The value of the #FLAG_ENCODER_BIT flag that indicates that the encoder is
//! present.
//
//*****************************************************************************
#define FLAG_ENCODER_PRESENT 1
//*****************************************************************************
//
//! The bit number of the flag in the usFlags member of #tDriveParameters that
//! defines the application of dynamic brake to handle regeneration onto DC
//! bus. This field will be one of #FLAG_BRAKE_ON or #FLAG_BRAKE_OFF.
//
//*****************************************************************************
#define FLAG_BRAKE_BIT 8
//*****************************************************************************
//
//! The value of the #FLAG_BRAKE_BIT flag that indicates that the dynamic brake
//! is disabled.
//
//*****************************************************************************
#define FLAG_BRAKE_OFF 0
//*****************************************************************************
//
//! The value of the #FLAG_BRAKE_BIT flag that indicates that the dynamic brake
//! is enabled.
//
//*****************************************************************************
#define FLAG_BRAKE_ON 1
//*****************************************************************************
//
//! The bit number of the flag in the usFlags member of #tDriveParameters that
//! defines the application of the DC injection brake to stop the motor. This
//! field will be one of #FLAG_DC_BRAKE_ON or #FLAG_DC_BRAKE_OFF.
//
//*****************************************************************************
#define FLAG_DC_BRAKE_BIT 9
//*****************************************************************************
//
//! The value of the #FLAG_DC_BRAKE_BIT flag that indicates that the DC
//! injection brake is disabled.
//
//*****************************************************************************
#define FLAG_DC_BRAKE_OFF 0
//*****************************************************************************
//
//! The value of the #FLAG_DC_BRAKE_BIT flag that indicates that the DC
//! injection brake is enabled.
//
//*****************************************************************************
#define FLAG_DC_BRAKE_ON 1
//*****************************************************************************
//
//! The bit number of the flag in the usFlags member of #tDriveParameters that
//! defines the presence of Hall Effect Sensor(s) for position/speed feedback.
//! This field will be one of #FLAG_SENSOR_ABSENT or #FLAG_SENSOR_PRESENT.
//
//*****************************************************************************
#define FLAG_SENSOR_BIT 10
//*****************************************************************************
//
//! The value of the #FLAG_SENSOR_BIT flag that indicates that the Hall Effect
//! sensor(s) are absent.
//
//*****************************************************************************
#define FLAG_SENSOR_ABSENT 0
//*****************************************************************************
//
//! The value of the #FLAG_SENSOR_BIT flag that indicates that the Hall Effect
//! sensor(s) are present.
//
//*****************************************************************************
#define FLAG_SENSOR_PRESENT 1
//*****************************************************************************
//
//! The bit number of the flag in the usFlags member of #tDriveParameters that
//! defines the type of Hall Effect Sensor(s) for position/speed feedback.
//! This field will be one of #FLAG_SENSOR_TYPE_GPIO or
//! #FLAG_SENSOR_TYPE_LINEAR.
//
//*****************************************************************************
#define FLAG_SENSOR_TYPE_BIT 11
//*****************************************************************************
//
//! The value of the #FLAG_SENSOR_TYPE_BIT flag that indicates that the Hall
//! Effect sensor(s) are digital GPIO inputs.
//
//*****************************************************************************
#define FLAG_SENSOR_TYPE_GPIO 0
//*****************************************************************************
//
//! The value of the #FLAG_SENSOR_TYPE_BIT flag that indicates that the Hall
//! Effect sensor(s) are Analog/Linear ADC inputs.
//
//*****************************************************************************
#define FLAG_SENSOR_TYPE_LINEAR 1
//*****************************************************************************
//
//! The bit number of the flag in the usFlags member of #tDriveParameters that
//! defines the polarity of the Hall Effect Sensor(s) inputs. This field will
//! be one of #FLAG_SENSOR_POLARITY_HIGH or #FLAG_SENSOR_POLARITY_LOW.
//
//*****************************************************************************
#define FLAG_SENSOR_POLARITY_BIT 12
//*****************************************************************************
//
//! The value of the #FLAG_SENSOR_POLARITY_BIT flag that indicates that the
//! Hall Effect sensor(s) are configured as active low.
//
//*****************************************************************************
#define FLAG_SENSOR_POLARITY_LOW 1
//*****************************************************************************
//
//! The value of the #FLAG_SENSOR_POLARITY_BIT flag that indicates that the
//! Hall Effect sensor(s) are configured as active high.
//
//*****************************************************************************
#define FLAG_SENSOR_POLARITY_HIGH 0
//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************
//*****************************************************************************
//
// Prototypes for the globals exported from the user interface.
//
//*****************************************************************************
extern tDriveParameters g_sParameters;
extern unsigned long g_ulTargetSpeed;
extern unsigned long g_ulCPUUsage;
extern unsigned long g_ulDebugInfo;
extern void GPIODIntHandler(void);
extern void UIRunLEDBlink(unsigned short usRate, unsigned short usPeriod);
extern void UIFaultLEDBlink(unsigned short usRate, unsigned short usPeriod);
extern void SysTickIntHandler(void);
extern void UIInit(void);
extern unsigned long UIGetTicks(void);
#endif // __UI_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -