libyggdrasil  v1.0.0
bsp::asg_coproc::drv::DACChannel< Context, Index, Offset, MaxValue > Struct Template Reference

DAC Channel implementation for Asgard. More...

#include <dac.hpp>

Public Member Functions

 DACChannel (const DACChannel &)=delete
 
auto operator= (const DACChannel &)=delete
 
auto operator= (float value) const noexcept
 Set the current DAC value. More...
 
 operator float () const noexcept
 Get the current DAC value. More...
 

Static Public Member Functions

static bool init ()
 Init function. More...
 
static bool deinit ()
 Deinit function. More...
 

Static Public Attributes

constexpr static auto ReferenceVoltage = 3.3
 

Friends

template<auto , template< auto, u8, u32, u32 > typename>
struct bsp::drv::DAConverter
 Declare DAConverter frontend as friend. More...
 

Detailed Description

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
struct bsp::asg_coproc::drv::DACChannel< Context, Index, Offset, MaxValue >

DAC Channel implementation for Asgard.

Warning
Do not use this on its own!
Template Parameters
ContextDAC Context
IndexChannelID
OffsetCalibration offset
MaxValueMaximum value used

Constructor & Destructor Documentation

◆ DACChannel()

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
bsp::asg_coproc::drv::DACChannel< Context, Index, Offset, MaxValue >::DACChannel ( const DACChannel< Context, Index, Offset, MaxValue > &  )
delete

Member Function Documentation

◆ deinit()

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
static bool bsp::asg_coproc::drv::DACChannel< Context, Index, Offset, MaxValue >::deinit ( )
inlinestatic

Deinit function.

Returns
Success

◆ init()

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
static bool bsp::asg_coproc::drv::DACChannel< Context, Index, Offset, MaxValue >::init ( )
inlinestatic

Init function.

Returns
Success

◆ operator float()

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
bsp::asg_coproc::drv::DACChannel< Context, Index, Offset, MaxValue >::operator float ( ) const
inlinenoexcept

Get the current DAC value.

Returns
Fraction of reference voltage between 0.0 and 1.0

◆ operator=() [1/2]

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
auto bsp::asg_coproc::drv::DACChannel< Context, Index, Offset, MaxValue >::operator= ( const DACChannel< Context, Index, Offset, MaxValue > &  )
delete

◆ operator=() [2/2]

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
auto bsp::asg_coproc::drv::DACChannel< Context, Index, Offset, MaxValue >::operator= ( float  value) const
inlinenoexcept

Set the current DAC value.

Parameters
valueCurrent value between 0.0 and 1.0

Friends And Related Function Documentation

◆ bsp::drv::DAConverter

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
template<auto , template< auto, u8, u32, u32 > typename>
friend struct bsp::drv::DAConverter
friend

Declare DAConverter frontend as friend.

Member Data Documentation

◆ ReferenceVoltage

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
constexpr static auto bsp::asg_coproc::drv::DACChannel< Context, Index, Offset, MaxValue >::ReferenceVoltage = 3.3
staticconstexpr

The documentation for this struct was generated from the following file: