PER Firmware
Loading...
Searching...
No Matches
led.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "common/phal/gpio.h"
#include "common/phal/spi.h"

Go to the source code of this file.

Macros

#define MAX_NUM_LED   14
 
#define LED_PUMP_1   (0)
 
#define LED_PUMP_2   (1)
 
#define LED_DLBK   (2)
 
#define LED_DLFR   (3)
 
#define LED_SDC   (4)
 
#define LED_MAIN   (5)
 
#define LED_DASH   (6)
 
#define LED_ABOX   (7)
 
#define LED_HXFAN   (8)
 
#define LED_5V_FAN   (9)
 
#define LED_TV   (10)
 
#define LED_DAQ   (11)
 
#define LED_5V_CRIT   (12)
 
#define LED_BLT   (13)
 

Enumerations

enum  LED_state { LED_OFF = 0 , LED_ON , LED_BLINK }
 

Functions

bool LED_control (int led, enum LED_state state)
 Set, clear, or toggle a specified LED pin.
 
void LED_periodic ()
 Periodic LED function that toggles LEDs that need to be toggled.
 
uint8_t get_LED_status (int led)
 Get the status of a specified LED pin.
 

Detailed Description

Author
Charles Tamer (ctame.nosp@m.r@pu.nosp@m.rdue..nosp@m.edu)
Version
0.1
Date
2024-1-13

Function Documentation

◆ get_LED_status()

uint8_t get_LED_status ( int led)

Get the status of a specified LED pin.

Parameters
ledLED driver pin
Returns
enum for the LED state

◆ LED_control()

bool LED_control ( int led,
enum LED_state state )

Set, clear, or toggle a specified LED pin.

Parameters
spiSPI hande
ledLED driver pin
stateDesired state of the LED : SET, CLEAR, or TOGGLE
Returns
true if data transfer is successful
false if data transfer fails

◆ LED_periodic()

void LED_periodic ( )

Periodic LED function that toggles LEDs that need to be toggled.

Parameters

return