17#ifndef FLUX_BSP_HOST_BIND_H_
18#define FLUX_BSP_HOST_BIND_H_
23#include "HfCoreMocks.h"
33hf::host::MockGpio*
Gpio(
size_t slot)
noexcept;
35hf::host::MockGpio*
GpioByPin(hf_pin_num_t pin)
noexcept;
43void SetSpiResponder(hf_pin_num_t cs, hf::host::MockSpi::Responder responder);
51void FailSpiBus(
size_t bus,
bool fail =
true)
noexcept;
65hf::host::MockNvs*
Nvs(
size_t slot)
noexcept;
67hf::host::MockCan*
Can()
noexcept;
69hf::host::MockUart*
Uart(uint8_t port)
noexcept;
Definition FluxHostBind.h:26
void FailGpioInit(hf_pin_num_t pin) noexcept
Make the next CreateGpio for pin produce a fake whose initialisation fails.
Definition FluxPlatformBindHost.cpp:361
hf::host::MockAdc * InternalAdc() noexcept
The MCU ADC fake, or nullptr when not created.
Definition FluxPlatformBindHost.cpp:406
hf::host::MockUart * Uart(uint8_t port) noexcept
The UART fake on port, or nullptr.
Definition FluxPlatformBindHost.cpp:435
hf::host::MockTemperature * DieTemperature() noexcept
The die-temperature fake, or nullptr.
Definition FluxPlatformBindHost.cpp:418
void FailLedStrip(bool fail=true) noexcept
Make LedStripBegin fail.
Definition FluxPlatformBindHost.cpp:440
hf::host::MockGpio * Gpio(size_t slot) noexcept
The fake in GPIO slot slot, or nullptr when the slot is empty.
Definition FluxPlatformBindHost.cpp:341
void FailInternalAdc(bool fail=true) noexcept
Make CreateInternalAdc fail.
Definition FluxPlatformBindHost.cpp:414
const SpiDeviceSpec * SpiDeviceSpecOf(hf_pin_num_t cs) noexcept
The spec the device on chip select cs was created with, or nullptr.
Definition FluxPlatformBindHost.cpp:384
int RestartCalls() noexcept
Number of SystemRestart() calls (the host version throws after counting).
Definition FluxPlatformBindHost.cpp:452
void FailDieTemperatureInit(bool fail=true) noexcept
Make the next die-temperature fake fail its initialisation.
Definition FluxPlatformBindHost.cpp:422
const SpiBusSpec * SpiBusSpecOf(size_t bus) noexcept
The spec bus bus was created with, or nullptr when it is down.
Definition FluxPlatformBindHost.cpp:395
hf::host::MockGpio * GpioByPin(hf_pin_num_t pin) noexcept
The fake driving MCU pin pin, or nullptr.
Definition FluxPlatformBindHost.cpp:346
hf::host::MockCan * Can() noexcept
The CAN fake, or nullptr.
Definition FluxPlatformBindHost.cpp:431
hf::host::MockSpi * SpiDeviceByCs(hf_pin_num_t cs) noexcept
The fake for chip select cs, or nullptr when no such device exists.
Definition FluxPlatformBindHost.cpp:373
uint32_t LedShownPixel(uint16_t index) noexcept
Last colour shown on LED index (after LedStripShow).
Definition FluxPlatformBindHost.cpp:444
uint32_t InternalAdcChannelMask() noexcept
Channel mask the MCU ADC was created with.
Definition FluxPlatformBindHost.cpp:410
const GpioSpec * GpioSpecOf(size_t slot) noexcept
The spec the slot was created with (valid only while the slot is in use).
Definition FluxPlatformBindHost.cpp:356
void SetSpiResponder(hf_pin_num_t cs, hf::host::MockSpi::Responder responder)
Install a responder for the device whose chip select is cs (applied when it is created).
Definition FluxPlatformBindHost.cpp:365
hf::host::MockNvs * Nvs(size_t slot) noexcept
The NVS fake in region slot, or nullptr.
Definition FluxPlatformBindHost.cpp:426
void FailSpiBus(size_t bus, bool fail=true) noexcept
Make CreateSpiBus(bus) fail.
Definition FluxPlatformBindHost.cpp:400
void Reset() noexcept
Destroy every object in every slot and clear all scripting (call between test cases).
Definition FluxPlatformBindHost.cpp:303
void SetResetReason(uint32_t reason) noexcept
Value LastResetReason() returns.
Definition FluxPlatformBindHost.cpp:448
Electrical configuration of one MCU GPIO.
Definition FluxPlatformBind.h:71
One SPI controller and its pins.
Definition FluxPlatformBind.h:131
One chip select on an SPI bus.
Definition FluxPlatformBind.h:141