μHAL
|
#include <si57x_ctrl.h>
Public Member Functions | |
Controller (struct pcie_bars &, double=0) | |
void | write_params () override |
bool | read_startup_regs () |
bool | apply_config () |
bool | set_freq (double) |
![]() | |
void | set_devinfo (const struct sdb_device_info &devinfo) override |
virtual void | encode_params () override |
void | write_general (const char *name, decoders::data_type value) |
void | write_channel (const char *name, unsigned pos, decoders::data_type value) |
void | set_devinfo (const struct sdb_device_info &) override |
virtual void | write_params () |
![]() | |
void | check_devinfo_is_set () const |
virtual void | set_devinfo (const struct sdb_device_info &) |
Private Member Functions | |
bool | get_busy () |
bool | still_busy () |
Private Attributes | |
std::unique_ptr< struct wb_si57x_ctrl_regs > | regs_storage |
struct wb_si57x_ctrl_regs & | regs |
Core | dec |
double | fstartup |
double | fxtal |
Additional Inherited Members | |
![]() | |
const device_match_fn | match_devinfo_lambda |
![]() | |
RegisterDecoderController (struct pcie_bars &bars, const struct sdb_device_info &devinfo, RegisterDecoder *pdec) | |
![]() | |
RegisterController (struct pcie_bars &bars, const struct sdb_device_info &) | |
virtual void | set_devinfo_callback () |
virtual void | encode_params ()=0 |
virtual void | unset_commands () |
![]() | |
void | set_read_dest (auto &dest) |
RegisterDecoderBase (struct pcie_bars &, const struct sdb_device_info &) | |
virtual void | read () |
![]() | |
size_t | read_size |
void * | read_dest |
struct pcie_bars & | bars |
struct sdb_device_info | devinfo |
size_t | addr |
This controller may need to reset the IC managed by this core, in order to obtain its startup parameters. These parameters are used to calculate the internal crystal oscillator's frequency, and allow core users to configure the IC using calibrated values, instead of datasheet ones.
si57x_ctrl::Controller::Controller | ( | struct pcie_bars & | bars, |
double | fstartup = 0 |
||
) |
The startup frequency has to be provided if read_startup_regs() is going to be called.
bool si57x_ctrl::Controller::apply_config | ( | ) |
Apply the frequency configuration provided by set_freq(). This function blocks while the configuration is applied. Returns false in case of failure.
|
private |
Update all registers and return state of busy flag.
bool si57x_ctrl::Controller::read_startup_regs | ( | ) |
bool si57x_ctrl::Controller::set_freq | ( | double | freq | ) |
Determine the value for the device's registers in order to output the desired frequency. If read_startup_regs() wasn't called, uses the nominal value for fxtal. Returns false in case of failure.
|
private |
Loop until timeout while busy, return immediately otherwise. Updates all registers every iteration. Returns the final state of the busy flag.
|
overridevirtual |
Child classes can implement this function when their write procedures require more than simply writing the regs structure
Reimplemented from RegisterController.
|
private |
The device's startup frequency.
|
private |
The device's internal crystal frequency.