English
Language : 

CY8CKIT-036 Datasheet, PDF (33/48 Pages) List of Unclassifed Manufacturers – THERMAL MANAGEMENT EXPANSION
stallStatus = FanController_GetFanStallStatus();
/* If speed regulation failure alert, determine which fan(s) */
if (alertStatus & FanController_SPEED_ALERT)
speedStatus = FanController_GetFanSpeedStatus();
/* `#END` */
}
The interrupt handler first calls FanController_GetAlertSource() to determine the alert/fault type
(stall or speed failure). It then calls FanController_GetFanStallSpeedStatus() or
FanController_GetFanStallStatus() to determine which fan(s) caused the alert. Note that
FanController_GetFanStallSpeedStatus() and FanController_GetFanStallStatus() both clear the alert
pin when called. The interrupt handler then sets bits in the stallStatus and speedStatus global
variables. The main code loop polls these global variables to update the LCD display with the fan
status. Note that the Alert signal in this project is also routed to a general purpose IO (GPIO) P0.0
so that it can be observed on a scope or logic analyzer.
Firmware Flowchart
The firmware flowchart for the Example2 project is shown below (see Figure 4-20). In this
example project, the firmware only needs to maintain the user interface: handle switch presses and
update the LCD. The Fan Controller component closed loop hardware control loop does the rest.
32