STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
solenoids Namespace Reference

Classes

struct  Channel

Enumerations

enum  SolenoidID {
  OVP = 0 , FVP , OUP , FUP ,
  ODP , FDP , PVF , PVO
}

Functions

static void setIdx (size_t idx, bool open)
void init (SPIClass &spi, int sclk, int miso, int mosi, int cs_pin, uint8_t mcp_hw_addr)
void open (SolenoidID id)
void close (SolenoidID id)
bool isOpen (SolenoidID id)
void safeAllOff ()
void pulseBlocking (SolenoidID id, uint32_t ms)
void openAll ()
void closeAll ()
void fillTanks ()
void basePress ()
void pressKero ()
void pressLOX ()
void pressKeroLOX ()
void Pressurization ()
void ventKeroLOX ()
void openMains ()
void ventTanks ()
void ventAll ()
void Abort ()

Variables

static MCP23S17 * PYRO_1_MCP = nullptr
static Channel channels []
static constexpr size_t NUM_CHANNELS = sizeof(channels) / sizeof(channels[0])
static uint8_t g_shadow [NUM_CHANNELS] = {0}
constexpr bool SOLENOID_ACTIVE_HIGH = true
constexpr int PYRO_CS_1 = 48

Enumeration Type Documentation

◆ SolenoidID

Enumerator
OVP 
FVP 
OUP 
FUP 
ODP 
FDP 
PVF 
PVO 

Definition at line 20 of file solenoid.h.

Function Documentation

◆ Abort()

void solenoids::Abort ( )

Definition at line 150 of file solenoid.cpp.

References closeAll(), delay(), pressKeroLOX(), and ventKeroLOX().

◆ basePress()

void solenoids::basePress ( )

Definition at line 81 of file solenoid.cpp.

Referenced by Pressurization().

◆ close()

void solenoids::close ( SolenoidID id)

Definition at line 46 of file solenoid.cpp.

References setIdx().

Referenced by pressKero(), pressKeroLOX(), pressLOX(), and pulseBlocking().

◆ closeAll()

void solenoids::closeAll ( )

◆ fillTanks()

void solenoids::fillTanks ( )

Definition at line 75 of file solenoid.cpp.

References closeAll(), FVP, open(), and OVP.

◆ init()

void solenoids::init ( SPIClass & spi,
int sclk,
int miso,
int mosi,
int cs_pin,
uint8_t mcp_hw_addr )

Definition at line 31 of file solenoid.cpp.

References channels, NUM_CHANNELS, OUTPUT, PYRO_1_MCP, and setIdx().

◆ isOpen()

bool solenoids::isOpen ( SolenoidID id)

Definition at line 49 of file solenoid.cpp.

References g_shadow.

◆ open()

void solenoids::open ( SolenoidID id)

Definition at line 43 of file solenoid.cpp.

References setIdx().

Referenced by fillTanks(), openMains(), pressKero(), pressKeroLOX(), pressLOX(), pulseBlocking(), setIdx(), and ventKeroLOX().

◆ openAll()

void solenoids::openAll ( )

Definition at line 65 of file solenoid.cpp.

References NUM_CHANNELS, and setIdx().

◆ openMains()

void solenoids::openMains ( )

Definition at line 130 of file solenoid.cpp.

References closeAll(), open(), PVF, and PVO.

◆ pressKero()

void solenoids::pressKero ( )

Definition at line 85 of file solenoid.cpp.

References close(), closeAll(), FUP, FVP, and open().

◆ pressKeroLOX()

void solenoids::pressKeroLOX ( )

Definition at line 105 of file solenoid.cpp.

References close(), closeAll(), FUP, FVP, open(), OUP, and OVP.

Referenced by Abort(), Pressurization(), and ventAll().

◆ pressLOX()

void solenoids::pressLOX ( )

Definition at line 95 of file solenoid.cpp.

References close(), closeAll(), open(), OUP, and OVP.

◆ Pressurization()

void solenoids::Pressurization ( )

Definition at line 117 of file solenoid.cpp.

References basePress(), and pressKeroLOX().

◆ pulseBlocking()

void solenoids::pulseBlocking ( SolenoidID id,
uint32_t ms )

Definition at line 58 of file solenoid.cpp.

References close(), delay(), and open().

◆ safeAllOff()

void solenoids::safeAllOff ( )

Definition at line 53 of file solenoid.cpp.

References NUM_CHANNELS, and setIdx().

◆ setIdx()

void solenoids::setIdx ( size_t idx,
bool open )
inlinestatic

Definition at line 23 of file solenoid.cpp.

References channels, g_shadow, open(), PYRO_1_MCP, and SOLENOID_ACTIVE_HIGH.

Referenced by close(), closeAll(), init(), open(), openAll(), and safeAllOff().

◆ ventAll()

void solenoids::ventAll ( )

Definition at line 142 of file solenoid.cpp.

References closeAll(), delay(), pressKeroLOX(), and ventKeroLOX().

◆ ventKeroLOX()

void solenoids::ventKeroLOX ( )

Definition at line 123 of file solenoid.cpp.

References closeAll(), FVP, open(), and OVP.

Referenced by Abort(), ventAll(), and ventTanks().

◆ ventTanks()

void solenoids::ventTanks ( )

Definition at line 136 of file solenoid.cpp.

References closeAll(), delay(), and ventKeroLOX().

Variable Documentation

◆ channels

Channel solenoids::channels[]
static
Initial value:
= {
{"OVP", 15}, {"FVP", 14}, {"OUP", 13}, {"FUP", 12},
{"ODP", 11}, {"FDP", 10}, {"PVF", 9}, {"PVO", 8},
}

Definition at line 15 of file solenoid.cpp.

Referenced by init(), and setIdx().

◆ g_shadow

uint8_t solenoids::g_shadow[NUM_CHANNELS] = {0}
static

Definition at line 20 of file solenoid.cpp.

Referenced by isOpen(), and setIdx().

◆ NUM_CHANNELS

size_t solenoids::NUM_CHANNELS = sizeof(channels) / sizeof(channels[0])
staticconstexpr

Definition at line 19 of file solenoid.cpp.

Referenced by closeAll(), init(), openAll(), and safeAllOff().

◆ PYRO_1_MCP

MCP23S17* solenoids::PYRO_1_MCP = nullptr
static

Definition at line 9 of file solenoid.cpp.

Referenced by init(), and setIdx().

◆ PYRO_CS_1

int solenoids::PYRO_CS_1 = 48
constexpr

Definition at line 17 of file solenoid.h.

◆ SOLENOID_ACTIVE_HIGH

bool solenoids::SOLENOID_ACTIVE_HIGH = true
constexpr

Definition at line 16 of file solenoid.h.

Referenced by setIdx().