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

ADC Channel implementation for Asgard. More...

#include <adc.hpp>

Public Member Functions

 ADCChannel (const ADCChannel &)=delete
 
auto operator= (const ADCChannel &)=delete
 
 operator float () const noexcept
 Get the current ADC 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::ADConverter
 Declare ADConverter frontend as friend. More...
 

Detailed Description

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

ADC Channel implementation for Asgard.

Warning
Do not use this on its own!
Template Parameters
ContextADC Context
IndexChannel ID
OffsetCalibration offset
MaxValueMaximum value reported

Constructor & Destructor Documentation

◆ ADCChannel()

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

Member Function Documentation

◆ deinit()

template<auto Context, u8 Index, u32 Offset, u32 MaxValue>
static bool bsp::asg_coproc::drv::ADCChannel< 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::ADCChannel< 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::ADCChannel< Context, Index, Offset, MaxValue >::operator float ( ) const
inlinenoexcept

Get the current ADC value.

Note
This function polls the result
Returns
Current value between 0.0 and 1.0

◆ operator=()

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

Friends And Related Function Documentation

◆ bsp::drv::ADConverter

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

Declare ADConverter frontend as friend.

Member Data Documentation

◆ ReferenceVoltage

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

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