dcmotor7 2.0.0.0
dcmotor7.h File Reference

This file contains API for DC MOTOR 7 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  dcmotor7_t
 Click ctx object definition. More...
 
struct  dcmotor7_cfg_t
 Click configuration structure definition. More...
 

Macros

#define DCMOTOR7_MAP_MIKROBUS(cfg, mikrobus)
 
#define DCMOTOR7_RETVAL   uint8_t
 
#define DCMOTOR7_OK   0x00
 
#define DCMOTOR7_INIT_ERROR   0xFF
 
#define DCMOTOR7_CMD_INPUT_PORT   0x00
 
#define DCMOTOR7_CMD_OUTPUT_PORT   0x01
 
#define DCMOTOR7_CMD_POLARITY_INVERSION   0x02
 
#define DCMOTOR7_CMD_CONFIGURATION   0x03
 
#define DCMOTOR7_PORT_0   0x01
 
#define DCMOTOR7_PORT_1   0x02
 
#define DCMOTOR7_PORT_2   0x04
 
#define DCMOTOR7_PORT_3   0x08
 
#define DCMOTOR7_PORT_4   0x10
 
#define DCMOTOR7_PORT_5   0x20
 
#define DCMOTOR7_PORT_6   0x40
 
#define DCMOTOR7_PORT_7   0x80
 
#define DCMOTOR7_TBLK_FOSCM_X4_CLK   0x00
 
#define DCMOTOR7_TBLK_FOSCM_X6_CLK   0x01
 
#define DCMOTOR7_HBMODE_SMALL_MODE   0x00
 
#define DCMOTOR7_HBMODE_LARGE_MODE   0x01
 
#define DCMOTOR7_MOTOR_A   0x01
 
#define DCMOTOR7_MOTOR_B   0x02
 
#define DCMOTOR7_SLAVE_ADDRESS_0_0   0x70
 
#define DCMOTOR7_SLAVE_ADDRESS_0_1   0x71
 
#define DCMOTOR7_SLAVE_ADDRESS_1_0   0x72
 
#define DCMOTOR7_SLAVE_ADDRESS_1_1   0x73
 
#define DCMOTOR7_ENABLE_ALL_OUTPUT_PORT   0x00
 
#define DCMOTOR7_DISABLE_ALL_OUTPUT_PORT   0xFF
 

Functions

void dcmotor7_cfg_setup (dcmotor7_cfg_t *cfg)
 Config Object Initialization function.
 
DCMOTOR7_RETVAL dcmotor7_init (dcmotor7_t *ctx, dcmotor7_cfg_t *cfg)
 Initialization function.
 
void dcmotor7_default_cfg (dcmotor7_t *ctx)
 Default Confuguration.
 
void dcmotor7_generic_write (dcmotor7_t *ctx, uint8_t reg, uint8_t tmp)
 Generic write function.
 
void dcmotor7_generic_read (dcmotor7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void dcmotor7_set_port (dcmotor7_t *ctx, uint8_t port, uint8_t value)
 Functions for set port.
 
void dcmotor7_set_motor (dcmotor7_t *ctx, uint8_t motor, uint8_t in1, uint8_t in2)
 Functions for set Motor.
 
void dcmotor7_set_tblkab (dcmotor7_t *ctx, uint8_t tblk)
 Functions for set Motor Ach and Bch Digital tBLK.
 
void dcmotor7_set_hb_mode (dcmotor7_t *ctx, uint8_t mode)
 Functions for set H-Bridge operation mode.
 
void dcmotor7_motor_stop (dcmotor7_t *ctx, uint8_t motor)
 Motor stop function.
 
void dcmotor7_go_to_stand_by_mode (dcmotor7_t *ctx, uint8_t motor)
 Function for setting the motor in stand mode.
 
void dcmotor7_set_pwm_motor_a (dcmotor7_t *ctx, uint8_t state)
 Function for set PWM value for motor A.
 
void dcmotor7_set_pwm_motor_b (dcmotor7_t *ctx, uint8_t state)
 Function for set PWM value for motor B.
 

Detailed Description

This file contains API for DC MOTOR 7 Click driver.