dcmotor13  2.0.0.0
Data Structures | Macros | Enumerations | Functions
dcmotor13.h File Reference

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

#include "mikrosdk_version.h"
#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  dcmotor13_t
 DC Motor 13 Click context object. More...
 
struct  dcmotor13_cfg_t
 DC Motor 13 Click configuration object. More...
 

Macros

#define DCMOTOR13_REG_INPUT   0x00
 DC Motor 13 PCA9538A registers. More...
 
#define DCMOTOR13_REG_OUTPUT   0x01
 
#define DCMOTOR13_REG_POLARITY   0x02
 
#define DCMOTOR13_REG_CONFIG   0x03
 
#define DCMOTOR13_LO_PIN   0x01
 DC Motor 13 PCA9538A pin mask. More...
 
#define DCMOTOR13_AI2_PIN   0x02
 
#define DCMOTOR13_BI2_PIN   0x04
 
#define DCMOTOR13_TA1_PIN   0x08
 
#define DCMOTOR13_TA2_PIN   0x10
 
#define DCMOTOR13_TB1_PIN   0x20
 
#define DCMOTOR13_TB2_PIN   0x40
 
#define DCMOTOR13_DEFAULT_CONFIG   0x81
 DC Motor 13 PCA9538A pin direction config. More...
 
#define DCMOTOR13_PIN_LOW_LEVEL   0
 DC Motor 13 pin logic level setting. More...
 
#define DCMOTOR13_PIN_HIGH_LEVEL   1
 
#define DCMOTOR13_MODE_SHORT_BRAKE   0x00
 DC Motor 13 output mode setting. More...
 
#define DCMOTOR13_MODE_CCW   0x01
 
#define DCMOTOR13_MODE_CW   0x02
 
#define DCMOTOR13_TORQUE_0   0x00
 DC Motor 13 output torque setting. More...
 
#define DCMOTOR13_TORQUE_38   0x01
 
#define DCMOTOR13_TORQUE_71   0x02
 
#define DCMOTOR13_TORQUE_100   0x03
 
#define DCMOTOR13_DEVICE_ADDRESS_A1A0_00   0x70
 DC Motor 13 device address setting. More...
 
#define DCMOTOR13_DEVICE_ADDRESS_A1A0_01   0x71
 
#define DCMOTOR13_DEVICE_ADDRESS_A1A0_10   0x72
 
#define DCMOTOR13_DEVICE_ADDRESS_A1A0_11   0x73
 
#define DCMOTOR13_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

Enumerations

enum  dcmotor13_return_value_t { DCMOTOR13_OK = 0, DCMOTOR13_ERROR = -1 }
 DC Motor 13 Click return value data. More...
 

Functions

void dcmotor13_cfg_setup (dcmotor13_cfg_t *cfg)
 DC Motor 13 configuration object setup function. More...
 
err_t dcmotor13_init (dcmotor13_t *ctx, dcmotor13_cfg_t *cfg)
 DC Motor 13 initialization function. More...
 
err_t dcmotor13_default_cfg (dcmotor13_t *ctx)
 DC Motor 13 default configuration function. More...
 
err_t dcmotor13_write_register (dcmotor13_t *ctx, uint8_t reg, uint8_t data_in)
 DC Motor 13 write register function. More...
 
err_t dcmotor13_read_register (dcmotor13_t *ctx, uint8_t reg, uint8_t *data_out)
 DC Motor 13 read register function. More...
 
void dcmotor13_enable_device (dcmotor13_t *ctx)
 DC Motor 13 enable device function. More...
 
void dcmotor13_disable_device (dcmotor13_t *ctx)
 DC Motor 13 disable device function. More...
 
void dcmotor13_reset_device (dcmotor13_t *ctx)
 DC Motor 13 reset device function. More...
 
uint8_t dcmotor13_get_int_pin (dcmotor13_t *ctx)
 DC Motor 13 get int pin function. More...
 
void dcmotor13_set_ai1_pin (dcmotor13_t *ctx, uint8_t state)
 DC Motor 13 set AI1 pin function. More...
 
void dcmotor13_set_bi1_pin (dcmotor13_t *ctx, uint8_t state)
 DC Motor 13 set BI1 pin function. More...
 
err_t dcmotor13_get_lo_pin (dcmotor13_t *ctx, uint8_t *pin_state)
 DC Motor 13 get LO pin function. More...
 
err_t dcmotor13_set_outa_mode (dcmotor13_t *ctx, uint8_t mode)
 DC Motor 13 set OUTA mode function. More...
 
err_t dcmotor13_set_outb_mode (dcmotor13_t *ctx, uint8_t mode)
 DC Motor 13 set OUTB mode function. More...
 
err_t dcmotor13_set_outa_torque (dcmotor13_t *ctx, uint8_t torque)
 DC Motor 13 set OUTA torque function. More...
 
err_t dcmotor13_set_outb_torque (dcmotor13_t *ctx, uint8_t torque)
 DC Motor 13 set OUTB torque function. More...
 

Detailed Description

This file contains API for DC Motor 13 Click Driver.

Enumeration Type Documentation

◆ dcmotor13_return_value_t

DC Motor 13 Click return value data.

Predefined enum values for driver return values.

Enumerator
DCMOTOR13_OK 
DCMOTOR13_ERROR