/*!
  \file
  \brief モータ制御

  \author Satofumi KAMIMURA

  $Id: motor_control.c 1209 2009-08-05 13:11:59Z satofumi $
*/

#include "motor_control.h"
#include "encoder_handler.h"


void motor_initialize(int id, motor_t *motor)
{
  motor->reset = 0;
  motor->id = id;

  // !!!
}


void motor_reset(motor_t *motor)
{
  (void)motor;

  // !!!
}


void motor_setMode(int id, MotorMode mode)
{
  (void)id;
  (void)mode;

  // !!!
}


void motor_setVelocity(int id, int count_per_msec,
                       int encoder_count, motor_t *motor)
{
  (void)id;
  (void)count_per_msec;
  (void)encoder_count;
  (void)motor;

  // 現在のエンコーダ値と指定速度とで PI 制御を行う
  // !!!

  // !!! pwm_setIo()
  // !!! pwm_setDuty()

  // !!!
}
