typedef struct
{
//---------------------------------------
// Set a copy of the port address to use.
void (*InitPort)(MotorData*, int*);
//---------------------------------------
// Set/Get the motor speed.
void (*SetSpeed)(MotorData*, int);
int (*GetSpeed)(MotorData*);
//----------------------------------------
// Set/Get the motor rotation direction.
void (*SetDirection)(MotorData*, DIRECTION);
DIRECTION (*GetDirection)(MotorData*);
} MOTOR;
Example 1: Initializing port address, and setting/getting speed and direction.
Back to Article