|  | 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
50 struct FAN_DATA_s {
51 uint8_t CurrentSpeedPercent;
52 uint8_t TargetSpeedPercent;
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};
61 typedef struct FAN_DATA_s FAN_DATA_t;
62
63
64
65
73extern FAN_DATA_t* devFanDataPtr;
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);
82void Dev_Fan_Set_Speed(uint8_t TargetSpeedPercent);
83
84
85#endif /* DEV_FAN_H */
86
sccp3.h
This is the generated driver header file for the SCCP3 driver.
devFanDataPtr
FAN_DATA_t * devFanDataPtr
Definition dev_fan.c:22
Dev_Fan_Task_100ms
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
Dev_Fan_Set_Speed
void Dev_Fan_Set_Speed(uint8_t TargetSpeedPercent)
Sets the fan speed.
Definition dev_fan.c:159
Dev_Fan_Set_Override
void Dev_Fan_Set_Override(void)
Sets the fan override bit and the fan speed.
Definition dev_fan.c:145
Dev_Fan_Initialize
void Dev_Fan_Initialize(void)
This function initializes the fan object.
Definition dev_fan.c:49
Dev_Fan_Task_1s
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
FAN_DATA_s
A custom data type for fan.
Definition dev_fan.h:50
FAN_DATA_s::MaxSpeedRaw
uint16_t MaxSpeedRaw
based on period value (CCXPRL).
Definition dev_fan.h:58
FAN_DATA_s::Tick
uint16_t Tick
set the execution rate in multiples of 100ms
Definition dev_fan.h:54
FAN_DATA_s::OverrideFlag
uint8_t OverrideFlag
override flag. sets tick value to 1, step_size to 20 and target to 100%
Definition dev_fan.h:59
FAN_DATA_s::StepSizePercent
uint16_t StepSizePercent
set the increment rate per tick in percentage
Definition dev_fan.h:55
FAN_DATA_s::CurrentSpeedRaw
uint16_t CurrentSpeedRaw
current value raw.
Definition dev_fan.h:57
FAN_DATA_s::TargetSpeedRaw
uint16_t TargetSpeedRaw
targetted value raw.
Definition dev_fan.h:56
FAN_DATA_s::TargetSpeedPercent
uint8_t TargetSpeedPercent
targetted Speed in percentage
Definition dev_fan.h:52
FAN_DATA_s::MaxSpeedPercent
uint16_t MaxSpeedPercent
based on period value (CCXPRL). Use this to limit the fan max speed
Definition dev_fan.h:53
FAN_DATA_s::CurrentSpeedPercent
uint8_t CurrentSpeedPercent
Current Speed in percentage.
Definition dev_fan.h:51