PER Firmware
Loading...
Searching...
No Matches
switch.h File Reference

switch mappings and control code More...

#include "phal_G4/gpio/gpio.h"
#include "can_library/generated/PDU.h"
Include dependency graph for switch.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  switch_t
 

Enumerations

enum  mux_id_t { ANALOG_MUX1 = 0 , ANALOG_MUX2 }
 

Functions

void SWITCH_enable (switch_id_t switch_id)
 
void SWITCH_disable (switch_id_t switch_id)
 
void SWITCH_enable_all (void)
 

Variables

static constexpr uint8_t NUM_SWITCHES = SWITCH_ID_EMETER + 1
 
static constexpr float SWITCH_IMON_R1_OHMS = 180.0f
 
static constexpr float SWITCH_IMON_R2_OHMS = 330.0f
 
static constexpr float SWITCH_CURRENT_SENSE_GAIN = 500.0f
 
static constexpr float SWITCH_SENSE_DIVIDER_GAIN = SWITCH_IMON_R2_OHMS / (SWITCH_IMON_R1_OHMS + SWITCH_IMON_R2_OHMS)
 
static constexpr float SWITCH_FAULT_SENSE_V = 4.75f
 
static constexpr float SWITCH_FAULT_MARGIN = 0.95f
 
static constexpr float SWITCH_FAULT_CURRENT_THRESHOLD_MA
 
switch_t g_switches [NUM_SWITCHES]
 

Detailed Description

switch mappings and control code

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

Enumeration Type Documentation

◆ mux_id_t

enum mux_id_t
Enumerator
ANALOG_MUX1 
ANALOG_MUX2 

Function Documentation

◆ SWITCH_disable()

void SWITCH_disable ( switch_id_t switch_id)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SWITCH_enable()

void SWITCH_enable ( switch_id_t switch_id)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SWITCH_enable_all()

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

Variable Documentation

◆ g_switches

switch_t g_switches[NUM_SWITCHES]
extern

◆ NUM_SWITCHES

uint8_t NUM_SWITCHES = SWITCH_ID_EMETER + 1
staticconstexpr

◆ SWITCH_CURRENT_SENSE_GAIN

float SWITCH_CURRENT_SENSE_GAIN = 500.0f
staticconstexpr

◆ SWITCH_FAULT_CURRENT_THRESHOLD_MA

float SWITCH_FAULT_CURRENT_THRESHOLD_MA
staticconstexpr
Initial value:
=
* 1000.0f
static constexpr float SWITCH_CURRENT_SENSE_GAIN
Definition switch.h:33
static constexpr float SWITCH_FAULT_MARGIN
Definition switch.h:40
static constexpr float SWITCH_IMON_R1_OHMS
Definition switch.h:31
static constexpr float SWITCH_IMON_R2_OHMS
Definition switch.h:32
static constexpr float SWITCH_FAULT_SENSE_V
Definition switch.h:37

◆ SWITCH_FAULT_MARGIN

float SWITCH_FAULT_MARGIN = 0.95f
staticconstexpr

◆ SWITCH_FAULT_SENSE_V

float SWITCH_FAULT_SENSE_V = 4.75f
staticconstexpr

◆ SWITCH_IMON_R1_OHMS

float SWITCH_IMON_R1_OHMS = 180.0f
staticconstexpr

◆ SWITCH_IMON_R2_OHMS

float SWITCH_IMON_R2_OHMS = 330.0f
staticconstexpr

◆ SWITCH_SENSE_DIVIDER_GAIN

float SWITCH_SENSE_DIVIDER_GAIN = SWITCH_IMON_R2_OHMS / (SWITCH_IMON_R1_OHMS + SWITCH_IMON_R2_OHMS)
staticconstexpr