CHAPTER 4 PROGRAM LIST
Application Note U17209EJ1V0AN
116
extern signed int now_speed ; /* Present speed rms */
extern signed int object_speed ; /* Target speed rms */
extern unsigned int d_speed ; /* Display speed rms */
extern unsigned char ram_end ;
#pragma section const begin
extern const unsigned short led_pat[] ;;
#pragma section const end
/****************************************************************************** /
/* Motor common definition */
/****************************************************************************** /
extern signed short iua ; /* U-phase current */
extern signed short iva ; /* V-phase current */
extern signed int o_iqai ; /* Speed integral value area */
extern signed int base_position ; /* Speed estimation value reference point */
extern unsigned int sa_time ; /* Speed measurement value */
extern unsigned short timer_count ; /* Time wait counter */
extern unsigned short accel_count ; /* Acceleration/deceleration operation */
/* time counter */
extern unsigned short init_co ; /* Initial interrupt counter */
extern unsigned char init_pat ; /* Initial pattern counter */
extern unsigned short init_upco ; /* Initial speed-up counter */
extern unsigned int int_co ; /* UVW interrupt counter */
extern signed int pwm_value ; /* PWM output value */
#pragma section const begin
extern const unsigned char cw_data[][2] ;
extern const unsigned char ccw_data[][2] ;
extern const unsigned char up_data[] ;
extern const unsigned char run_cw_data[][2] ;
extern const unsigned char run_ccw_data[][2] ;
#pragma section const end
4.3.2 Constant definition
/****************************************************************************** /
/* I/O */
/****************************************************************************** /
#define BASE_IO 0xc200000
#define LED11 0x03
#define LED12 0x02
#define LED13 0x01
#define LED14 0x00
#define LED21 0x05
#define LED22 0x04
#define LED31 0x07
#define LED32 0x06