fan6  2.0.0.0
fan6.h
Go to the documentation of this file.
1 /*
2  * MikroSDK - MikroE Software Development Kit
3  * Copyright© 2020 MikroElektronika d.o.o.
4  *
5  * Permission is hereby granted, free of charge, to any person
6  * obtaining a copy of this software and associated documentation
7  * files (the "Software"), to deal in the Software without restriction,
8  * including without limitation the rights to use, copy, modify, merge,
9  * publish, distribute, sublicense, and/or sell copies of the Software,
10  * and to permit persons to whom the Software is furnished to do so,
11  * subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22  * OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 
33 // ----------------------------------------------------------------------------
34 
35 #ifndef FAN6_H
36 #define FAN6_H
37 
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
40 #include "drv_i2c_master.h"
41 
42 
43 // -------------------------------------------------------------- PUBLIC MACROS
53 #define FAN6_MAP_MIKROBUS( cfg, mikrobus ) \
54  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
55  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
56  cfg.io1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
57  cfg.sdn = MIKROBUS( mikrobus, MIKROBUS_RST ); \
58  cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
59  cfg.io2 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
60  cfg.alr = MIKROBUS( mikrobus, MIKROBUS_INT );
61 
67 #define FAN6_RETVAL uint8_t
68 
69 #define FAN6_OK 0x00
70 #define FAN6_INIT_ERROR 0xFF
71 
77 #define FAN6_INTERNAL_TEMP_READ_REG 0x00
78 #define FAN6_EXTDIODE1_TEMP_READ_REG 0x02
79 #define FAN6_EXTDIODE2_TEMP_READ_REG 0x04
80 #define FAN6_EXTDIODE3_TEMP_READ_REG 0x06
81 #define FAN6_CRITICAL_TEMP_REG 0x0A
82 #define FAN6_PUSHED_TEMP1_REG 0x0C
83 #define FAN6_PUSHED_TEMP2_REG 0x0D
84 #define FAN6_TRIP_SET_VOLTAGE_REG 0x10
85 #define FAN6_EXTDIODE1_IDEALITY_REG 0x11
86 #define FAN6_EXTDIODE2_IDEALITY_REG 0x12
87 #define FAN6_EXTDIODE1_BETA_CONFIG_REG 0x14
88 #define FAN6_EXTDIODE2_BETA_CONFIG_REG 0x15
89 #define FAN6_EXTDIODE_REC_CONFIG_REG 0x17
90 #define FAN6_EXTDIODE1_TCRIT_LIMIT_REG 0x19
91 #define FAN6_EXTDIODE2_TCRIT_LIMIT_REG 0x1A
92 #define FAN6_EXTDIODE3_TCRIT_LIMIT_REG 0x1B
93 #define FAN6_INTDIODE_TCRIT_LIMIT_REG 0x1D
94 #define FAN6_TCRIT_STATUS_REG 0x1F
95 #define FAN6_CONFIGURATION_REG 0x20
96 #define FAN6_CONFIGURATION2_REG 0x21
97 #define FAN6_INTERRUPT_STATUS_REG 0x23
98 #define FAN6_HIGH_LIMIT_STATUS_REG 0x24
99 #define FAN6_LOW_LIMIT_STATUS_REG 0x25
100 #define FAN6_DIODE_FAULT_REG 0x26
101 #define FAN6_FAN_STATUS_REG 0x27
102 #define FAN6_INTERRUPT_EN_REG 0x28
103 #define FAN6_FAN_INTERRUPT_EN_REG 0x29
104 #define FAN6_PWM_CONFIG_REG 0x2A
105 #define FAN6_PWM_BASE_FREQ_REG 0x2B
106 #define FAN6_EXTDIODE1_HIGHTEMP_LIMIT_REG 0x30
107 #define FAN6_EXTDIODE2_HIGHTEMP_LIMIT_REG 0x31
108 #define FAN6_EXTDIODE3_HIGHTEMP_LIMIT_REG 0x32
109 #define FAN6_INTDIODE_HIGHTEMP_LIMIT_REG 0x34
110 #define FAN6_EXTDIODE1_LOWTEMP_LIMIT_REG 0x38
111 #define FAN6_EXTDIODE2_LOWTEMP_LIMIT_REG 0x39
112 #define FAN6_EXTDIODE3_LOWTEMP_LIMIT_REG 0x3A
113 #define FAN6_INTDIODE_LOWTEMP_LIMIT_REG 0x3C
114 #define FAN6_FAN_SETTING_REG 0x40
115 #define FAN6_PWM_DIVIDE_REG 0x41
116 #define FAN6_FAN_CONFIG1_REG 0x42
117 #define FAN6_FAN_CONFIG2_REG 0x43
118 #define FAN6_GAIN_REG 0x45
119 #define FAN6_FAN_SPINUP_CONFIG_REG 0x46
120 #define FAN6_FAN_STEP_REG 0x47
121 #define FAN6_FAN_MIN_DRIVE_REG 0x48
122 #define FAN6_FAN_VALID_TACH_COUNT_REG 0x49
123 #define FAN6_FAN_DRIVE_FAIL_BAND_REG 0x4A
124 #define FAN6_TACH_TARGET_REG 0x4C
125 #define FAN6_TACH_READING_REG 0x4E
126 #define FAN6_LUT_CONFIG_REG 0x50
127 #define FAN6_LUT_DRIVE1_REG 0x51
128 #define FAN6_LUT_TEMP1_SETTING1_REG 0x52
129 #define FAN6_LUT_TEMP2_SETTING1_REG 0x53
130 #define FAN6_LUT_TEMP3_SETTING1_REG 0x54
131 #define FAN6_LUT_INTTEMP_SETTING1_REG 0x55
132 #define FAN6_LUT_DRIVE2_REG 0x56
133 #define FAN6_LUT_TEMP1_SETTING2_REG 0x57
134 #define FAN6_LUT_TEMP2_SETTING2_REG 0x58
135 #define FAN6_LUT_TEMP3_SETTING2_REG 0x59
136 #define FAN6_LUT_INTTEMP_SETTING2_REG 0x5A
137 #define FAN6_LUT_DRIVE3_REG 0x5B
138 #define FAN6_LUT_TEMP1_SETTING3_REG 0x5C
139 #define FAN6_LUT_TEMP2_SETTING3_REG 0x5D
140 #define FAN6_LUT_TEMP3_SETTING3_REG 0x5E
141 #define FAN6_LUT_INTTEMP_SETTING3_REG 0x5F
142 #define FAN6_LUT_DRIVE4_REG 0x60
143 #define FAN6_LUT_TEMP1_SETTING4_REG 0x61
144 #define FAN6_LUT_TEMP2_SETTING4_REG 0x62
145 #define FAN6_LUT_TEMP3_SETTING4_REG 0x63
146 #define FAN6_LUT_INTTEMP_SETTING4_REG 0x64
147 #define FAN6_LUT_DRIVE5_REG 0x65
148 #define FAN6_LUT_TEMP1_SETTING5_REG 0x66
149 #define FAN6_LUT_TEMP2_SETTING5_REG 0x67
150 #define FAN6_LUT_TEMP3_SETTING5_REG 0x68
151 #define FAN6_LUT_INTTEMP_SETTING5_REG 0x69
152 #define FAN6_LUT_DRIVE6_REG 0x6A
153 #define FAN6_LUT_TEMP1_SETTING6_REG 0x6B
154 #define FAN6_LUT_TEMP2_SETTING6_REG 0x6C
155 #define FAN6_LUT_TEMP3_SETTING6_REG 0x6D
156 #define FAN6_LUT_INTTEMP_SETTING6_REG 0x6E
157 #define FAN6_LUT_DRIVE7_REG 0x6F
158 #define FAN6_LUT_TEMP1_SETTING7_REG 0x70
159 #define FAN6_LUT_TEMP2_SETTING7_REG 0x71
160 #define FAN6_LUT_TEMP3_SETTING7_REG 0x72
161 #define FAN6_LUT_INTTEMP_SETTING7_REG 0x73
162 #define FAN6_LUT_DRIVE8_REG 0x74
163 #define FAN6_LUT_TEMP1_SETTING8_REG 0x75
164 #define FAN6_LUT_TEMP2_SETTING8_REG 0x76
165 #define FAN6_LUT_TEMP3_SETTING8_REG 0x77
166 #define FAN6_LUT_INTTEMP_SETTING8_REG 0x78
167 #define FAN6_GPIO_DIR_REG 0xE1
168 #define FAN6_GPIO_OUTPUT_CONFIG_REG 0xE2
169 #define FAN6_GPIO_INPUT_REG 0xE3
170 #define FAN6_GPIO_OUTPUT_REG 0xE4
171 #define FAN6_GPIO_INTERR_EN_REG 0xE5
172 #define FAN6_GPIO_STATUS_REG 0xE6
173 #define FAN6_SW_LOCK_REG 0xEF
174 #define FAN6_PRODUCT_FEATURES_REG 0xFC
175 #define FAN6_PRODUCT_ID_REG 0xFD
176 #define FAN6_MANUFACTURER_ID_REG 0xFE
177 #define FAN6_REVISION_REG 0xFF
178 
184 #define FAN6_AUTOBETA_DETECTION_DISABLED 0x00
185 #define FAN6_AUTOBETA_DETECTION_ENABLED 0x10
186 #define FAN6_MIN_BETA_80MILI 0x00
187 #define FAN6_MIN_BETA_111MILI 0x01
188 #define FAN6_MIN_BETA_176MILI 0x02
189 #define FAN6_MIN_BETA_290MILI 0x03
190 #define FAN6_MIN_BETA_480MILI 0x04
191 #define FAN6_MIN_BETA_900MILI 0x05
192 #define FAN6_MIN_BETA_2330MILI 0x06
193 #define FAN6_MIN_BETA_DISABLED 0x07
194 
200 #define FAN6_EXTDIODE_REC_DISABLED 0x00
201 #define FAN6_EXTDIODE3_REC_ENABLED 0x04
202 #define FAN6_EXTDIODE2_REC_ENABLED 0x02
203 #define FAN6_EXTDIODE1_REC_ENABLED 0x01
204 
210 #define FAN6_ALERT_PIN_UNMASKED 0x00
211 #define FAN6_ALERT_PIN_MASKED 0x80
212 #define FAN6_EXTDIODE_SYS_SHDN_PIN_NOT_LINKED 0x00
213 #define FAN6_EXTDIODE3_SYS_SHDN_PIN_LINKED 0x08
214 #define FAN6_EXTDIODE2_SYS_SHDN_PIN_LINKED 0x04
215 #define FAN6_EXTDIODE1_SYS_SHDN_PIN_LINKED 0x02
216 #define FAN6_ANTIPARALLEL_DIODE_FUNCT_DISABLED 0x00
217 #define FAN6_ANTIPARALLEL_DIODE_FUNCT_ENABLED 0x01
218 
224 #define FAN6_DYNAMIC_AVERAGING_ENABLED 0x00
225 #define FAN6_DYNAMIC_AVERAGING_DISABLED 0x40
226 #define FAN6_SMBUS_ENABLED 0x00
227 #define FAN6_SMBUS_DISABLED 0x20
228 #define FAN6_DIGITAL_AVERAGING_ENABLED 0x00
229 #define FAN6_DIGITAL_AVERAGING_DISABLED 0x10
230 #define FAN6_CONSECUTIVE_OUTOFLIMIT_NUMBER_1 0x00
231 #define FAN6_CONSECUTIVE_OUTOFLIMIT_NUMBER_2 0x04
232 #define FAN6_CONSECUTIVE_OUTOFLIMIT_NUMBER_3 0x08
233 #define FAN6_CONSECUTIVE_OUTOFLIMIT_NUMBER_4 0x0C
234 #define FAN6_CONVERSION_RATE_1_PERSEC 0x00
235 #define FAN6_CONVERSION_RATE_2_PERSEC 0x01
236 #define FAN6_CONVERSION_RATE_4_PERSEC 0x02
237 #define FAN6_CONVERSION_RATE_CONTINUOUS 0x03
238 
244 #define FAN6_ALL_INTERRUPTS_DISABLED 0x00
245 #define FAN6_EXTDIODE3_INTERRUPT_ENABLED 0x08
246 #define FAN6_EXTDIODE2_INTERRUPT_ENABLED 0x04
247 #define FAN6_EXTDIODE1_INTERRUPT_ENABLED 0x02
248 #define FAN6_INTDIODE_INTERRUPT_ENABLED 0x01
249 
255 #define FAN6_ALL_FAN_INTERRUPTS_DISABLED 0x00
256 #define FAN6_FAN_SPIN_BIT_ENABLED 0x02
257 #define FAN6_FAN_STALL_BIT_ENABLED 0x01
258 
264 #define FAN6_PWM_PIN_OPEN_DRAIN 0x00
265 #define FAN6_PWM_PIN_PUSH_PULL 0x10
266 #define FAN6_NORMAL_POLARITY 0x00
267 #define FAN6_INVERTED_POLARITY 0x01
268 
274 #define FAN6_PWM_BASE_FREQ_26000HZ 0x00
275 #define FAN6_PWM_BASE_FREQ_19531HZ 0x01
276 #define FAN6_PWM_BASE_FREQ_4882HZ 0x02
277 #define FAN6_PWM_BASE_FREQ_2441HZ 0x03
278 
284 #define FAN6_0_PERCENT_SPEED 0x00
285 #define FAN6_25_PERCENTS_SPEED 0x40
286 #define FAN6_50_PERCENTS_SPEED 0x80
287 #define FAN6_75_PERCENTS_SPEED 0xC0
288 #define FAN6_100_PERCENTS_SPEED 0xFF
289 
295 #define FAN6_CONTROL_CIRCUITRY_DISABLED 0x00
296 #define FAN6_CONTROL_CIRCUITRY_ENABLED 0x80
297 #define FAN6_RANGE_MIN_500RPM 0x00
298 #define FAN6_RANGE_MIN_1000RPM 0x20
299 #define FAN6_RANGE_MIN_2000RPM 0x40
300 #define FAN6_RANGE_MIN_4000RPM 0x60
301 #define FAN6_MIN_3_EDGES 0x00
302 #define FAN6_MIN_5_EDGES 0x08
303 #define FAN6_MIN_7_EDGES 0x10
304 #define FAN6_MIN_9_EDGES 0x18
305 #define FAN6_UPDATE_TIME_100_MILISEC 0x00
306 #define FAN6_UPDATE_TIME_200_MILISEC 0x01
307 #define FAN6_UPDATE_TIME_300_MILISEC 0x02
308 #define FAN6_UPDATE_TIME_400_MILISEC 0x03
309 #define FAN6_UPDATE_TIME_500_MILISEC 0x04
310 #define FAN6_UPDATE_TIME_800_MILISEC 0x05
311 #define FAN6_UPDATE_TIME_1200_MILISEC 0x06
312 #define FAN6_UPDATE_TIME_1600_MILISEC 0x07
313 
319 #define FAN6_RAMP_RATE_CONT_DISABLED 0x00
320 #define FAN6_RAMP_RATE_CONT_ENABLED 0x40
321 #define FAN6_GLITCH_FILTER_DISABLED 0x00
322 #define FAN6_GLITCH_FILTER_ENABLED 0x20
323 #define FAN6_NO_DERIVATIVE 0x00
324 #define FAN6_BASIC_DERIVATIVE 0x08
325 #define FAN6_STEP_DERIVATIVE 0x10
326 #define FAN6_BOTH_DERIVATIVE 0x18
327 #define FAN6_ERROR_RANGE_0RPM 0x00
328 #define FAN6_ERROR_RANGE_50RPM 0x02
329 #define FAN6_ERROR_RANGE_100RPM 0x04
330 #define FAN6_ERROR_RANGE_200RPM 0x06
331 
337 #define FAN6_GAIN_1X 0x00
338 #define FAN6_GAIN_2X 0x15
339 #define FAN6_GAIN_4X 0x2A
340 #define FAN6_GAIN_8X 0x3F
341 
347 #define FAN6_UPDATE_PERIODS_DISABLED 0x00
348 #define FAN6_16_UPDATE_PERIODS 0x40
349 #define FAN6_32_UPDATE_PERIODS 0x80
350 #define FAN6_64_UPDATE_PERIODS 0xC0
351 #define FAN6_100_PERCENTS_PWM_DRIVE_ENABLED 0x00
352 #define FAN6_100_PERCENTS_PWM_DRIVE_DISABLED 0x20
353 #define FAN6_SPINUP_DRIVELEVEL_30_PERCENTS 0x00
354 #define FAN6_SPINUP_DRIVELEVEL_35_PERCENTS 0x04
355 #define FAN6_SPINUP_DRIVELEVEL_40_PERCENTS 0x08
356 #define FAN6_SPINUP_DRIVELEVEL_45_PERCENTS 0x0C
357 #define FAN6_SPINUP_DRIVELEVEL_50_PERCENTS 0x10
358 #define FAN6_SPINUP_DRIVELEVEL_55_PERCENTS 0x14
359 #define FAN6_SPINUP_DRIVELEVEL_60_PERCENTS 0x18
360 #define FAN6_SPINUP_DRIVELEVEL_65_PERCENTS 0x1C
361 #define FAN6_SPINUP_TIME_250_MILISEC 0x00
362 #define FAN6_SPINUP_TIME_500_MILISEC 0x01
363 #define FAN6_SPINUP_TIME_1_SEC 0x02
364 #define FAN6_SPINUP_TIME_2_SEC 0x03
365 
371 #define FAN6_PUSH_TEMP_NOT_LOADED 0x00
372 #define FAN6_PUSH_TEMP1_LOADED 0x80
373 #define FAN6_PUSH_TEMP2_LOADED 0x40
374 #define FAN6_LUT_ENABLED 0x00
375 #define FAN6_LUT_LOCKED 0x20
376 #define FAN6_RPM_TACH_ENABLED 0x00
377 #define FAN6_PWM_DUTY_ENABLED 0x10
378 
384 #define FAN6_GPIO_DIR_INPUT 0x00
385 #define FAN6_GPIO2_DIR_OUTPUT 0x02
386 #define FAN6_GPIO1_DIR_OUTPUT 0x01
387 
393 #define FAN6_GPIO_AS_OPEN_DRAIN 0x00
394 #define FAN6_GPIO2_AS_PUSH_PULL 0x02
395 #define FAN6_GPIO1_AS_PUSH_PULL 0x01
396 
402 #define FAN6_GPIO_INTERR_DISABLED 0x00
403 #define FAN6_GPIO2_INTERR_ENABLED 0x02
404 #define FAN6_GPIO1_INTERR_ENABLED 0x01
405 
411 #define FAN6_SW_NOT_LOCKED 0x00
412 #define FAN6_SW_LOCKED 0x01
413  // End group macro
416 // --------------------------------------------------------------- PUBLIC TYPES
425 typedef struct
426 {
427  // Output pins
428 
429  digital_out_t io1;
430  digital_out_t en;
431 
432  // Input pins
433 
434  digital_in_t sdn;
435  digital_in_t io2;
436  digital_in_t alr;
437 
438  // Modules
439 
440  i2c_master_t i2c;
441 
442  // ctx variable
443 
444  uint8_t slave_address;
445 
446  uint8_t check_ptr;
447  uint8_t adc_mode;
448  uint8_t config_byte1;
449  uint8_t config_byte2;
450 
451 } fan6_t;
452 
456 typedef struct
457 {
458  // Communication gpio pins
459 
460  pin_name_t scl;
461  pin_name_t sda;
462 
463  // Additional gpio pins
464 
465  pin_name_t io1;
466  pin_name_t sdn;
467  pin_name_t en;
468  pin_name_t io2;
469  pin_name_t alr;
470 
471  // static variable
472 
473  uint32_t i2c_speed;
474  uint8_t i2c_address;
475 
476 } fan6_cfg_t;
477  // End types group
479 
480 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
481 
487 #ifdef __cplusplus
488 extern "C"{
489 #endif
490 
500 
509 
517 void fan6_default_cfg ( fan6_t *ctx );
518 
529 void fan6_generic_write ( fan6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
530 
541 void fan6_generic_read ( fan6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len );
542 
552 void fan6_write_reg ( fan6_t *ctx, const uint8_t register_address, const uint16_t transfer_data );
553 
562 uint16_t fan6_read_reg ( fan6_t *ctx, const uint8_t register_address );
563 
573 uint8_t fan6_receive_byte ( fan6_t *ctx, const uint8_t register_address );
574 
583 void fan6_read_eeprom ( fan6_t *ctx, uint8_t *data_out );
584 
593 void fan6_set_pwm_mode ( fan6_t *ctx, const uint8_t pwm_duty );
594 
606 void fan6_set_fan_speed_con_mode ( fan6_t *ctx, const uint8_t minimum_drive, const uint8_t tach_count, const uint16_t tach_target );
607 
617 void fan6_set_pwm_lut_mode ( fan6_t *ctx, const uint8_t tach_count );
618 
629 void fan6_set_fsc_lut_mode ( fan6_t *ctx, const uint8_t minimum_drive, const uint8_t tach_count );
630 
638 uint32_t fan6_read_tachometer ( fan6_t *ctx );
639 
649 float fan6_get_temperature ( fan6_t *ctx, const uint8_t temp_address );
650 
660 void fan6_push_temperature ( fan6_t *ctx, const uint8_t temp_address, const uint8_t temp_selection );
661 
670 void fan6_enable_device ( fan6_t *ctx, const uint8_t state );
671 
680 
688 uint8_t fan6_get_gpio_2 ( fan6_t *ctx );
689 
697 void fan6_set_gpio_1 ( fan6_t *ctx, const uint8_t state );
698 
699 #ifdef __cplusplus
700 }
701 #endif
702 #endif // _FAN6_H_
703  // End public_function group
706 
707 // ------------------------------------------------------------------------- END
fan6_read_eeprom
void fan6_read_eeprom(fan6_t *ctx, uint8_t *data_out)
EEPROM read function.
fan6_cfg_t::io1
pin_name_t io1
Definition: fan6.h:465
fan6_set_gpio_1
void fan6_set_gpio_1(fan6_t *ctx, const uint8_t state)
GPIO 1 Set function.
fan6_t::adc_mode
uint8_t adc_mode
Definition: fan6.h:447
fan6_set_pwm_lut_mode
void fan6_set_pwm_lut_mode(fan6_t *ctx, const uint8_t tach_count)
Set PWM With LUT Mode function.
fan6_t::en
digital_out_t en
Definition: fan6.h:430
fan6_get_temperature
float fan6_get_temperature(fan6_t *ctx, const uint8_t temp_address)
Temperature Get function.
fan6_read_tachometer
uint32_t fan6_read_tachometer(fan6_t *ctx)
Tachometer Read function.
fan6_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: fan6.h:473
fan6_generic_read
void fan6_generic_read(fan6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
fan6_cfg_t::scl
pin_name_t scl
Definition: fan6.h:460
fan6_cfg_setup
void fan6_cfg_setup(fan6_cfg_t *cfg)
Config Object Initialization function.
fan6_t
Click ctx object definition.
Definition: fan6.h:426
fan6_t::config_byte2
uint8_t config_byte2
Definition: fan6.h:449
fan6_read_reg
uint16_t fan6_read_reg(fan6_t *ctx, const uint8_t register_address)
Generic read function.
fan6_t::i2c
i2c_master_t i2c
Definition: fan6.h:440
fan6_t::alr
digital_in_t alr
Definition: fan6.h:436
fan6_t::io1
digital_out_t io1
Definition: fan6.h:429
fan6_t::slave_address
uint8_t slave_address
Definition: fan6.h:444
fan6_t::sdn
digital_in_t sdn
Definition: fan6.h:434
fan6_set_pwm_mode
void fan6_set_pwm_mode(fan6_t *ctx, const uint8_t pwm_duty)
PWM mode set function.
fan6_generic_write
void fan6_generic_write(fan6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
fan6_cfg_t::sda
pin_name_t sda
Definition: fan6.h:461
fan6_cfg_t::sdn
pin_name_t sdn
Definition: fan6.h:466
fan6_t::config_byte1
uint8_t config_byte1
Definition: fan6.h:448
fan6_cfg_t
Click configuration structure definition.
Definition: fan6.h:457
fan6_cfg_t::en
pin_name_t en
Definition: fan6.h:467
fan6_push_temperature
void fan6_push_temperature(fan6_t *ctx, const uint8_t temp_address, const uint8_t temp_selection)
Temperature Push function.
fan6_receive_byte
uint8_t fan6_receive_byte(fan6_t *ctx, const uint8_t register_address)
Byte receive function.
fan6_init
FAN6_RETVAL fan6_init(fan6_t *ctx, fan6_cfg_t *cfg)
Initialization function.
FAN6_RETVAL
#define FAN6_RETVAL
Definition: fan6.h:67
fan6_set_fan_speed_con_mode
void fan6_set_fan_speed_con_mode(fan6_t *ctx, const uint8_t minimum_drive, const uint8_t tach_count, const uint16_t tach_target)
Fan Speed Control Mode Set function.
fan6_enable_device
void fan6_enable_device(fan6_t *ctx, const uint8_t state)
Device Enable function.
fan6_cfg_t::alr
pin_name_t alr
Definition: fan6.h:469
fan6_cfg_t::i2c_address
uint8_t i2c_address
Definition: fan6.h:474
fan6_t::io2
digital_in_t io2
Definition: fan6.h:435
fan6_t::check_ptr
uint8_t check_ptr
Definition: fan6.h:446
fan6_default_cfg
void fan6_default_cfg(fan6_t *ctx)
Click Default Configuration function.
fan6_cfg_t::io2
pin_name_t io2
Definition: fan6.h:468
fan6_set_fsc_lut_mode
void fan6_set_fsc_lut_mode(fan6_t *ctx, const uint8_t minimum_drive, const uint8_t tach_count)
Set FSC With LUT Mode function.
fan6_indicate_critical_thermal_shutdown
uint8_t fan6_indicate_critical_thermal_shutdown(fan6_t *ctx)
Interrupt Pin Get function.
fan6_write_reg
void fan6_write_reg(fan6_t *ctx, const uint8_t register_address, const uint16_t transfer_data)
Generic write function.
fan6_get_gpio_2
uint8_t fan6_get_gpio_2(fan6_t *ctx)
GPIO 2 Get function.