blob: c4af83092f07a5dee87d611217869d2bd1e063b5 [file] [log] [blame]
Hongwei Zhang90cb34f2019-05-29 19:06:33 -04001
2/*****************************-*- ********-*-********************************
3 * Filename: libpwmtach.h
4 * Description: Library interface to pwmtach access
5 *
6 * Simple interface library for fan control operations
7 * This file provides interface functions to support pwmtachtool.
8 * Copyright (C) <2019> <American Megatrends International LLC>
9 *
10 *****************************************************************************/
11#ifndef LIBPWMTACH_H
12#define LIBPWMTACH_H
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#define PWMTACH_DEV_FILE "/dev/pwmtach"
19
20 /** \file libpwmtach.h
21 * \brief Public headers for the PWMTACH interface library
22 *
23 * This library contains friendly function call interfaces for setting
24 * fan control operations.
25 */
26 extern int set_fan_speed ( unsigned int dev_id, unsigned char fan_number, unsigned int rpm_value );
27 extern int get_fan_speed ( unsigned int dev_id, unsigned char fan_number, unsigned int *rpm_value );
28 /************/
29
30
31 /******Pwmtach interface library to set/read pwm/tach by channel basis apart from configure fan table********/
32 /*********Directly control pwm dutycycle (1 to 99) instead of RPM***********/
33 extern int get_tach_speed ( unsigned int dev_id, unsigned char tach_number, unsigned int *rpm_value );
34 //Notice: dutycycle_percentage value should be between 1 to 99.
35 extern int set_pwm_dutycycle ( unsigned int dev_id, unsigned char pwm_number, unsigned char dutycycle_percentage );
36 //Notice: dutycycle_value should be between 0 to 255.
37 extern int set_pwm_dutycycle_value ( unsigned int dev_id, unsigned char pwm_number, unsigned char dutycycle_value );
38 extern int get_pwm_dutycycle ( unsigned int dev_id, unsigned char pwm_number, unsigned char *dutycycle_percentage );
39
40 /************/
41#ifdef __cplusplus
42}
43#endif
44
45#endif