39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
72#define DCMOTOR19_CHANNEL_1 0x01
73#define DCMOTOR19_CHANNEL_2 0x02
79#define DCMOTOR19_MODE_STOP 0x00
80#define DCMOTOR19_MODE_FORWARD 0x01
81#define DCMOTOR19_MODE_REVERSE 0x02
82#define DCMOTOR19_MODE_SHORT_BRAKE 0x03
88#define DCMOTOR19_SPEED_MAX 100
89#define DCMOTOR19_SPEED_DEFAULT 5
90#define DCMOTOR19_SPEED_MIN 1
91#define DCMOTOR19_MS_TIME_STEP 10
109#define DCMOTOR19_MAP_MIKROBUS( cfg, mikrobus ) \
110 cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
111 cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
112 cfg.sby = MIKROBUS( mikrobus, MIKROBUS_CS ); \
113 cfg.in3 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
114 cfg.in4 = MIKROBUS( mikrobus, MIKROBUS_INT )
dcmotor19_return_value_t
DC Motor 19 Click return value data.
Definition dcmotor19.h:155
@ DCMOTOR19_ERROR
Definition dcmotor19.h:157
@ DCMOTOR19_OK
Definition dcmotor19.h:156
err_t dcmotor19_set_channel_mode(dcmotor19_t *ctx, uint8_t channel, uint8_t mode)
DC Motor 19 set channel mode function.
err_t dcmotor19_init(dcmotor19_t *ctx, dcmotor19_cfg_t *cfg)
DC Motor 19 initialization function.
void dcmotor19_disable_standby_mode(dcmotor19_t *ctx)
DC Motor 19 disable standby mode function.
err_t dcmotor19_drive_motor(dcmotor19_t *ctx, uint8_t speed, uint32_t time_ms)
DC Motor 19 drive motor function.
void dcmotor19_cfg_setup(dcmotor19_cfg_t *cfg)
DC Motor 19 configuration object setup function.
void dcmotor19_enable_standby_mode(dcmotor19_t *ctx)
DC Motor 19 enable standby mode function.
DC Motor 19 Click configuration object.
Definition dcmotor19.h:141
pin_name_t in2
Definition dcmotor19.h:143
pin_name_t in1
Definition dcmotor19.h:142
pin_name_t in4
Definition dcmotor19.h:146
pin_name_t sby
Definition dcmotor19.h:144
pin_name_t in3
Definition dcmotor19.h:145
DC Motor 19 Click context object.
Definition dcmotor19.h:124
digital_out_t in2
Definition dcmotor19.h:126
uint8_t mode
Definition dcmotor19.h:132
digital_out_t in3
Definition dcmotor19.h:128
uint8_t active_ch
Definition dcmotor19.h:131
digital_out_t in4
Definition dcmotor19.h:129
digital_out_t sby
Definition dcmotor19.h:127
digital_out_t in1
Definition dcmotor19.h:125