fan8 2.0.0.0
FAN 8 Click Driver

API for configuring and manipulating FAN 8 Click driver. More...

Topics

 FAN 8 Registers List
 List of registers of FAN 8 Click driver.
 
 FAN 8 Registers Settings
 Settings for registers of FAN 8 Click driver.
 
 FAN 8 MikroBUS Map
 MikroBUS pin mapping of FAN 8 Click driver.
 

Functions

void fan8_cfg_setup (fan8_cfg_t *cfg)
 FAN 8 configuration object setup function.
 
err_t fan8_init (fan8_t *ctx, fan8_cfg_t *cfg)
 FAN 8 initialization function.
 
err_t fan8_default_cfg (fan8_t *ctx)
 FAN 8 default configuration function.
 
err_t fan8_write_register (fan8_t *ctx, uint8_t reg, uint8_t data_in)
 FAN 8 write register function.
 
err_t fan8_read_register (fan8_t *ctx, uint8_t reg, uint8_t *data_out)
 FAN 8 read register function.
 
uint8_t fan8_check_overtemperature_indicator (fan8_t *ctx)
 FAN 8 check overtemperature indicator function.
 
uint8_t fan8_check_fan_fail_indicator (fan8_t *ctx)
 FAN 8 check fan fail indicator function.
 
uint8_t fan8_check_fault_indicator (fan8_t *ctx)
 FAN 8 check fault indicator function.
 
err_t fan8_check_device_id (fan8_t *ctx)
 FAN 8 check device ID function.
 
err_t fan8_set_duty_cycle (fan8_t *ctx, uint8_t fan_ch, uint8_t duty_cycle)
 FAN 8 set duty cycle function.
 
err_t fan8_measure_rpm (fan8_t *ctx, uint8_t fan_ch, uint8_t num_pulses, uint16_t *fan_rpm)
 FAN 8 measure fan RPM function.
 
err_t fan8_read_temperature (fan8_t *ctx, uint8_t temp_ch, float *temperature)
 FAN 8 read temperature function.
 
err_t fan8_reset (fan8_t *ctx)
 FAN 8 reset function.
 

Detailed Description

API for configuring and manipulating FAN 8 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ fan8_cfg_setup()

void fan8_cfg_setup ( fan8_cfg_t * cfg)

FAN 8 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ fan8_check_device_id()

err_t fan8_check_device_id ( fan8_t * ctx)

FAN 8 check device ID function.

This function checks the communication by reading and verifying the device ID.

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

◆ fan8_check_fan_fail_indicator()

uint8_t fan8_check_fan_fail_indicator ( fan8_t * ctx)

FAN 8 check fan fail indicator function.

This function returns the FF pin state.

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

◆ fan8_check_fault_indicator()

uint8_t fan8_check_fault_indicator ( fan8_t * ctx)

FAN 8 check fault indicator function.

This function returns the FLT pin state.

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

◆ fan8_check_overtemperature_indicator()

uint8_t fan8_check_overtemperature_indicator ( fan8_t * ctx)

FAN 8 check overtemperature indicator function.

This function returns the OT pin state.

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

◆ fan8_default_cfg()

err_t fan8_default_cfg ( fan8_t * ctx)

FAN 8 default configuration function.

This function executes a default configuration of FAN 8 click board.

Parameters
[in]ctx: Click context object. See fan8_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.

◆ fan8_init()

err_t fan8_init ( fan8_t * ctx,
fan8_cfg_t * cfg )

FAN 8 initialization function.

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

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

◆ fan8_measure_rpm()

err_t fan8_measure_rpm ( fan8_t * ctx,
uint8_t fan_ch,
uint8_t num_pulses,
uint16_t * fan_rpm )

FAN 8 measure fan RPM function.

This function measures the RPM of the selected fan channel.

Parameters
[in]ctx: Click context object. See fan8_t object definition for detailed explanation.
[in]fan_ch: Fan channel.
  • 1 - Channel 1,
  • 2 - Channel 2.
[in]num_pulses: Number of fan pulses per revolution.
[out]fan_rpm: Fan RPM.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The MAX6615 measures the tachometer signal every 67s, therefore the fan RPM value will be updated once per 67s.

◆ fan8_read_register()

err_t fan8_read_register ( fan8_t * ctx,
uint8_t reg,
uint8_t * data_out )

FAN 8 read register function.

This function reads the selected register.

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

◆ fan8_read_temperature()

err_t fan8_read_temperature ( fan8_t * ctx,
uint8_t temp_ch,
float * temperature )

FAN 8 read temperature function.

This function reads the temperature from the thermistor attached to the selected temperature channel.

Parameters
[in]ctx: Click context object. See fan8_t object definition for detailed explanation.
[in]temp_ch: Temperature channel.
  • 1 - Channel 1,
  • 2 - Channel 2.
[in]num_pulses: Number of fan pulses per revolution.
[out]temperature: Temperature in Celsius.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
An NTC 10K3 thermistor is required for proper temperature measurements.

◆ fan8_reset()

err_t fan8_reset ( fan8_t * ctx)

FAN 8 reset function.

This function performs the device reset.

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

◆ fan8_set_duty_cycle()

err_t fan8_set_duty_cycle ( fan8_t * ctx,
uint8_t fan_ch,
uint8_t duty_cycle )

FAN 8 set duty cycle function.

This function sets the duty cycle of the selected fan channel and waits until the duty cycle is set at the PWM output.

Parameters
[in]ctx: Click context object. See fan8_t object definition for detailed explanation.
[in]fan_ch: Fan channel.
  • 1 - Channel 1,
  • 2 - Channel 2.
[in]duty_cycle: Duty cycle [0-240].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ fan8_write_register()

err_t fan8_write_register ( fan8_t * ctx,
uint8_t reg,
uint8_t data_in )

FAN 8 write register function.

This function writes a desired data to the selected register.

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