fan2 2.0.0.0
|
Functions | |
void | fan2_cfg_setup (fan2_cfg_t *cfg) |
Configuration Object Initialization function. | |
fan2_err_t | fan2_init (fan2_t *ctx, fan2_cfg_t *cfg) |
Click Initialization function. | |
void | fan2_default_cfg (fan2_t *ctx) |
Click Default Configuration function. | |
fan2_err_t | fan2_generic_write_byte (fan2_t *ctx, uint8_t reg_addr, uint8_t data_in) |
Generic Byte Write function. | |
fan2_err_t | fan2_generic_read_byte (fan2_t *ctx, uint8_t reg_addr, uint8_t *data_out) |
Generic Byte Read function. | |
fan2_err_t | fan2_generic_write_word (fan2_t *ctx, uint8_t reg_addr, uint16_t data_in) |
Generic Word Write function. | |
fan2_err_t | fan2_generic_read_word (fan2_t *ctx, uint8_t reg_addr, uint16_t *data_out) |
Generic Word Read function. | |
fan2_err_t | fan2_read_temp (fan2_t *ctx, uint8_t temp_addr, float *temp_cels) |
Temperature Read function. | |
fan2_err_t | fan2_write_temp (fan2_t *ctx, uint8_t temp_addr, float temp_cels) |
Temperature Write function. | |
fan2_err_t | fan2_read_tacho (fan2_t *ctx, uint8_t tacho_addr, uint16_t *tacho_rpm) |
Tachometer Read function. | |
void | fan2_write_tacho_threshold (fan2_t *ctx, uint32_t tacho_rpm) |
Tachometer Threshold Write function. | |
fan2_err_t | fan2_direct_speed_control (fan2_t *ctx, float speed_per) |
Direct Fan Speed Control function. | |
float | fan2_read_current_speed (fan2_t *ctx) |
Current Fan Speed Read function. | |
uint8_t | fan2_status (fan2_t *ctx, uint8_t flag_mask) |
Status Check function. | |
fan2_err_t | fan2_write_lut (fan2_t *ctx, uint8_t lut_addr, uint8_t *lut_data, uint8_t n_data) |
Lookup Table Write function. | |
void | fan2_sw_reset (fan2_t *ctx) |
Software Reset function. | |
uint8_t | fan2_get_alr_pin (fan2_t *ctx) |
Alert Pin Check function. | |
uint8_t | fan2_get_shd_pin (fan2_t *ctx) |
Shutdown Pin Check function. | |
uint8_t | fan2_get_ff_pin (fan2_t *ctx) |
Fan-Failure Pin Check function. | |
uint8_t | fan2_get_int_pin (fan2_t *ctx) |
Fault Pin Check function. | |
void fan2_cfg_setup | ( | fan2_cfg_t * | cfg | ) |
Configuration Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to initial state.
void fan2_default_cfg | ( | fan2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes a default configuration for Fan 2 click.
fan2_err_t fan2_direct_speed_control | ( | fan2_t * | ctx, |
float | speed_per ) |
Direct Fan Speed Control function.
ctx | Click object. |
speed_per | Desired fan speed in percents [from 0 to 100]. |
@description This function allows user to control fan speed directly by changing the PWM duty cycle.
fan2_err_t fan2_generic_read_byte | ( | fan2_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t * | data_out ) |
Generic Byte Read function.
ctx | Click object. |
reg_addr | Register address. |
data_out | Memory where read data be stored. |
@description This function reads one byte data from the desired register.
fan2_err_t fan2_generic_read_word | ( | fan2_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t * | data_out ) |
Generic Word Read function.
ctx | Click object. |
reg_addr | Register address. |
data_out | Memory where read data be stored. |
@description This function reads 16-bit data from the desired register.
fan2_err_t fan2_generic_write_byte | ( | fan2_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t | data_in ) |
Generic Byte Write function.
ctx | Click object. |
reg_addr | Register address. |
data_in | Data to be written. |
@description This function writes one byte data to the desired register.
fan2_err_t fan2_generic_write_word | ( | fan2_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t | data_in ) |
Generic Word Write function.
ctx | Click object. |
reg_addr | Register address. |
data_in | Data to be written. |
@description This function writes 16-bit data to the desired register.
uint8_t fan2_get_alr_pin | ( | fan2_t * | ctx | ) |
Alert Pin Check function.
ctx | Click object. |
@description This function returns the ALR pin state.
uint8_t fan2_get_ff_pin | ( | fan2_t * | ctx | ) |
Fan-Failure Pin Check function.
ctx | Click object. |
@description This function returns the FF pin state.
uint8_t fan2_get_int_pin | ( | fan2_t * | ctx | ) |
Fault Pin Check function.
ctx | Click object. |
@description This function returns the INT (FAULT) pin state.
uint8_t fan2_get_shd_pin | ( | fan2_t * | ctx | ) |
Shutdown Pin Check function.
ctx | Click object. |
@description This function returns the SHD pin state.
fan2_err_t fan2_init | ( | fan2_t * | ctx, |
fan2_cfg_t * | cfg ) |
Click Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
float fan2_read_current_speed | ( | fan2_t * | ctx | ) |
Current Fan Speed Read function.
ctx | Click object. |
@description This function reads the current fan speed and converts this data to percents.
fan2_err_t fan2_read_tacho | ( | fan2_t * | ctx, |
uint8_t | tacho_addr, | ||
uint16_t * | tacho_rpm ) |
Tachometer Read function.
ctx | Click object. |
tacho_addr | Address of any tachometer register. |
tacho_rpm | Memory where tachometer data be stored. |
@description This function reads the tachometer data from the selected tachometer register and converts this data to rpm [rotation per minute].
fan2_err_t fan2_read_temp | ( | fan2_t * | ctx, |
uint8_t | temp_addr, | ||
float * | temp_cels ) |
Temperature Read function.
ctx | Click object. |
temp_addr | Address of any temperature register. |
temp_cels | Memory where temperature data be stored. |
@description This function reads the temperature data from the selected temperature register and converts this data to Celsius degrees.
uint8_t fan2_status | ( | fan2_t * | ctx, |
uint8_t | flag_mask ) |
Status Check function.
ctx | Click object. |
flag_mask | Selects a desired register bits to be checked. |
@description This function checks the selected status flag bits.
void fan2_sw_reset | ( | fan2_t * | ctx | ) |
Software Reset function.
ctx | Click object. |
@description This function executes a software reset and waits until reset operation was done.
fan2_err_t fan2_write_lut | ( | fan2_t * | ctx, |
uint8_t | lut_addr, | ||
uint8_t * | lut_data, | ||
uint8_t | n_data ) |
Lookup Table Write function.
ctx | Click object. |
lut_addr | Start LUT address. |
lut_data | Data to be written. |
n_data | Number of bytes to be written [from 1 to 48]. |
@description This function allows user to write the desired data to Lookup table.
void fan2_write_tacho_threshold | ( | fan2_t * | ctx, |
uint32_t | tacho_rpm ) |
Tachometer Threshold Write function.
ctx | Click object. |
tacho_rpm | Desired tachometer data in rpm. |
@description This function writes the tachometer threshold value in rpm.
fan2_err_t fan2_write_temp | ( | fan2_t * | ctx, |
uint8_t | temp_addr, | ||
float | temp_cels ) |
Temperature Write function.
ctx | Click object. |
temp_addr | Address of any temperature register. |
temp_cels | Desired temperature in Celsius degrees [from 125 to -55]. |
@description This function writes the entered temperature [Celsius degrees] to the selected temperature register.