fan 2.0.0.0
|
Functions | |
void | fan_cfg_setup (fan_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | fan_default_cfg (fan_t *ctx) |
Click Default Configuration function. | |
err_t | fan_init (fan_t *ctx, fan_cfg_t *cfg) |
Initialization function. | |
err_t | fan_generic_write (fan_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Generic write function. | |
err_t | fan_generic_read (fan_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Generic read function. | |
err_t | fan_write_byte (fan_t *ctx, uint8_t reg, uint8_t data_in) |
Write byte function. | |
err_t | fan_read_byte (fan_t *ctx, uint8_t reg, uint8_t *data_out) |
Read byte function. | |
err_t | fan_lock_registers (fan_t *ctx, uint8_t lock) |
Fan lock registers function. | |
err_t | fan_device_info (fan_t *ctx, uint8_t *info) |
Get device info function. | |
err_t | fan_set_valid_tach (fan_t *ctx, uint16_t tach) |
Set valid tach function. | |
err_t | fan_get_valid_tach (fan_t *ctx, uint16_t *data_out) |
Get valid tach function. | |
err_t | fan_get_driveband_fail (fan_t *ctx, uint16_t *data_out) |
Get drive band fail function. | |
err_t | fan_set_target_tach (fan_t *ctx, uint16_t tach) |
Set target tach function. | |
err_t | fan_get_tach (fan_t *ctx, uint16_t *data_out) |
Get tach function. | |
err_t | fan_enable_fsc (fan_t *ctx, uint8_t fsc) |
Enable fan control algorithm function. | |
err_t | fan_set_range (fan_t *ctx, uint8_t range) |
Set number of edges that needs to be detected function. | |
err_t | fan_set_edges (fan_t *ctx, uint8_t edges) |
Set number of edges on fan function. | |
err_t | fan_set_update (fan_t *ctx, uint8_t update) |
Update time function. | |
err_t | fan_enable_ramp (fan_t *ctx, uint8_t ramp_control) |
Ramp up mode function. | |
err_t | fan_enable_glitch (fan_t *ctx, uint8_t glitch) |
Glitch enable function. | |
err_t | fan_set_derivative (fan_t *ctx, uint8_t derivative) |
Set derivative function. | |
err_t | fan_set_error_range (fan_t *ctx, uint8_t error) |
Set error range function. | |
err_t | fan_set_gaind (fan_t *ctx, uint8_t gain) |
Set gain D function. | |
err_t | fan_set_drivefail (fan_t *ctx, uint8_t count) |
Set drive fail counter function. | |
err_t | fan_enable_no_kick (fan_t *ctx, uint8_t no_kick) |
No kick enable function. | |
err_t | fan_set_spin_level (fan_t *ctx, uint8_t spin) |
Set spin level function. | |
err_t | fan_set_spin_time (fan_t *ctx, uint8_t time) |
Set spin time function. | |
err_t | fan_set_max_step (fan_t *ctx, uint8_t step) |
Set maximum step function. | |
err_t | fan_set_min_drive (fan_t *ctx, double min_drive) |
Set minimum drive function. | |
void | fan_update_multiplier (fan_t *ctx) |
Update multiplier function. | |
void | fan_set_clock (fan_t *ctx, double freq) |
Set external clock speed function. | |
err_t | fan_device_cfg (fan_t *ctx, uint8_t cfg) |
Fan configuration function. | |
err_t | fan_get_status (fan_t *ctx, uint8_t *data_out) |
Get fan status function. | |
err_t | fan_get_stall_status (fan_t *ctx, uint8_t *data_out) |
Get fan stall status function. | |
err_t | fan_get_spin_status (fan_t *ctx, uint8_t *data_out) |
Get spin status function. | |
err_t | fan_get_drive_fail (fan_t *ctx, uint8_t *data_out) |
Get fan drive fail status function. | |
err_t | fan_interrupts (fan_t *ctx, uint8_t enable) |
Enable / disable external interrupts function. | |
err_t | fan_pwm_base (fan_t *ctx, uint8_t freq) |
Set PWM base frequency function. | |
err_t | fan_setting (fan_t *ctx, double percentage) |
Fan setting function. | |
uint8_t | fan_read_int_pin (fan_t *ctx) |
Read INT pin function. | |
void fan_cfg_setup | ( | fan_cfg_t * | cfg | ) |
Config Object Initialization function.
[out] | cfg | Click configuration structure. See fan_cfg_t object definition. |
@description This function initializes click configuration structure to initial state.
err_t fan_default_cfg | ( | fan_t * | ctx | ) |
Click Default Configuration function.
[in] | ctx | Click object. See fan_t object definition. |
@description This function executes a default configuration for the FAN click.
err_t fan_device_cfg | ( | fan_t * | ctx, |
uint8_t | cfg ) |
Fan configuration function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | cfg | Target configuration value. |
@description The Configuration Register controls the basic functionality of the EMC2301.
err_t fan_device_info | ( | fan_t * | ctx, |
uint8_t * | info ) |
Get device info function.
[in] | ctx | Click object. See fan_t object definition. |
[out] | info | Output info. |
@description 1 - Product ID, 2 - Manufacturer ID, 3 - Revision number.
err_t fan_enable_fsc | ( | fan_t * | ctx, |
uint8_t | fsc ) |
Enable fan control algorithm function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | fsc | True enable fan control, false manual mode. |
@description This function enable Fan Control Algorithm.
err_t fan_enable_glitch | ( | fan_t * | ctx, |
uint8_t | glitch ) |
Glitch enable function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | glitch | True enable glitch filter. |
@description Disables the low pass glitch filter that removes high frequency noise injected on the TACHx pin.
err_t fan_enable_no_kick | ( | fan_t * | ctx, |
uint8_t | no_kick ) |
No kick enable function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | no_kick | True enable no kick functionality. |
@description Turns ON no kick functionality.
err_t fan_enable_ramp | ( | fan_t * | ctx, |
uint8_t | ramp_control ) |
Ramp up mode function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | tamp_control | True enable ramp rate control. |
@description Enables ramp rate control when the fan driver is operated in the Direct Setting Mode.
err_t fan_generic_read | ( | fan_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Generic read function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | reg | Register address. |
[out] | data_out | Output data buffer. |
[in] | len | Number of bytes to be read. |
@description This function reads the desired number of data bytes starting from the selected register.
err_t fan_generic_write | ( | fan_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Generic write function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | reg | Register address. |
[in] | data_in | Data to be written. |
[in] | len | Number of bytes to be written. |
@description This function writes the desired number of data bytes starting from the selected register.
err_t fan_get_drive_fail | ( | fan_t * | ctx, |
uint8_t * | data_out ) |
Get fan drive fail status function.
[in] | ctx | Click object. See fan_t object definition. |
[out] | data_out | Output status value. |
@description The Fan Drive Fail Status register indicates that the fan driver cannot drive to the programmed speed even at 100% duty cycle.
err_t fan_get_driveband_fail | ( | fan_t * | ctx, |
uint16_t * | data_out ) |
Get drive band fail function.
[in] | ctx | Click object. See fan_t object definition. |
[out] | data_out | Output read value. |
@description The Fan Drive Fail Band Registers store the number of tach counts used by the Fan Drive Fail detection circuitry. This circuitry is activated when the fan drive setting high byte is at FFh. When it is enabled, the actual measured fan speed is compared against the target fan speed. These registers are only used when the FSC is active.
err_t fan_get_spin_status | ( | fan_t * | ctx, |
uint8_t * | data_out ) |
Get spin status function.
[in] | ctx | Click object. See fan_t object definition. |
[out] | data_out | Output status value.
|
@description The Fan Spin Status register indicates that the fan driver has failed to spin-up.
err_t fan_get_stall_status | ( | fan_t * | ctx, |
uint8_t * | data_out ) |
Get fan stall status function.
[in] | ctx | Click object. See fan_t object definition. |
[out] | data_out | Output status value.
|
@description The TACH Target Registers hold the target tachometer value that is maintained by the RPM-based Fan Speed Control Algorithm.
err_t fan_get_status | ( | fan_t * | ctx, |
uint8_t * | data_out ) |
Get fan status function.
[in] | ctx | Click object. See fan_t object definition. |
[out] | data_out | Output status value. |
@description The Fan Status register indicates that the fan driver has stalled or failed or that the Watchdog Timer has expired.
err_t fan_get_tach | ( | fan_t * | ctx, |
uint16_t * | data_out ) |
Get tach function.
[in] | ctx | Click object. See fan_t object definition. |
[out] | data_out | Output tach value. |
@description The TACH Count register stores the current TACH Reading Register value to show the current reading of rotation per minute.
err_t fan_get_valid_tach | ( | fan_t * | ctx, |
uint16_t * | data_out ) |
Get valid tach function.
[in] | ctx | Click object. See fan_t object definition. |
[out] | data_out | Output tach value. |
@description The Valid TACH Count register stores the maximum TACH Reading Register value to indicate that the fan is spinning properly. The value is referenced at the end of the Spin Up Routine to determine if the fan has started operating and decide if the device needs to retry.
Initialization function.
[out] | ctx | Click object. See fan_t object definition. |
[in] | cfg | Click configuration structure. See fan_cfg_t object definition. |
@description This function initializes all necessary pins and peripherals used for this click board.
err_t fan_interrupts | ( | fan_t * | ctx, |
uint8_t | enable ) |
Enable / disable external interrupts function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | enable | True enable external interrupts. |
@description The Fan Interrupt Enable controls the masking for the Fan channel. When a channel is enabled, it will cause the ALERT# pin to be asserted when an error condition is detected.
err_t fan_lock_registers | ( | fan_t * | ctx, |
uint8_t | lock ) |
Fan lock registers function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | lock | Lock command. |
@description The Lock Column describes the locking mechanism, if any, used for individual registers. All SWL registers are Software Locked and therefore made read-only when the LOCK bit is set..
err_t fan_pwm_base | ( | fan_t * | ctx, |
uint8_t | freq ) |
Set PWM base frequency function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | freq | Target frequency value. |
@description The PWM Base Frequency register determines the base frequency that is used with the PWM Divide register to determine the final PWM frequency.
err_t fan_read_byte | ( | fan_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Read byte function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | reg | Register address. |
[out] | data_out | Output data. |
@description This function reads one byte of data from the selected register.
uint8_t fan_read_int_pin | ( | fan_t * | ctx | ) |
Read INT pin function.
[in] | ctx | Click object. See fan_t object definition. |
@description Reads the current digital level of INT pin.
void fan_set_clock | ( | fan_t * | ctx, |
double | freq ) |
Set external clock speed function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | freq | Target frequency. |
@description Specifies external clock speed if different from standard.
err_t fan_set_derivative | ( | fan_t * | ctx, |
uint8_t | derivative ) |
Set derivative function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | derivative | Basic derivative / Step Derivative / Both. |
@description Control some of the advanced options that affect the derivative portion of the RPM-based Fan Speed Control Algorithm.
err_t fan_set_drivefail | ( | fan_t * | ctx, |
uint8_t | count ) |
Set drive fail counter function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | count | Disabled / 16 / 32 / 64. |
@description Determines how many update cycles are used for the Drive Fail detection function.
err_t fan_set_edges | ( | fan_t * | ctx, |
uint8_t | edges ) |
Set number of edges on fan function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | edges | Target value. |
@description Determines the minimum number of edges that must be detected on the TACHx signal to determine a single rotation. A typical fan measured 5 edges (for a 2-pole fan). For more accurate tachometer measurement, the minimum number of edges measured may be increased.
err_t fan_set_error_range | ( | fan_t * | ctx, |
uint8_t | error ) |
Set error range function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | error | Target error value. |
@description Control some of the advanced options that affect the error window. When the measured fan speed is within the programmed error window around the target speed, then the fan drive setting is not updated.
err_t fan_set_gaind | ( | fan_t * | ctx, |
uint8_t | gain ) |
Set gain D function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | gain | Target gain value. |
@description Control some of the advanced options that affect the derivative portion of the RPM-based Fan Speed Control Algorithm. The Gain register stores the gain terms used by the proportional and integral portions of the RPM-based Fan Speed Control Algorithm. These gain terms are used as the KD, KI, and KP gain terms in a classic PID control solution.
err_t fan_set_max_step | ( | fan_t * | ctx, |
uint8_t | step ) |
Set maximum step function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | step | Maximum step value. |
@description The Fan Max Step register, along with the Update Time, controls the ramp rate of the fan driver response calculated by the RPM-based Fan Speed Control Algorithm. The value of the register represents the maximum step size the fan driver will take between update times.
err_t fan_set_min_drive | ( | fan_t * | ctx, |
double | min_drive ) |
Set minimum drive function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | min_drive | Minimum drive value. |
@description The Fan Minimum Drive register stores the minimum drive setting for the RPM-based Fan Speed Control Algorithm. The RPM-based Fan Speed Control Algorithm will not drive the fan at a level lower than the minimum drive unless the target Fan Speed is set at FFh.
err_t fan_set_range | ( | fan_t * | ctx, |
uint8_t | range ) |
Set number of edges that needs to be detected function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | range | Target value. |
@description Adjusts the range of reported and programmed tachometer reading values. The RANGE bits determine the weighting of all TACH values.
err_t fan_set_spin_level | ( | fan_t * | ctx, |
uint8_t | spin ) |
Set spin level function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | spin | Target spin level. |
@description Determines if the Spin Up Routine will drive the fan to 100% duty cycle for 1/4 of the programmed spin up time before driving it at the programmed level.
err_t fan_set_spin_time | ( | fan_t * | ctx, |
uint8_t | time ) |
Set spin time function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | time | Target time value. |
@description The Fan Spin Up Configuration register controls the settings of Spin Up Routine.
err_t fan_set_target_tach | ( | fan_t * | ctx, |
uint16_t | tach ) |
Set target tach function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | tach | Target tach value. |
@description The TACH Target Registers hold the target tachometer value that is maintained by the RPM-based Fan Speed Control Algorithm.
err_t fan_set_update | ( | fan_t * | ctx, |
uint8_t | update ) |
Update time function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | update | Time to be updated. |
@description determines the base time between fan driver updates. The Update Time, along with the Fan Step Register, is used to control the ramp rate of the drive response to provide a cleaner transition of the actual fan operation as the desired fan speed changes.
err_t fan_set_valid_tach | ( | fan_t * | ctx, |
uint16_t | tach ) |
Set valid tach function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | tach | Tach value. |
@description The Valid TACH Count register stores the maximum TACH Reading Register value to indicate that the fan is spinning properly. The value is referenced at the end of the Spin Up Routine to determine if the fan has started operating and decide if the device needs to retry.
err_t fan_setting | ( | fan_t * | ctx, |
double | percentage ) |
Fan setting function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | percentage | Percentage of duty. |
@description The Fan Setting register always displays the current setting of the fan driver. Reading from the register will report the current fan speed setting of the fan driver regardless of the operating mode. Therefore it is possible that reading from this register will not report data that was previously written into this register.
void fan_update_multiplier | ( | fan_t * | ctx | ) |
Update multiplier function.
[in] | ctx | Click object. See fan_t object definition. |
@description Performs update of multiplier.
err_t fan_write_byte | ( | fan_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Write byte function.
[in] | ctx | Click object. See fan_t object definition. |
[in] | reg | Register address. |
[in] | data_in | Data byte to be written. |
@description This function writes one byte of data to the selected register.