HardFOC Core
API reference
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
HalPf1550Comm Class Reference

CRTP pf1550::BusInterface adapter mapping driver calls onto BaseI2c + optional BaseGpio strap pins. More...

#include <Pf1550Handler.h>

Inheritance diagram for HalPf1550Comm:

Public Member Functions

 HalPf1550Comm (BaseI2c &i2c, BaseGpio *standby_gpio, BaseGpio *usb_vbus_en_gpio, BaseGpio *usb_otg_en_gpio) noexcept
 
bool Write (uint8_t addr, uint8_t reg, const uint8_t *data, size_t len) noexcept
 Write len data bytes after register pointer reg.
 
bool Read (uint8_t addr, uint8_t reg, uint8_t *data, size_t len) noexcept
 Repeated-start read of len bytes from register reg.
 
bool EnsureInitialized () noexcept
 Idempotently bring up the underlying I²C peripheral.
 
void GpioSet (pf1550::CtrlPin pin, pf1550::GpioSignal signal) noexcept
 Drive a CtrlPin strap GPIO Active/Inactive.
 
void DelayUs (uint32_t us) noexcept
 Coarse µs-precision delay used between profile writes.
 

Private Attributes

BaseI2c & i2c_
 
BaseGpio * standby_gpio_
 
BaseGpio * usb_vbus_en_gpio_
 
BaseGpio * usb_otg_en_gpio_
 
RtosMutex i2c_mutex_
 

Detailed Description

CRTP pf1550::BusInterface adapter mapping driver calls onto BaseI2c + optional BaseGpio strap pins.

The adapter is not intended to be constructed directly by application code — it is owned by Pf1550Handler.

Constructor & Destructor Documentation

◆ HalPf1550Comm()

HalPf1550Comm::HalPf1550Comm ( BaseI2c &  i2c,
BaseGpio *  standby_gpio,
BaseGpio *  usb_vbus_en_gpio,
BaseGpio *  usb_otg_en_gpio 
)
noexcept

Member Function Documentation

◆ DelayUs()

void HalPf1550Comm::DelayUs ( uint32_t  us)
noexcept

Coarse µs-precision delay used between profile writes.

◆ EnsureInitialized()

bool HalPf1550Comm::EnsureInitialized ( )
noexcept

Idempotently bring up the underlying I²C peripheral.

◆ GpioSet()

void HalPf1550Comm::GpioSet ( pf1550::CtrlPin  pin,
pf1550::GpioSignal  signal 
)
noexcept

Drive a CtrlPin strap GPIO Active/Inactive.

◆ Read()

bool HalPf1550Comm::Read ( uint8_t  addr,
uint8_t  reg,
uint8_t *  data,
size_t  len 
)
noexcept

Repeated-start read of len bytes from register reg.

◆ Write()

bool HalPf1550Comm::Write ( uint8_t  addr,
uint8_t  reg,
const uint8_t *  data,
size_t  len 
)
noexcept

Write len data bytes after register pointer reg.

Member Data Documentation

◆ i2c_

BaseI2c& HalPf1550Comm::i2c_
private

◆ i2c_mutex_

RtosMutex HalPf1550Comm::i2c_mutex_
mutableprivate

◆ standby_gpio_

BaseGpio* HalPf1550Comm::standby_gpio_
private

◆ usb_otg_en_gpio_

BaseGpio* HalPf1550Comm::usb_otg_en_gpio_
private

◆ usb_vbus_en_gpio_

BaseGpio* HalPf1550Comm::usb_vbus_en_gpio_
private

The documentation for this class was generated from the following files: