dcmotor23 2.1.0.0
dcmotor23.h File Reference

This file contains API for DC Motor 23 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  dcmotor23_t
 DC Motor 23 Click context object. More...
 
struct  dcmotor23_cfg_t
 DC Motor 23 Click configuration object. More...
 

Macros

#define DCMOTOR23_REG_INPUT   0x00
 DC Motor 23 description register.
 
#define DCMOTOR23_REG_OUTPUT   0x01
 
#define DCMOTOR23_REG_POLARITY   0x02
 
#define DCMOTOR23_REG_CONFIG   0x03
 
#define DCMOTOR23_LO_PIN   0x01
 DC Motor 23 description setting.
 
#define DCMOTOR23_PHASE_A_PIN   0x02
 
#define DCMOTOR23_PHASE_B_PIN   0x04
 
#define DCMOTOR23_TRQ_A1_PIN   0x08
 
#define DCMOTOR23_TRQ_A2_PIN   0x10
 
#define DCMOTOR23_TRQ_B1_PIN   0x20
 
#define DCMOTOR23_TRQ_B2_PIN   0x40
 
#define DCMOTOR23_DEFAULT_CONFIG   0x01
 DC Motor 23 pin direction config.
 
#define DCMOTOR23_PIN_LOW_LEVEL   0
 DC Motor 23 pin logic level setting.
 
#define DCMOTOR23_PIN_HIGH_LEVEL   1
 
#define DCMOTOR23_MODE_DECAY   0x00
 DC Motor 23 output mode setting.
 
#define DCMOTOR23_MODE_CCW   0x01
 
#define DCMOTOR23_MODE_CW   0x02
 
#define DCMOTOR23_TORQUE_0   0x00
 DC Motor 23 output torque setting.
 
#define DCMOTOR23_TORQUE_38   0x01
 
#define DCMOTOR23_TORQUE_71   0x02
 
#define DCMOTOR23_TORQUE_100   0x03
 
#define DCMOTOR23_SEL_OUT_A   0x00
 DC Motor 23 output setting.
 
#define DCMOTOR23_SEL_OUT_B   0x01
 
#define DCMOTOR23_DEVICE_ADDRESS_0   0x70
 DC Motor 23 device address setting.
 
#define DCMOTOR23_DEVICE_ADDRESS_1   0x71
 
#define DCMOTOR23_DEVICE_ADDRESS_2   0x72
 
#define DCMOTOR23_DEVICE_ADDRESS_3   0x73
 
#define DCMOTOR23_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  dcmotor23_return_value_t { DCMOTOR23_OK = 0 , DCMOTOR23_ERROR = -1 }
 DC Motor 23 Click return value data. More...
 

Functions

void dcmotor23_cfg_setup (dcmotor23_cfg_t *cfg)
 DC Motor 23 configuration object setup function.
 
err_t dcmotor23_init (dcmotor23_t *ctx, dcmotor23_cfg_t *cfg)
 DC Motor 23 initialization function.
 
err_t dcmotor23_default_cfg (dcmotor23_t *ctx)
 DC Motor 23 default configuration function.
 
err_t dcmotor23_write_register (dcmotor23_t *ctx, uint8_t reg, uint8_t data_in)
 DC Motor 23 I2C writing function.
 
err_t dcmotor23_read_register (dcmotor23_t *ctx, uint8_t reg, uint8_t *data_out)
 DC Motor 23 I2C reading function.
 
err_t dcmotor23_get_lo_pin (dcmotor23_t *ctx, uint8_t *pin_state)
 DC Motor 23 get LO pin function.
 
err_t dcmotor23_set_output_mode (dcmotor23_t *ctx, uint8_t mode, uint8_t sel_motor)
 DC Motor 23 set output mode function.
 
err_t dcmotor23_set_clockwise (dcmotor23_t *ctx, uint8_t sel_motor)
 DC Motor 23 set clockwise function.
 
err_t dcmotor23_set_counter_clockwise (dcmotor23_t *ctx, uint8_t sel_motor)
 DC Motor 23 set counter clockwise function.
 
err_t dcmotor23_set_decay (dcmotor23_t *ctx, uint8_t sel_motor)
 DC Motor 23 set decay function.
 
err_t dcmotor23_set_outa_torque (dcmotor23_t *ctx, uint8_t torque)
 DC Motor 23 set OUTA torque function.
 
err_t dcmotor23_set_outb_torque (dcmotor23_t *ctx, uint8_t torque)
 DC Motor 23 set OUTB torque function.
 
void dcmotor23_normal_operation_mode (dcmotor23_t *ctx)
 DC Motor 23 set normal operation mode function.
 
void dcmotor23_sleep_mode (dcmotor23_t *ctx)
 DC Motor 23 set sleep operation mode function.
 
void dcmotor23_reset_device (dcmotor23_t *ctx)
 DC Motor 23 reset device function.
 
uint8_t dcmotor23_get_int_pin (dcmotor23_t *ctx)
 DC Motor 23 get INT pin function.
 
void dcmotor23_set_en_a_pin (dcmotor23_t *ctx, uint8_t state)
 DC Motor 23 set EN_A pin function.
 
void dcmotor23_set_en_b_pin (dcmotor23_t *ctx, uint8_t state)
 DC Motor 23 set EN_B pin function.
 

Detailed Description

This file contains API for DC Motor 23 Click Driver.

Enumeration Type Documentation

◆ dcmotor23_return_value_t

DC Motor 23 Click return value data.

Predefined enum values for driver return values.

Enumerator
DCMOTOR23_OK 
DCMOTOR23_ERROR