The Fan control device layer is a proprietary user code utilized for configuring the fan control properties.
More...
|
file | dev_fan.c |
| Contains fan initialization and execution functions.
|
|
file | dev_fan.h |
| fan device driver
|
|
|
void | Dev_Fan_Initialize (void) |
| This function initializes the fan object.
|
|
void | Dev_Fan_Task_100ms (void) |
| this function needs to be called every 100ms it contains the code to update the status of the fan
|
|
void | Dev_Fan_Task_1s (void) |
| This function needs to be called every 1s to keep the temperature of the board at a certain temperature.
|
|
void | Dev_Fan_Set_Override (void) |
| Sets the fan override bit and the fan speed.
|
|
void | Dev_Fan_Set_Speed (uint8_t target_speed_percent) |
| Sets the fan speed.
|
|
static uint16_t | Convert_From_Percentage (uint8_t percentage_value) |
| Converts the percentage value to number of ticks.
|
|
static void | Override_Speed (void) |
| Override the fan speed with maximum speed.
|
|
static void | Calculate_Speed (void) |
| Calculates the fan speed.
|
|
static void | Update_Speed (void) |
| Update the fan speed.
|
|
◆ Calculate_Speed()
static void Calculate_Speed |
( |
void |
| ) |
|
|
static |
- Returns
- void
This function calculates the fan speed.
Definition at line 200 of file dev_fan.c.
◆ Convert_From_Percentage()
static uint16_t Convert_From_Percentage |
( |
uint8_t |
percentage_value | ) |
|
|
static |
- Returns
- void
This function converts the percent value to the duty cycle value as per MULTIPLIER.
Definition at line 175 of file dev_fan.c.
◆ Dev_Fan_Initialize()
void Dev_Fan_Initialize |
( |
void |
| ) |
|
- Returns
- void
This function initializes fan data objects including the initial fan speed, the maximum allowable speed, and the increment/decrement step of the fan speed.
Definition at line 49 of file dev_fan.c.
◆ Dev_Fan_Set_Override()
void Dev_Fan_Set_Override |
( |
void |
| ) |
|
- Returns
- void
This function sets the fan override flag bit to true and sets the fan target speed to maximum speed.
Definition at line 145 of file dev_fan.c.
◆ Dev_Fan_Set_Speed()
void Dev_Fan_Set_Speed |
( |
uint8_t |
target_speed_percent | ) |
|
- Returns
- void
This function sets the fan speed when the target speed does not exceed the maximum fan speed.
Definition at line 159 of file dev_fan.c.
◆ Dev_Fan_Task_100ms()
void Dev_Fan_Task_100ms |
( |
void |
| ) |
|
- Returns
- void
This function needs to be called every 100ms. This modulates the speed of fan depending on the initialized parameters in the fan object.
- Note
- This is called in a rather slow 100ms object, as the speed modulation is not so critical.
Definition at line 76 of file dev_fan.c.
◆ Dev_Fan_Task_1s()
void Dev_Fan_Task_1s |
( |
void |
| ) |
|
- Returns
- void
This function needs to be called every 1s. This modulates the speed of fan depending on the initialized parameters in the fan object. To keep the temperature of the board at around 40 degrees Celcius, the fan speed is increased/decreased depending on the temperature.
- Note
- This is called in a rather slow 1s object, as the speed modulation is not so critical.
Definition at line 110 of file dev_fan.c.
◆ Override_Speed()
static void Override_Speed |
( |
void |
| ) |
|
|
static |
- Returns
- void
This function changes the target speed value to maximum.
Definition at line 187 of file dev_fan.c.
◆ Update_Speed()
static void Update_Speed |
( |
void |
| ) |
|
|
static |
- Returns
- void
This functions updates the fan speed.
Definition at line 230 of file dev_fan.c.
◆ devFanData
The 'FAN_DATA_t' data object holds the access to all the fan control and monitoring values.
Definition at line 21 of file dev_fan.c.