HardFOC Vortex V1 HAL
Unified HAL API for the HardFOC Vortex motor-control platform (ESP32-C6, TMC9660)
Loading...
Searching...
No Matches
Classes | Functions
vortex::bsp::host Namespace Reference

Classes

struct  Failures
 Which Open() calls fail (the binding returns failure without creating the object). More...
 
struct  LedFrame
 One frame latched onto the status LED. More...
 
struct  OpenLog
 Every Open() call the managers made, and what the binding was asked to configure. More...
 

Functions

void Reset () noexcept
 Close every object, forget the log and the failures, and remove every simulated I2C chip.
 
Failures & Fail () noexcept
 Failure injection for the next Open() calls (cleared by Reset()).
 
const OpenLog & Log () noexcept
 What the managers asked the binding for since the last Reset().
 
void SetI2cPresent (uint8_t address, bool present=true) noexcept
 Simulate a chip that acknowledges address on the I2C bus (probe and scan see it).
 
MockUart * Uart () noexcept
 
MockCan * Can () noexcept
 
MockSpi * Spi (int index) noexcept
 SPI device by the index SpiAddDevice() returned.
 
MockI2c * I2c (int index) noexcept
 I2C device by the index I2cAddDevice() returned.
 
MockI2c * I2cAt (uint8_t address) noexcept
 I2C device added at address, or nullptr.
 
MockGpio * Gpio (HfFunctionalGpioPin pin) noexcept
 MCU GPIO of a functional pin, or nullptr if McuGpioOpen() was not called for it.
 
MockNvs & NvsMock (NvsRegion region) noexcept
 
MockTemperature & Temperature () noexcept
 
const std::vector< LedFrame > & LedFrames () noexcept
 Frames latched onto the status LED since the last Reset().
 
bool LedOpen () noexcept
 True while the status LED is open.
 

Function Documentation

◆ Can()

hf::host::MockCan * vortex::bsp::host::Can ( )
noexcept

◆ Fail()

Failures & vortex::bsp::host::Fail ( )
noexcept

Failure injection for the next Open() calls (cleared by Reset()).

◆ Gpio()

hf::host::MockGpio * vortex::bsp::host::Gpio ( HfFunctionalGpioPin  pin)
noexcept

MCU GPIO of a functional pin, or nullptr if McuGpioOpen() was not called for it.

◆ I2c()

hf::host::MockI2c * vortex::bsp::host::I2c ( int  index)
noexcept

I2C device by the index I2cAddDevice() returned.

Here is the call graph for this function:

◆ I2cAt()

hf::host::MockI2c * vortex::bsp::host::I2cAt ( uint8_t  address)
noexcept

I2C device added at address, or nullptr.

◆ LedFrames()

const std::vector< LedFrame > & vortex::bsp::host::LedFrames ( )
noexcept

Frames latched onto the status LED since the last Reset().

◆ LedOpen()

bool vortex::bsp::host::LedOpen ( )
noexcept

True while the status LED is open.

◆ Log()

const OpenLog & vortex::bsp::host::Log ( )
noexcept

What the managers asked the binding for since the last Reset().

◆ NvsMock()

hf::host::MockNvs & vortex::bsp::host::NvsMock ( NvsRegion  region)
noexcept

◆ Reset()

void vortex::bsp::host::Reset ( )
noexcept

Close every object, forget the log and the failures, and remove every simulated I2C chip.

Here is the call graph for this function:

◆ SetI2cPresent()

void vortex::bsp::host::SetI2cPresent ( uint8_t  address,
bool  present = true 
)
noexcept

Simulate a chip that acknowledges address on the I2C bus (probe and scan see it).

Call before the device is added (before EnsureInitialized()). A device added at an address that is not present NACKs every transfer, as on a board without that chip; a test that wants a chip model sets one on I2cAt(address) after marking it present.

◆ Spi()

hf::host::MockSpi * vortex::bsp::host::Spi ( int  index)
noexcept

SPI device by the index SpiAddDevice() returned.

Here is the call graph for this function:

◆ Temperature()

hf::host::MockTemperature & vortex::bsp::host::Temperature ( )
noexcept

◆ Uart()

hf::host::MockUart * vortex::bsp::host::Uart ( )
noexcept