brushless27 2.1.0.0
brushless27.h File Reference

This file contains API for Brushless 27 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  brushless27_t
 Brushless 27 Click context object. More...
 
struct  brushless27_cfg_t
 Brushless 27 Click configuration object. More...
 

Macros

#define BRUSHLESS27_REG_INPUT_PORT   0x00
 Brushless 27 description register.
 
#define BRUSHLESS27_REG_OUTPUT_PORT   0x01
 
#define BRUSHLESS27_REG_POLARITY_INV   0x02
 
#define BRUSHLESS27_REG_CONFIG   0x03
 
#define BRUSHLESS27_TR_COM_STATE_COAST   0x00
 Brushless 27 description setting.
 
#define BRUSHLESS27_TR_COM_STATE_1   0x01
 
#define BRUSHLESS27_TR_COM_STATE_2   0x02
 
#define BRUSHLESS27_TR_COM_STATE_3   0x03
 
#define BRUSHLESS27_TR_COM_STATE_4   0x04
 
#define BRUSHLESS27_TR_COM_STATE_5   0x05
 
#define BRUSHLESS27_TR_COM_STATE_6   0x06
 
#define BRUSHLESS27_TR_COM_STATE_BRAKE   0x07
 
#define BRUSHLESS27_NONE_PIN   0x00
 Brushless 27 pin mask.
 
#define BRUSHLESS27_UH_PIN   0x01
 
#define BRUSHLESS27_VH_PIN   0x02
 
#define BRUSHLESS27_WH_PIN   0x04
 
#define BRUSHLESS27_VL_PIN   0x10
 
#define BRUSHLESS27_WL_PIN   0x20
 
#define BRUSHLESS27_UL_PIN   0x40
 
#define BRUSHLESS27_FLT_PIN   0x80
 
#define BRUSHLESS27_ALL_OUTPUT_PIN   0x77
 
#define BRUSHLESS27_ALL_PIN   0xF7
 
#define BRUSHLESS27_MODE_ENX_INX   0x01
 Brushless 27 mode setting.
 
#define BRUSHLESS27_MODE_INXL_INXH   0x00
 
#define BRUSHLESS27_DIR_CW   0x01
 Brushless 27 direction setting.
 
#define BRUSHLESS27_DIR_CCW   0x00
 
#define BRUSHLESS27_PIN_STATE_LOW   0x00
 Brushless 27 pin logic level setting.
 
#define BRUSHLESS27_PIN_STATE_HIGH   0x01
 
#define BRUSHLESS27_FLT_PIN_INACTIVE   0x01
 Brushless 27 FLT pin state setting.
 
#define BRUSHLESS27_FLT_PIN_ACTIVE   0x00
 
#define BRUSHLESS27_SPEED_MIN   0
 Brushless 27 driving speed and time settings.
 
#define BRUSHLESS27_SPEED_MAX   100
 
#define BRUSHLESS27_NUM_PIN_TOGGLE   8
 
#define BRUSHLESS27_ROUND_TO_NEAREAST_INT   0.5
 
#define BRUSHLESS27_COM_SEQ_DURATION_FOR_SPEED_MAX   21.611
 Brushless 27 commutation sequance duration settings.
 
#define BRUSHLESS27_COM_SEQ_DURATION_SPEED_STEP   ( 22.044 - BRUSHLESS27_COM_SEQ_DURATION_FOR_SPEED_MAX )
 
#define BRUSHLESS27_DEVICE_ADDRESS_A1A0_00   0x70
 Brushless 27 device address setting.
 
#define BRUSHLESS27_DEVICE_ADDRESS_A1A0_01   0x71
 
#define BRUSHLESS27_DEVICE_ADDRESS_A1A0_10   0x72
 
#define BRUSHLESS27_DEVICE_ADDRESS_A1A0_11   0x73
 
#define BRUSHLESS27_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  brushless27_return_value_t { BRUSHLESS27_OK = 0 , BRUSHLESS27_ERROR = -1 }
 Brushless 27 Click return value data. More...
 

Functions

void brushless27_cfg_setup (brushless27_cfg_t *cfg)
 Brushless 27 configuration object setup function.
 
err_t brushless27_init (brushless27_t *ctx, brushless27_cfg_t *cfg)
 Brushless 27 initialization function.
 
err_t brushless27_default_cfg (brushless27_t *ctx)
 Brushless 27 default configuration function.
 
err_t brushless27_generic_write (brushless27_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Brushless 27 I2C writing function.
 
err_t brushless27_generic_read (brushless27_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Brushless 27 I2C reading function.
 
uint8_t brushless27_get_sen_pin (brushless27_t *ctx)
 Brushless 27 get Sense pin function.
 
uint8_t brushless27_get_int_pin (brushless27_t *ctx)
 Brushless 27 get Interrupt pin function.
 
void brushless27_reset_port_exp (brushless27_t *ctx)
 Brushless 27 reset port expander function.
 
err_t brushless27_get_flt_pin (brushless27_t *ctx)
 Brushless 27 get Fault pin function.
 
err_t brushless27_write_reg (brushless27_t *ctx, uint8_t reg, uint8_t data_in)
 Brushless 27 write register function.
 
err_t brushless27_read_reg (brushless27_t *ctx, uint8_t reg, uint8_t *data_out)
 Brushless 27 read register function.
 
err_t brushless27_set_pins (brushless27_t *ctx, uint8_t set_mask, uint8_t clr_mask)
 Brushless 27 set pins function.
 
err_t brushless27_set_trap_com_state (brushless27_t *ctx, uint8_t state)
 Brushless 27 set trapezoidal com state function.
 
err_t brushless27_toggle_pin (brushless27_t *ctx, uint8_t pin_mask, uint8_t speed)
 Brushless 27 toggle pin function.
 
err_t brushless27_perform_com_seq (brushless27_t *ctx, uint8_t dir, uint8_t speed)
 Brushless 27 perform com sequence function.
 
err_t brushless27_drive_motor (brushless27_t *ctx, uint8_t dir, uint8_t speed, uint32_t time_ms)
 Brushless 27 drive motor function.
 

Detailed Description

This file contains API for Brushless 27 Click Driver.

Enumeration Type Documentation

◆ brushless27_return_value_t

Brushless 27 Click return value data.

Predefined enum values for driver return values.

Enumerator
BRUSHLESS27_OK 
BRUSHLESS27_ERROR