fan9 2.1.0.0
Modules | Functions
Fan 9 Click Driver

API for configuring and manipulating Fan 9 Click driver. More...

Modules

 Fan 9 Registers List
 List of registers of Fan 9 Click driver.
 
 Fan 9 Registers Settings
 Settings for registers of Fan 9 Click driver.
 
 Fan 9 MikroBUS Map
 MikroBUS pin mapping of Fan 9 Click driver.
 

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

API for configuring and manipulating Fan 9 Click driver.

Function Documentation

◆ fan9_cfg_setup()

void fan9_cfg_setup ( fan9_cfg_t cfg)

Fan 9 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See fan9_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ fan9_default_cfg()

err_t fan9_default_cfg ( fan9_t ctx)

Fan 9 default configuration function.

This function executes a default configuration of Fan 9 click board.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ fan9_generic_read()

err_t fan9_generic_read ( fan9_t ctx,
uint8_t  reg,
uint8_t *  data_out,
uint8_t  len 
)

Fan 9 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ fan9_generic_write()

err_t fan9_generic_write ( fan9_t ctx,
uint8_t  reg,
uint8_t *  data_in,
uint8_t  len 
)

Fan 9 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ fan9_get_flt_pin()

uint8_t fan9_get_flt_pin ( fan9_t ctx)

Fan 9 get FLT pin state function.

This function is used to get FLT pin state of Fan 9 click board.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
Returns
FLT pin state.
Note
None.

◆ fan9_get_pwm()

err_t fan9_get_pwm ( fan9_t ctx,
uint8_t *  pwm_val 
)

Fan 9 get PWM value function.

This function is used to get PWM value of Fan 9 click board.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
[out]pwm_val: PWM Value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ fan9_get_rd_pin()

uint8_t fan9_get_rd_pin ( fan9_t ctx)

Fan 9 get RD pin state function.

This function is used to get RD pin state of Fan 9 click board.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
Returns
RD pin state.
Note
None.

◆ fan9_init()

err_t fan9_init ( fan9_t ctx,
fan9_cfg_t cfg 
)

Fan 9 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See fan9_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See fan9_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ fan9_read_reg()

err_t fan9_read_reg ( fan9_t ctx,
uint8_t  reg,
uint16_t *  data_out 
)

Fan 9 register reading function.

This function reads a data bytes from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ fan9_set_brake()

void fan9_set_brake ( fan9_t ctx,
uint8_t  brake_state 
)

Fan 9 set brake state function.

This function is used to set brake state of Fan 9 click board.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
[in]brake_state: Brake state.
Returns
Nothing.
Note
None.

◆ fan9_set_direcrion()

void fan9_set_direcrion ( fan9_t ctx,
uint8_t  dir 
)

Fan 9 set direction function.

This function is used to set direction of Fan 9 click board.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
[in]dir: Selected direction.
Returns
Nothing.
Note
None.

◆ fan9_set_pwm()

err_t fan9_set_pwm ( fan9_t ctx,
uint8_t  pwm_val 
)

Fan 9 set PWM value function.

This function is used to set PWM value of Fan 9 click board.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
[in]pwm_val: PWM Value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ fan9_write_reg()

err_t fan9_write_reg ( fan9_t ctx,
uint8_t  reg,
uint16_t  data_in 
)

Fan 9 register writing function.

This function writes a desired data bytes into the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See fan9_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.