brushless13 2.1.0.0
brushless13.h File Reference

This file contains API for Brushless 13 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  brushless13_t
 Brushless 13 Click context object. More...
 
struct  brushless13_cfg_t
 Brushless 13 Click configuration object. More...
 

Macros

#define BRUSHLESS13_REG_INPUT_PORT   0x00
 Brushless 13 description register.
 
#define BRUSHLESS13_REG_OUTPUT_PORT   0x01
 
#define BRUSHLESS13_REG_POLARITY_INV   0x02
 
#define BRUSHLESS13_REG_CONFIG   0x03
 
#define BRUSHLESS13_TR_COM_STATE_COAST   0x00
 Brushless 13 description setting.
 
#define BRUSHLESS13_TR_COM_STATE_1   0x01
 
#define BRUSHLESS13_TR_COM_STATE_2   0x02
 
#define BRUSHLESS13_TR_COM_STATE_3   0x03
 
#define BRUSHLESS13_TR_COM_STATE_4   0x04
 
#define BRUSHLESS13_TR_COM_STATE_5   0x05
 
#define BRUSHLESS13_TR_COM_STATE_6   0x06
 
#define BRUSHLESS13_TR_COM_STATE_BRAKE   0x07
 
#define BRUSHLESS13_NONE_PIN   0x00
 Brushless 13 pin mask.
 
#define BRUSHLESS13_ENW_PIN   0x01
 
#define BRUSHLESS13_INW_PIN   0x02
 
#define BRUSHLESS13_ENV_PIN   0x04
 
#define BRUSHLESS13_INV_PIN   0x08
 
#define BRUSHLESS13_ENU_PIN   0x10
 
#define BRUSHLESS13_INU_PIN   0x20
 
#define BRUSHLESS13_FLT_PIN   0x40
 
#define BRUSHLESS13_ALL_OUTPUT_PIN   0x3F
 
#define BRUSHLESS13_ALL_PIN   0x7F
 
#define BRUSHLESS13_MODE_ENX_INX   0x01
 Brushless 13 mode setting.
 
#define BRUSHLESS13_MODE_INXL_INXH   0x00
 
#define BRUSHLESS13_DIR_CW   0x01
 Brushless 13 direction setting.
 
#define BRUSHLESS13_DIR_CCW   0x00
 
#define BRUSHLESS13_PIN_STATE_LOW   0x00
 Brushless 13 pin logic level setting.
 
#define BRUSHLESS13_PIN_STATE_HIGH   0x01
 
#define BRUSHLESS13_FLT_PIN_INACTIVE   0x01
 Brushless 13 FLT pin state setting.
 
#define BRUSHLESS13_FLT_PIN_ACTIVE   0x00
 
#define BRUSHLESS13_SPEED_MIN   0
 Brushless 13 driving speed and time settings.
 
#define BRUSHLESS13_SPEED_MAX   100
 
#define BRUSHLESS13_NUM_PIN_TOGGLE   8
 
#define BRUSHLESS13_ROUND_TO_NEAREAST_INT   0.5
 
#define BRUSHLESS13_COM_SEQ_DURATION_FOR_SPEED_MAX   20.293
 Brushless 13 commutation sequance duration settings.
 
#define BRUSHLESS13_COM_SEQ_DURATION_SPEED_STEP   ( 20.351 - BRUSHLESS13_COM_SEQ_DURATION_FOR_SPEED_MAX )
 
#define BRUSHLESS13_DEVICE_ADDRESS_A1A0_00   0x70
 Brushless 13 device address setting.
 
#define BRUSHLESS13_DEVICE_ADDRESS_A1A0_01   0x71
 
#define BRUSHLESS13_DEVICE_ADDRESS_A1A0_10   0x72
 
#define BRUSHLESS13_DEVICE_ADDRESS_A1A0_11   0x73
 
#define BRUSHLESS13_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  brushless13_return_value_t { BRUSHLESS13_OK = 0 , BRUSHLESS13_ERROR = -1 }
 Brushless 13 Click return value data. More...
 

Functions

void brushless13_cfg_setup (brushless13_cfg_t *cfg)
 Brushless 13 configuration object setup function.
 
err_t brushless13_init (brushless13_t *ctx, brushless13_cfg_t *cfg)
 Brushless 13 initialization function.
 
err_t brushless13_default_cfg (brushless13_t *ctx)
 Brushless 13 default configuration function.
 
err_t brushless13_generic_write (brushless13_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Brushless 13 I2C writing function.
 
err_t brushless13_generic_read (brushless13_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Brushless 13 I2C reading function.
 
void brushless13_set_rst_pin (brushless13_t *ctx, uint8_t pin_state)
 Brushless 13 set rst pin function.
 
uint8_t brushless13_get_flt_state (brushless13_t *ctx)
 Brushless 13 get flt pin function.
 
void brushless13_set_mode (brushless13_t *ctx, uint8_t mode_sel)
 Brushless 13 set mode pin function.
 
void brushless13_reset_port_exp (brushless13_t *ctx)
 Brushless 13 reset port expander function.
 
uint8_t brushless13_get_flt_pin (brushless13_t *ctx)
 Brushless 13 get fault pin function.
 
err_t brushless13_write_reg (brushless13_t *ctx, uint8_t reg, uint8_t data_in)
 Brushless 13 write register function.
 
err_t brushless13_read_reg (brushless13_t *ctx, uint8_t reg, uint8_t *data_out)
 Brushless 13 read register function.
 
err_t brushless13_set_pins (brushless13_t *ctx, uint8_t set_mask, uint8_t clr_mask)
 Brushless 13 set pins function.
 
err_t brushless13_set_trap_com_state (brushless13_t *ctx, uint8_t state)
 Brushless 13 set trapezoidal com state function.
 
err_t brushless13_toggle_pin (brushless13_t *ctx, uint8_t pin_mask, uint8_t speed)
 Brushless 13 toggle pin function.
 
err_t brushless13_perform_com_seq (brushless13_t *ctx, uint8_t dir, uint8_t speed)
 Brushless 13 perform com sequence function.
 
err_t brushless13_drive_motor (brushless13_t *ctx, uint8_t dir, uint8_t speed, uint32_t time_ms)
 Brushless 13 drive motor function.
 

Detailed Description

This file contains API for Brushless 13 Click Driver.

Enumeration Type Documentation

◆ brushless13_return_value_t

Brushless 13 Click return value data.

Predefined enum values for driver return values.

Enumerator
BRUSHLESS13_OK 
BRUSHLESS13_ERROR