brushless26 2.1.0.0
brushless26.h File Reference

This file contains API for Brushless 26 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  brushless26_t
 Brushless 26 Click context object. More...
 
struct  brushless26_cfg_t
 Brushless 26 Click configuration object. More...
 

Macros

#define BRUSHLESS26_REG_INPUT_PORT   0x00
 Brushless 26 description register.
 
#define BRUSHLESS26_REG_OUTPUT_PORT   0x01
 
#define BRUSHLESS26_REG_POLARITY_INV   0x02
 
#define BRUSHLESS26_REG_CONFIG   0x03
 
#define BRUSHLESS26_TR_COM_STATE_COAST   0x00
 Brushless 26 description setting.
 
#define BRUSHLESS26_TR_COM_STATE_1   0x01
 
#define BRUSHLESS26_TR_COM_STATE_2   0x02
 
#define BRUSHLESS26_TR_COM_STATE_3   0x03
 
#define BRUSHLESS26_TR_COM_STATE_4   0x04
 
#define BRUSHLESS26_TR_COM_STATE_5   0x05
 
#define BRUSHLESS26_TR_COM_STATE_6   0x06
 
#define BRUSHLESS26_TR_COM_STATE_BRAKE   0x07
 
#define BRUSHLESS26_NONE_PIN   0x00
 Brushless 26 pin mask.
 
#define BRUSHLESS26_INLC_PIN   0x01
 
#define BRUSHLESS26_INHC_PIN   0x02
 
#define BRUSHLESS26_INLB_PIN   0x04
 
#define BRUSHLESS26_INHB_PIN   0x08
 
#define BRUSHLESS26_INLA_PIN   0x10
 
#define BRUSHLESS26_INHA_PIN   0x20
 
#define BRUSHLESS26_SLP_PIN   0x40
 
#define BRUSHLESS26_ALL_OUTPUT_PIN   0x3F
 
#define BRUSHLESS26_ALL_PIN   0x7F
 
#define BRUSHLESS26_MODE_6X_PWM   0x01
 Brushless 26 PWM mode setting.
 
#define BRUSHLESS26_MODE_3X_PWM   0x00
 
#define BRUSHLESS26_DIR_CW   0x01
 Brushless 26 direction setting.
 
#define BRUSHLESS26_DIR_CCW   0x00
 
#define BRUSHLESS26_PIN_STATE_LOW   0x00
 Brushless 26 pin logic level setting.
 
#define BRUSHLESS26_PIN_STATE_HIGH   0x01
 
#define BRUSHLESS26_SPEED_MIN   0
 Brushless 26 driving speed and time settings.
 
#define BRUSHLESS26_SPEED_MAX   100
 
#define BRUSHLESS26_NUM_PIN_TOGGLE   8
 
#define BRUSHLESS26_ROUND_TO_NEAREAST_INT   0.5
 
#define BRUSHLESS26_COM_SEQ_DURATION_FOR_SPEED_MAX   20.293
 Brushless 26 commutation sequance duration settings.
 
#define BRUSHLESS26_COM_SEQ_DURATION_SPEED_STEP   ( 20.351 - BRUSHLESS26_COM_SEQ_DURATION_FOR_SPEED_MAX )
 
#define BRUSHLESS26_DEVICE_ADDRESS_A1A0_00   0x70
 Brushless 26 device address setting.
 
#define BRUSHLESS26_DEVICE_ADDRESS_A1A0_01   0x71
 
#define BRUSHLESS26_DEVICE_ADDRESS_A1A0_10   0x72
 
#define BRUSHLESS26_DEVICE_ADDRESS_A1A0_11   0x73
 
#define BRUSHLESS26_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  brushless26_return_value_t { BRUSHLESS26_OK = 0 , BRUSHLESS26_ERROR = -1 }
 Brushless 26 Click return value data. More...
 

Functions

void brushless26_cfg_setup (brushless26_cfg_t *cfg)
 Brushless 26 configuration object setup function.
 
err_t brushless26_init (brushless26_t *ctx, brushless26_cfg_t *cfg)
 Brushless 26 initialization function.
 
err_t brushless26_default_cfg (brushless26_t *ctx)
 Brushless 26 default configuration function.
 
err_t brushless26_generic_write (brushless26_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Brushless 26 I2C writing function.
 
err_t brushless26_generic_read (brushless26_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Brushless 26 I2C reading function.
 
void brushless26_set_rst_pin (brushless26_t *ctx, uint8_t pin_state)
 Brushless 26 set rst pin function.
 
void brushless26_reset_port_exp (brushless26_t *ctx)
 Brushless 26 reset port expander function.
 
uint8_t brushless26_get_flt_pin (brushless26_t *ctx)
 Brushless 26 get fault pin function.
 
err_t brushless26_write_reg (brushless26_t *ctx, uint8_t reg, uint8_t data_in)
 Brushless 26 write register function.
 
err_t brushless26_read_reg (brushless26_t *ctx, uint8_t reg, uint8_t *data_out)
 Brushless 26 read register function.
 
err_t brushless26_set_pins (brushless26_t *ctx, uint8_t set_mask, uint8_t clr_mask)
 Brushless 26 set pins function.
 
err_t brushless26_set_trap_com_state (brushless26_t *ctx, uint8_t state)
 Brushless 26 set trapezoidal com state function.
 
err_t brushless26_toggle_pin (brushless26_t *ctx, uint8_t pin_mask, uint8_t speed)
 Brushless 26 toggle pin function.
 
err_t brushless26_perform_com_seq (brushless26_t *ctx, uint8_t dir, uint8_t speed)
 Brushless 26 perform com sequence function.
 
err_t brushless26_drive_motor (brushless26_t *ctx, uint8_t dir, uint8_t speed, uint32_t time_ms)
 Brushless 26 drive motor function.
 

Detailed Description

This file contains API for Brushless 26 Click Driver.

Enumeration Type Documentation

◆ brushless26_return_value_t

Brushless 26 Click return value data.

Predefined enum values for driver return values.

Enumerator
BRUSHLESS26_OK 
BRUSHLESS26_ERROR