Our office will be closed from August 9, 2021 to August 22, 2021. Orders placed during this time will be processed starting on August 23, 2021.

Call external drivers

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


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


#include <xadc.hpp>
    Laser(Context& ctx)
    : ctl(ctx.mm.get<mem::control>())
    , sts(ctx.mm.get<mem::status>())
    , xadc(ctx.get<Xadc>())
    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]