39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define DCMOTOR20_CHANNEL_1 0x01
74#define DCMOTOR20_CHANNEL_2 0x02
80#define DCMOTOR20_MODE_STOP 0x00
81#define DCMOTOR20_MODE_FORWARD 0x01
82#define DCMOTOR20_MODE_REVERSE 0x02
88#define DCMOTOR20_SPEED_MAX 100
89#define DCMOTOR20_SPEED_DEFAULT 10
90#define DCMOTOR20_SPEED_MIN 1
91#define DCMOTOR20_MS_TIME_STEP 10
109#define DCMOTOR20_MAP_MIKROBUS( cfg, mikrobus ) \
110 cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
111 cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
112 cfg.in3 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
113 cfg.in4 = MIKROBUS( mikrobus, MIKROBUS_INT )
dcmotor20_return_value_t
DC Motor 20 Click return value data.
Definition dcmotor20.h:152
@ DCMOTOR20_ERROR
Definition dcmotor20.h:154
@ DCMOTOR20_OK
Definition dcmotor20.h:153
void dcmotor20_set_standby_mode(dcmotor20_t *ctx)
DC Motor 20 set standby mode function.
err_t dcmotor20_drive_motor(dcmotor20_t *ctx, uint8_t speed, uint32_t time_ms)
DC Motor 20 drive motor function.
void dcmotor20_cfg_setup(dcmotor20_cfg_t *cfg)
DC Motor 20 configuration object setup function.
err_t dcmotor20_init(dcmotor20_t *ctx, dcmotor20_cfg_t *cfg)
DC Motor 20 initialization function.
err_t dcmotor20_set_channel_mode(dcmotor20_t *ctx, uint8_t channel, uint8_t mode)
DC Motor 20 set channel mode function.
DC Motor 20 Click configuration object.
Definition dcmotor20.h:139
pin_name_t in2
Definition dcmotor20.h:141
pin_name_t in1
Definition dcmotor20.h:140
pin_name_t in4
Definition dcmotor20.h:143
pin_name_t in3
Definition dcmotor20.h:142
DC Motor 20 Click context object.
Definition dcmotor20.h:123
digital_out_t in2
Definition dcmotor20.h:125
uint8_t mode
Definition dcmotor20.h:130
digital_out_t in3
Definition dcmotor20.h:126
uint8_t active_ch
Definition dcmotor20.h:129
digital_out_t in4
Definition dcmotor20.h:127
digital_out_t in1
Definition dcmotor20.h:124