PER Firmware
Loading...
Searching...
No Matches
driver_interface.c File Reference

thread to manage driver-facing LCD, buttons, LEDs More...

#include "driver_interface.h"
#include "can_library/faults_common.h"
#include "can_library/generated/DASHBOARD.h"
#include "can_library/generated/can_types.h"
#include "common/rtos/rtos.h"
#include "common/heartbeat/heartbeat.h"
#include "common/phal_G4/gpio/gpio.h"
#include "common/watchdog/watchdog.h"
#include "lcd.h"
#include "main.h"
#include "pages/vcu.h"
Include dependency graph for driver_interface.c:

Macros

#define ACTION_QUEUE_LENGTH   (10)
 
#define BUTTON_EXTI_MASK
 

Functions

 RTOS_DEFINE_QUEUE (action_queue, driver_interface_action_t, ACTION_QUEUE_LENGTH)
 
void EXTI0_IRQHandler ()
 
void EXTI1_IRQHandler ()
 
void EXTI4_IRQHandler ()
 
void EXTI9_5_IRQHandler ()
 
void EXTI15_10_IRQHandler ()
 
static void init_buttons ()
 
void action_dispatcher (void)
 
void set_external_leds (void)
 
void driver_interface_periodic (void)
 

Variables

static driver_interface_state_t di_state = DI_STATE_LCD_INIT
 
static driver_interface_state_t next_di_state = DI_STATE_LCD_INIT
 
volatile uint16_t data_mark_index = 0
 
static constexpr uint32_t INTERRUPT_DEBOUNCE_MS = 150
 
status_leds_t status_leds
 

Detailed Description

thread to manage driver-facing LCD, buttons, LEDs

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Macro Definition Documentation

◆ ACTION_QUEUE_LENGTH

#define ACTION_QUEUE_LENGTH   (10)

◆ BUTTON_EXTI_MASK

#define BUTTON_EXTI_MASK
Value:
(EXTI_IMR1_IM0 | EXTI_IMR1_IM1 | \
EXTI_IMR1_IM4 | EXTI_IMR1_IM5 | \
EXTI_IMR1_IM6 | EXTI_IMR1_IM7 | \
EXTI_IMR1_IM8 | EXTI_IMR1_IM9 | \
EXTI_IMR1_IM11 | EXTI_IMR1_IM13 | \
EXTI_IMR1_IM14 | EXTI_IMR1_IM15)

Function Documentation

◆ action_dispatcher()

void action_dispatcher ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ driver_interface_periodic()

void driver_interface_periodic ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EXTI0_IRQHandler()

void EXTI0_IRQHandler ( void )

◆ EXTI15_10_IRQHandler()

void EXTI15_10_IRQHandler ( void )

◆ EXTI1_IRQHandler()

void EXTI1_IRQHandler ( void )

◆ EXTI4_IRQHandler()

void EXTI4_IRQHandler ( void )

◆ EXTI9_5_IRQHandler()

void EXTI9_5_IRQHandler ( void )

◆ init_buttons()

static void init_buttons ( )
static
Here is the caller graph for this function:

◆ RTOS_DEFINE_QUEUE()

RTOS_DEFINE_QUEUE ( action_queue ,
driver_interface_action_t ,
ACTION_QUEUE_LENGTH  )

◆ set_external_leds()

void set_external_leds ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ data_mark_index

volatile uint16_t data_mark_index = 0

◆ di_state

◆ INTERRUPT_DEBOUNCE_MS

uint32_t INTERRUPT_DEBOUNCE_MS = 150
staticconstexpr

◆ next_di_state

◆ status_leds

status_leds_t status_leds
extern