brushless14 2.0.0.0
brushless14.h File Reference

This file contains API for Brushless 14 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_pwm.h"

Go to the source code of this file.

Data Structures

struct  brushless14_t
 Brushless 14 Click context object. More...
 
struct  brushless14_cfg_t
 Brushless 14 Click configuration object. More...
 

Macros

#define BRUSHLESS14_DAC_REG_CONFIG   0x01
 Brushless 14 description register.
 
#define BRUSHLESS14_DAC_REG_STATUS_TRIGGER   0x02
 
#define BRUSHLESS14_DAC_REG_BRDCAST   0x03
 
#define BRUSHLESS14_DAC_REG_DAC_A_DATA   0x08
 
#define BRUSHLESS14_DAC_REG_DAC_B_DATA   0x09
 
#define BRUSHLESS14_DAC_REG_DAC_C_DATA   0x0A
 
#define BRUSHLESS14_DAC_REG_DAC_D_DATA   0x0B
 
#define BRUSHLESS14_DAC_REG_DAC_E_DATA   0x0C
 
#define BRUSHLESS14_DAC_REG_DAC_F_DATA   0x0D
 
#define BRUSHLESS14_DAC_REG_DAC_G_DATA   0x0E
 
#define BRUSHLESS14_DAC_REG_DAC_H_DATA   0x0F
 
#define BRUSHLESS14_PE_REG_INPUT_PORT   0x00
 
#define BRUSHLESS14_PE_REG_OUTPUT_PORT   0x01
 
#define BRUSHLESS14_PE_REG_POLARITY   0x02
 
#define BRUSHLESS14_PE_REG_CONFIGURATION   0x03
 
#define BRUSHLESS14_DAC_ID   0x0500
 Brushless 14 DAC ID.
 
#define BRUSHLESS14_EXPANDER_SLAVE_ADDR   0x73
 Brushless 14 device address setting.
 
#define BRUSHLESS14_DAC_SLAVE_ADDR   0x48
 
#define BRUSHLESS14_DEF_FREQ   5000
 Brushless 14 default PWM frequency.
 
#define BRUSHLESS14_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  brushless14_return_value_t { BRUSHLESS14_OK = 0 , BRUSHLESS14_ERROR = -1 }
 Brushless 14 Click return value data. More...
 

Functions

void brushless14_cfg_setup (brushless14_cfg_t *cfg)
 Brushless 14 configuration object setup function.
 
err_t brushless14_init (brushless14_t *ctx, brushless14_cfg_t *cfg)
 Brushless 14 initialization function.
 
err_t brushless14_default_cfg (brushless14_t *ctx)
 Brushless 14 default configuration function.
 
err_t brushless14_set_duty_cycle (brushless14_t *ctx, float duty_cycle)
 Brushless 14 sets PWM duty cycle.
 
err_t brushless14_pwm_stop (brushless14_t *ctx)
 Brushless 14 stop PWM module.
 
err_t brushless14_pwm_start (brushless14_t *ctx)
 Brushless 14 start PWM module.
 
err_t brushless14_dac_write (brushless14_t *ctx, uint8_t reg, uint16_t in_data)
 DAC write function.
 
err_t brushless14_dac_read (brushless14_t *ctx, uint8_t reg, uint16_t *out_data)
 DAC reading function.
 
err_t brushless14_set_adj0 (brushless14_t *ctx, uint16_t m_voltage)
 Set Adjusted input 0.
 
err_t brushless14_set_adj1 (brushless14_t *ctx, uint16_t m_voltage)
 Set Adjusted input 1.
 
err_t brushless14_set_adj2 (brushless14_t *ctx, uint16_t m_voltage)
 Set Adjusted input 2.
 
err_t brushless14_set_adj3 (brushless14_t *ctx, uint16_t m_voltage)
 Set Adjusted input 3.
 
err_t brushless14_set_fpwm (brushless14_t *ctx, uint16_t m_voltage)
 Set PWM frequency select input.
 
err_t brushless14_set_la (brushless14_t *ctx, uint16_t m_voltage)
 Set lead angle setting input.
 
err_t brushless14_port_expander_write (brushless14_t *ctx, uint8_t reg, uint8_t in_data)
 Port expander write function.
 
err_t brushless14_port_expander_read (brushless14_t *ctx, uint8_t reg, uint8_t *out_data)
 Port expander reading function.
 
err_t brushless14_set_slop (brushless14_t *ctx, uint8_t state)
 Set soft switching select.
 
err_t brushless14_set_rot (brushless14_t *ctx, uint8_t state)
 Set rotation speed of lead angle switching.
 
err_t brushless14_set_fst (brushless14_t *ctx, uint8_t state)
 Set forced commutation frequency select.
 
err_t brushless14_set_sel_adj (brushless14_t *ctx, uint8_t state)
 Set PWM duty function setting.
 
err_t brushless14_set_lap (brushless14_t *ctx, uint8_t state)
 Set overlapping commutation select.
 
err_t brushless14_get_fg_out (brushless14_t *ctx, uint8_t *state)
 Get rotation speed.
 
err_t brushless14_get_ld_out (brushless14_t *ctx, uint8_t *state)
 Get lock detection signal.
 
uint8_t brushless14_get_int (brushless14_t *ctx)
 Get port expadner interrupt.
 
void brushless14_set_dir (brushless14_t *ctx, uint8_t state)
 Set dirrection pin state.
 

Detailed Description

This file contains API for Brushless 14 Click Driver.

Enumeration Type Documentation

◆ brushless14_return_value_t

Brushless 14 Click return value data.

Predefined enum values for driver return values.

Enumerator
BRUSHLESS14_OK 
BRUSHLESS14_ERROR