X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fhw%2Fhw_dc_motor.h;h=f39388df00c019bb85c05ad79a7ea758cf193416;hb=088cc866a57a0402f6ba3f232fcf8f59c79626d1;hp=8b8dd4b40e7885082076ddd5f2289caff0419d95;hpb=6c8fa0fc86f31cbd16ed8baf9a6c83a2278ae57d;p=bertos.git diff --git a/bertos/hw/hw_dc_motor.h b/bertos/hw/hw_dc_motor.h index 8b8dd4b4..f39388df 100644 --- a/bertos/hw/hw_dc_motor.h +++ b/bertos/hw/hw_dc_motor.h @@ -32,54 +32,40 @@ * * \brief DC motor hardware-specific definitions * - * \version $Id$ - * * \author Daniele Basile */ #ifndef HW_DC_MOTOR_H #define HW_DC_MOTOR_H -typedef enum MotorDCMap -{ - - /* Put here motor dc declaration */ - MOTOR_DC_CNT +#warning TODO:This is an example implementation, you must implement it! -} MotorDCMap; - -/* - * Init all pin and device to manage dc motor. +/** + * Define fuctions which read adc value from specific device */ -#define MOTOR_DC_INIT() \ - do { \ - /* Implement me! */ \ - } while (0) + #define HW_DC_MOTOR_READ_VALUE(dev, min, max) \ + ({ \ + /* Put here the fuction that read from ADC */ \ + (void)(dev); \ + (void)(min); \ + (void)(max); \ + (0); \ + }) +// Macro that enable the select DC motor +#define DC_MOTOR_ENABLE(dev) /* Implement me! */ +// Macro that disable the select DC motor +#define DC_MOTOR_DISABLE(dev) /* Implement me! */ -/* - * Enable DC motor. - */ -#define DC_MOTOR_ENABLE(dev) \ - do { \ - /* Implement me! */ \ - } while (0) +// Macro that left the DC motor rotor float +#define DC_MOTOR_STOP_FLOAT(dev) DC_MOTOR_DISABLE(dev) +// Macro that put in short circuit DC motor supply pins +#define DC_MOTOR_STOP_BRAKED(dev) do { /* Implement me! */ } while (0) -/* - * Disable DC motor. - */ -#define DC_MOTOR_DISABLE(dev) \ - do { \ - /* Implement me! */ \ - } while (0) +// Macro that set motor direction +#define DC_MOTOR_SET_DIR(dev, dir) do { /* Implement me! */ } while (0) -/* - * Set direction for DC motor. - */ -#define DC_MOTOR_SET_DIR(dev, dir) \ - do { \ - /* Implement me! */ \ - } while (0) +#define MOTOR_DC_INIT() do { /* Implement me! */ } while (0) #endif /* HW_DC_MOTOR_H */