fan5 2.1.0.0
|
API for configuring and manipulating Fan 5 Click driver. More...
Topics | |
Fan 5 Registers List | |
List of registers of Fan 5 Click driver. | |
Fan 5 Registers Settings | |
Settings for registers of Fan 5 Click driver. | |
Fan 5 MikroBUS Map | |
MikroBUS pin mapping of Fan 5 Click driver. | |
Functions | |
void | fan5_cfg_setup (fan5_cfg_t *cfg) |
Fan 5 configuration object setup function. | |
err_t | fan5_init (fan5_t *ctx, fan5_cfg_t *cfg) |
Fan 5 initialization function. | |
err_t | fan5_default_cfg (fan5_t *ctx) |
Fan 5 default configuration function. | |
err_t | fan5_generic_write (fan5_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Fan 5 I2C writing function. | |
err_t | fan5_generic_read (fan5_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Fan 5 I2C reading function. | |
err_t | fan5_reg_write (fan5_t *ctx, uint8_t reg, uint8_t data_in) |
Fan 5 I2C writing into register function. | |
err_t | fan5_reg_read (fan5_t *ctx, uint8_t reg, uint8_t *data_out) |
Fan 5 I2C reading register function. | |
err_t | fan5_get_mfr_id (fan5_t *ctx, uint8_t *mfr_id) |
Fan 5 read manufacturer identification. | |
err_t | fan5_get_rpm1 (fan5_t *ctx, uint16_t *fan1_speed) |
Fan 5 get speed of FAN1. | |
err_t | fan5_get_rpm2 (fan5_t *ctx, uint16_t *fan2_speed) |
Fan 5 get speed of FAN2. | |
err_t | fan5_set_fan_fault1 (fan5_t *ctx, uint16_t fault1_value) |
Fan 5 set FAN1 fault threshold. | |
err_t | fan5_set_fan_fault2 (fan5_t *ctx, uint16_t fault2_value) |
Fan 5 set FAN2 fault threshold. | |
err_t | fan5_set_duty_cycle (fan5_t *ctx, uint8_t duty_cycle) |
Fan 5 set duty cycle. | |
err_t | fan5_get_status_flags (fan5_t *ctx, uint8_t *status_data) |
Fan 5 get status flags. | |
err_t | fan5_get_fault_state (fan5_t *ctx) |
Fan 5 get fault state. | |
err_t | fan5_clear_flt_flag (fan5_t *ctx) |
Fan 5 clear status flags. | |
err_t | fan5_turn_on_fans (fan5_t *ctx) |
Fan 5 turn on fans. | |
err_t | fan5_turn_off_fans (fan5_t *ctx) |
Fan 5 turn off fans. | |
API for configuring and manipulating Fan 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void fan5_cfg_setup | ( | fan5_cfg_t * | cfg | ) |
Fan 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See fan5_cfg_t object definition for detailed explanation. |
err_t fan5_clear_flt_flag | ( | fan5_t * | ctx | ) |
Fan 5 clear status flags.
This function is used to clear the status register flags.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_default_cfg | ( | fan5_t * | ctx | ) |
Fan 5 default configuration function.
This function executes a default configuration of Fan 5 click board.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_generic_read | ( | fan5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Fan 5 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See fan5_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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_generic_write | ( | fan5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Fan 5 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See fan5_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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_get_fault_state | ( | fan5_t * | ctx | ) |
Fan 5 get fault state.
This function is used to read state of the flt pin.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
0
- Success, -2
- Fault triggered. See #err_t definition for detailed explanation. err_t fan5_get_mfr_id | ( | fan5_t * | ctx, |
uint8_t * | mfr_id ) |
Fan 5 read manufacturer identification.
This function reads a manufacturer identification regisret by using I2C serial interface.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[out] | mfr_id | : Read manufacturer identification. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_get_rpm1 | ( | fan5_t * | ctx, |
uint16_t * | fan1_speed ) |
Fan 5 get speed of FAN1.
This function reads the speed of the FAN1 by reading the appropriate register and multiplying that data with a constant.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[out] | fan1_speed | : Speed of FAN1. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_get_rpm2 | ( | fan5_t * | ctx, |
uint16_t * | fan2_speed ) |
Fan 5 get speed of FAN2.
This function reads the speed of the FAN2 by reading the appropriate register and multiplying that data with a constant.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[out] | fan2_speed | : Speed of FAN2. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_get_status_flags | ( | fan5_t * | ctx, |
uint8_t * | status_data ) |
Fan 5 get status flags.
This function is used to read the status register in order to get faults that might occur.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[out] | status_data | : Read data from the status register. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_init | ( | fan5_t * | ctx, |
fan5_cfg_t * | cfg ) |
Fan 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See fan5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_reg_read | ( | fan5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Fan 5 I2C reading register function.
This function reads a byte of data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_reg_write | ( | fan5_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Fan 5 I2C writing into register function.
This function writes a data byte into the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_set_duty_cycle | ( | fan5_t * | ctx, |
uint8_t | duty_cycle ) |
Fan 5 set duty cycle.
This function is used to set duty cycle that is used to control speed of the fans.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[in] | duty_cycle | : Duty cycle value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_set_fan_fault1 | ( | fan5_t * | ctx, |
uint16_t | fault1_value ) |
Fan 5 set FAN1 fault threshold.
This function is used to set FAN1 speed threshold, if the speed drops below this value for more than 2.4 seconds, F1F in the Status Register will be set.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[in] | fault1_value | : Low speed threshold of FAN1. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_set_fan_fault2 | ( | fan5_t * | ctx, |
uint16_t | fault2_value ) |
Fan 5 set FAN2 fault threshold.
This function is used to set FAN2 speed threshold, if the speed drops below this value for more than 2.4 seconds, F1F in the Status Register will be set.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
[in] | fault2_value | : Low speed threshold of FAN2. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_turn_off_fans | ( | fan5_t * | ctx | ) |
Fan 5 turn off fans.
This function is used to turn off FAN1 and FAN2 outputs.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t fan5_turn_on_fans | ( | fan5_t * | ctx | ) |
Fan 5 turn on fans.
This function is used to turn on FAN1 and FAN2 outputs.
[in] | ctx | : Click context object. See fan5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.