fan8 2.0.0.0
|
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. | |
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.
void fan8_cfg_setup | ( | fan8_cfg_t * | cfg | ) |
FAN 8 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See fan8_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t fan8_check_fan_fail_indicator | ( | fan8_t * | ctx | ) |
FAN 8 check fan fail indicator function.
This function returns the FF pin state.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
uint8_t fan8_check_fault_indicator | ( | fan8_t * | ctx | ) |
FAN 8 check fault indicator function.
This function returns the FLT pin state.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
uint8_t fan8_check_overtemperature_indicator | ( | fan8_t * | ctx | ) |
FAN 8 check overtemperature indicator function.
This function returns the OT pin state.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
err_t fan8_default_cfg | ( | fan8_t * | ctx | ) |
FAN 8 default configuration function.
This function executes a default configuration of FAN 8 click board.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
[in] | fan_ch | : Fan channel.
|
[in] | num_pulses | : Number of fan pulses per revolution. |
[out] | fan_rpm | : Fan RPM. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Read data. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
[in] | temp_ch | : Temperature channel.
|
[in] | num_pulses | : Number of fan pulses per revolution. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error.err_t fan8_reset | ( | fan8_t * | ctx | ) |
FAN 8 reset function.
This function performs the device reset.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
[in] | fan_ch | : Fan channel.
|
[in] | duty_cycle | : Duty cycle [0-240]. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See fan8_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.