fan9 2.1.0.0
Data Structures | Macros | Enumerations | Functions
fan9.h File Reference

This file contains API for Fan 9 Click Driver. More...

#include "mikrosdk_version.h"
#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  fan9_t
 Fan 9 Click context object. More...
 
struct  fan9_cfg_t
 Fan 9 Click configuration object. More...
 

Macros

#define FAN9_REG_EEPROM_ADDR_8   0x08
 Fan 9 description register. More...
 
#define FAN9_REG_EEPROM_ADDR_9   0x09
 
#define FAN9_REG_EEPROM_ADDR_10   0x0A
 
#define FAN9_REG_EEPROM_ADDR_11   0x0B
 
#define FAN9_REG_EEPROM_ADDR_12   0x0C
 
#define FAN9_REG_EEPROM_ADDR_13   0x0D
 
#define FAN9_REG_EEPROM_ADDR_14   0x0E
 
#define FAN9_REG_EEPROM_ADDR_15   0x0F
 
#define FAN9_REG_EEPROM_ADDR_16   0x10
 
#define FAN9_REG_EEPROM_ADDR_17   0x11
 
#define FAN9_REG_EEPROM_ADDR_18   0x12
 
#define FAN9_REG_EEPROM_ADDR_19   0x13
 
#define FAN9_REG_EEPROM_ADDR_20   0x14
 
#define FAN9_REG_EEPROM_ADDR_21   0x15
 
#define FAN9_REG_EEPROM_ADDR_22   0x16
 
#define FAN9_REG_EEPROM_ADDR_23   0x17
 
#define FAN9_REG_EEPROM_ADDR_24   0x18
 
#define FAN9_REG_EEPROM_ADDR_25   0x19
 
#define FAN9_REG_EEPROM_ADDR_26   0x1A
 
#define FAN9_REG_EEPROM_ADDR_27   0x1B
 
#define FAN9_REG_EEPROM_ADDR_28   0x1C
 
#define FAN9_REG_EEPROM_ADDR_29   0x1D
 
#define FAN9_REG_EEPROM_ADDR_30   0x1E
 
#define FAN9_REG_PWM_VAL   0x65
 
#define FAN9_SPEED_CTRL_OPEN_LOOP   0x0000
 Fan 9 description setting. More...
 
#define FAN9_SPEED_CTRL_CLOASED   0x0001
 
#define FAN9_PHA_MODE_AUTO   0x0000
 
#define FAN9_PHA_MODE_LINEAR_PHASE   0x0002
 
#define FAN9_RD_ENABLED   0x0000
 
#define FAN9_RD_DISABLED   0x0004
 
#define FAN9_SPEED_CONTROL_PWM   0x0000
 
#define FAN9_SPEED_CONTROL_ANALOG   0x0008
 
#define FAN9_POLE_PAIR_1   0x0000
 
#define FAN9_POLE_PAIR_2   0x0010
 
#define FAN9_POLE_PAIR_3   0x0020
 
#define FAN9_POLE_PAIR_4   0x0030
 
#define FAN9_POLE_PAIR_5   0x0040
 
#define FAN9_POLE_PAIR_6   0x0050
 
#define FAN9_POLE_PAIR_7   0x0060
 
#define FAN9_NOCOAST   0x0080
 
#define FAN9_COAST   0x0000
 
#define FAN9_ALIGNMODE_ALIGN   0x0000
 
#define FAN9_ALIGNMODE_ONE_CYCLE   0x0100
 
#define FAN9_QCKSTART_DISABLED   0x0000
 
#define FAN9_QCKSTART_ENABLED   0x0200
 
#define FAN9_OVPOPT_DISABLED   0x0000
 
#define FAN9_OVPOPT_LOCK_DETECT   0x0400
 
#define FAN9_FGSTRT_FG_DISABLED   0x0000
 
#define FAN9_FGSTRT_FG_ENABLED   0x0800
 
#define FAN9_BEMFHYS_LEVEL_0   0x0000
 
#define FAN9_BEMFHYS_LEVEL_1   0x1000
 
#define FAN9_BEMFHYS_LEVEL_2   0x2000
 
#define FAN9_BEMFHYS_LEVEL_3   0x3000
 
#define FAN9_SOWAUTO_VALUE_0   0x0000
 
#define FAN9_SOWAUTO_VALUE_1   0x4000
 
#define FAN9_OCPOPT_RST_AFTER_TLOCK   0x0000
 
#define FAN9_OCPOPT_RST_AFTER_PWM_ONOFF   0x8000
 
#define FAN9_STRTDMD_VALUE   0x0033
 Fan 9 Start DMD values setting. More...
 
#define FAN9_DMDPOST_VALUE   0xCA00
 
#define FAN9_PIN_STATE_LOW   0x00
 Fan 9 pin state setting. More...
 
#define FAN9_PIN_STATE_HIGH   0x01
 
#define FAN9_DIRECTION_CW   0x00
 Fan 9 direction setting. More...
 
#define FAN9_DIRECTION_CCW   0x01
 
#define FAN9_BRAKE_OFF   0x00
 Fan 9 brake states setting. More...
 
#define FAN9_BRAKE_ON   0x01
 
#define FAN9_PWM_CALCULATION_CONS   511.0f
 Fan 9 pwm calculation setting. More...
 
#define FAN9_PWM_CALCULATION_MUL   100
 
#define FAN9_DEVICE_ADDRESS   0x55
 Fan 9 device address setting. More...
 
#define FAN9_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

Enumerations

enum  fan9_return_value_t { FAN9_OK = 0 , FAN9_ERROR = -1 }
 Fan 9 Click return value data. More...
 

Functions

void fan9_cfg_setup (fan9_cfg_t *cfg)
 Fan 9 configuration object setup function. More...
 
err_t fan9_init (fan9_t *ctx, fan9_cfg_t *cfg)
 Fan 9 initialization function. More...
 
err_t fan9_default_cfg (fan9_t *ctx)
 Fan 9 default configuration function. More...
 
err_t fan9_generic_write (fan9_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Fan 9 I2C writing function. More...
 
err_t fan9_generic_read (fan9_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Fan 9 I2C reading function. More...
 
uint8_t fan9_get_rd_pin (fan9_t *ctx)
 Fan 9 get RD pin state function. More...
 
uint8_t fan9_get_flt_pin (fan9_t *ctx)
 Fan 9 get FLT pin state function. More...
 
void fan9_set_direcrion (fan9_t *ctx, uint8_t dir)
 Fan 9 set direction function. More...
 
void fan9_set_brake (fan9_t *ctx, uint8_t brake_state)
 Fan 9 set brake state function. More...
 
err_t fan9_write_reg (fan9_t *ctx, uint8_t reg, uint16_t data_in)
 Fan 9 register writing function. More...
 
err_t fan9_read_reg (fan9_t *ctx, uint8_t reg, uint16_t *data_out)
 Fan 9 register reading function. More...
 
err_t fan9_set_pwm (fan9_t *ctx, uint8_t pwm_val)
 Fan 9 set PWM value function. More...
 
err_t fan9_get_pwm (fan9_t *ctx, uint8_t *pwm_val)
 Fan 9 get PWM value function. More...
 

Detailed Description

This file contains API for Fan 9 Click Driver.

Enumeration Type Documentation

◆ fan9_return_value_t

Fan 9 Click return value data.

Predefined enum values for driver return values.

Enumerator
FAN9_OK 
FAN9_ERROR