We are closed from August 1, 2025 to August 17, 2025. Orders placed during this time will be processed starting on August 18, 2025.

Call external drivers

For example the driver Laser defined by the file laser.hpp uses the driver Xadc defined by the file xadc.hpp:

Usage

To call the driver Xadc from the driver Laser: * include xadc.hpp file * use ctx.get in the driver Laser constructor * return Xadc object

Example

#include <xadc.hpp>
public:
    Laser(Context& ctx)
    : ctl(ctx.mm.get<mem::control>())
    , sts(ctx.mm.get<mem::status>())
    , xadc(ctx.get<Xadc>())
  private:
    Memory<mem::control>& ctl;
    Memory<mem::status>& sts;
    Xadc& xadc;


Important note

Be careful not to introduce circular dependencies in the constructors.

See also

[email protected]