Bar Logo Dual Active Bridge Development Board (Part-No. )
 
Content
     
Loading...
Searching...
No Matches
dev_fan.h
Go to the documentation of this file.
1
15// This is a guard condition so that contents of this file are not included
16// more than once.
17#ifndef DEV_FAN_H
18#define DEV_FAN_H
19
20#include <xc.h> // include processor files - each processor file is guarded.
21#include <stdint.h> // include standard integer data types
22
23#include "pwm/sccp3.h"
24
30#define MULTIPLIER (CCP3PRL/100)
31
// end of dev-fan-sccp-abstraction-macros
33
34
39#define MAX_SPEED_PERCENT 96
40#define INIT_SPEED_PERCENT 1
41#define MIN_TICK 1
42#define STEP_SIZE 1
43
// end of dev-fan-speed-limit-macros
45
46
50struct FAN_DATA_s {
53 uint16_t MaxSpeedPercent;
54 uint16_t Tick;
55 uint16_t StepSizePercent;
56 uint16_t TargetSpeedRaw;
57 uint16_t CurrentSpeedRaw;
58 uint16_t MaxSpeedRaw;
59 uint8_t OverrideFlag;
60};
61typedef struct FAN_DATA_s FAN_DATA_t;
62
63
64
65
74
75
78void Dev_Fan_Initialize(void);
79void Dev_Fan_Task_100ms(void);
80void Dev_Fan_Task_1s(void);
81void Dev_Fan_Set_Override(void);
83
84
85#endif /* DEV_FAN_H */
86
This is the generated driver header file for the SCCP3 driver.
FAN_DATA_t * devFanDataPtr
Definition dev_fan.c:22
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
Definition dev_fan.c:76
void Dev_Fan_Set_Speed(uint8_t TargetSpeedPercent)
Sets the fan speed.
Definition dev_fan.c:159
void Dev_Fan_Set_Override(void)
Sets the fan override bit and the fan speed.
Definition dev_fan.c:145
void Dev_Fan_Initialize(void)
This function initializes the fan object.
Definition dev_fan.c:49
void Dev_Fan_Task_1s(void)
This function needs to be called every 1s to keep the temperature of the board at a certain temperatu...
Definition dev_fan.c:110
A custom data type for fan.
Definition dev_fan.h:50
uint16_t MaxSpeedRaw
based on period value (CCXPRL).
Definition dev_fan.h:58
uint16_t Tick
set the execution rate in multiples of 100ms
Definition dev_fan.h:54
uint8_t OverrideFlag
override flag. sets tick value to 1, step_size to 20 and target to 100%
Definition dev_fan.h:59
uint16_t StepSizePercent
set the increment rate per tick in percentage
Definition dev_fan.h:55
uint16_t CurrentSpeedRaw
current value raw.
Definition dev_fan.h:57
uint16_t TargetSpeedRaw
targetted value raw.
Definition dev_fan.h:56
uint8_t TargetSpeedPercent
targetted Speed in percentage
Definition dev_fan.h:52
uint16_t MaxSpeedPercent
based on period value (CCXPRL). Use this to limit the fan max speed
Definition dev_fan.h:53
uint8_t CurrentSpeedPercent
Current Speed in percentage.
Definition dev_fan.h:51