39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_i2c_master.h"
72#define DCMOTOR25_WRITE_TO_RDAC 0x00
73#define DCMOTOR25_ONE_TIME_PROG 0x80
91#define DCMOTOR25_OTP_V_READY 0x00
92#define DCMOTOR25_OTP_V_TEST_OK 0x40
93#define DCMOTOR25_OTP_V_ERROR 0x80
94#define DCMOTOR25_OTP_V_PROG_SUCCESS 0xC0
101#define DCMOTOR25_RESISTANCE_MIN 17000
102#define DCMOTOR25_RES_DEFAULT_20_kOhm 20000
103#define DCMOTOR25_FULL_SCALE_RES_50_kOhm 50000
104#define DCMOTOR25_WIPER_POS_MAX 0x3F
112#define DCMOTOR25_DEVICE_ADDRESS 0x2C
130#define DCMOTOR25_MAP_MIKROBUS( cfg, mikrobus ) \
131 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
132 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
133 cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
134 cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_PWM )
dcmotor25_return_value_t
DC Motor 25 Click return value data.
Definition dcmotor25.h:179
@ DCMOTOR25_OK
Definition dcmotor25.h:180
@ DCMOTOR25_ERROR
Definition dcmotor25.h:181
err_t dcmotor25_set_resistance(dcmotor25_t *ctx, uint16_t res_ohm)
DC Motor 25 set the resistance function.
void dcmotor25_reverse(dcmotor25_t *ctx)
DC Motor 25 set reverse mode function.
void dcmotor25_cfg_setup(dcmotor25_cfg_t *cfg)
DC Motor 25 configuration object setup function.
err_t dcmotor25_init(dcmotor25_t *ctx, dcmotor25_cfg_t *cfg)
DC Motor 25 initialization function.
void dcmotor25_forward(dcmotor25_t *ctx)
DC Motor 25 set forward mode function.
err_t dcmotor25_write_byte(dcmotor25_t *ctx, uint8_t inst, uint8_t data_in)
DC Motor 25 I2C writing function.
void dcmotor25_brake(dcmotor25_t *ctx)
DC Motor 25 set brake mode function.
err_t dcmotor25_read_byte(dcmotor25_t *ctx, uint8_t *data_out)
DC Motor 25 I2C reading function.
err_t dcmotor25_write_rdac(dcmotor25_t *ctx, uint8_t rdac_data)
DC Motor 25 write RDAC function.
err_t dcmotor25_set_digi_pot(dcmotor25_t *ctx, uint8_t wiper_pos)
DC Motor 25 set the digital potentiometer function.
err_t dcmotor25_read_rdac(dcmotor25_t *ctx, uint8_t *rdac_data)
DC Motor 25 read RDAC function.
err_t dcmotor25_default_cfg(dcmotor25_t *ctx)
DC Motor 25 default configuration function.
void dcmotor25_standby(dcmotor25_t *ctx)
DC Motor 25 set standby mode function.
DC Motor 25 Click configuration object.
Definition dcmotor25.h:162
uint32_t i2c_speed
Definition dcmotor25.h:169
pin_name_t in2
Definition dcmotor25.h:167
pin_name_t scl
Definition dcmotor25.h:163
pin_name_t in1
Definition dcmotor25.h:166
pin_name_t sda
Definition dcmotor25.h:164
uint8_t i2c_address
Definition dcmotor25.h:170
DC Motor 25 Click context object.
Definition dcmotor25.h:144
digital_out_t in2
Definition dcmotor25.h:147
i2c_master_t i2c
Definition dcmotor25.h:150
uint8_t slave_address
Definition dcmotor25.h:153
digital_out_t in1
Definition dcmotor25.h:146