AFE_NXP_Arduino 2.0.2 Analog Front-End (AFE) device operation sample code for Arduino

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
NAFE33352_Base::DAC Class Reference

`#include <NAFE33352.h>`

## Public Types
enum class | ModeSelect : uint16_t { OFF = 0 , VOLTAGE , CURRENT , CURRENT_RECAL , DAC_OFF_VOLTAGE_IN , DAC_OFF_CURRENT_IN }

## Public Member Functions
| DAC ()
virtual | ~DAC ()
void | configure (const uint16_t(&cc)[6])
void | configure (uint16_t cc0, uint16_t cc1, uint16_t cc2, uint16_t cc3, uint16_t cc4, uint16_t cc5)
void | configure (ModeSelect mode, double full_scale_range=0.00)
void | configure (double full_scale_range)
void | output (double value)
DAC & | operator= (double value)

## Public Attributes
NAFE33352_Base * | afe_ptr

## Private Attributes
ModeSelect | output_mode
double | full_scale

## Detailed Description

DAC sub-class in NAFE33352_Base class

Definition at line 77 of file NAFE33352.h.

## Member Enumeration Documentation

## ◆ ModeSelect

enum class NAFE33352_Base::DAC::ModeSelect : uint16_t
| strong

DAC default configuration register value set selector

Enumerator
OFF |
VOLTAGE |
CURRENT |
CURRENT_RECAL |
DAC_OFF_VOLTAGE_IN |
DAC_OFF_CURRENT_IN |

Definition at line 82 of file NAFE33352.h.

## Constructor & Destructor Documentation

## ◆ DAC()

NAFE33352_Base::DAC::DAC | ( |  | ) |

Definition at line 34 of file NAFE33352.cpp.

## ◆ ~DAC()

NAFE33352_Base::DAC::~DAC | ( |  | ) |
| virtual

Definition at line 38 of file NAFE33352.cpp.

## Member Function Documentation

## ◆ configure() [1/4]

void NAFE33352_Base::DAC::configure | ( | const uint16_t(&) | cc[6] | ) |

Configure logical channel

Parameters

  cc | array for AIO_CONFIG, AO_CAL_COEF, AIO_PROT_CFG, AO_SLR_CTRL, AWG_PER and AO_SYSCFG rgister values

Definition at line 48 of file NAFE33352.cpp.

Referenced by configure().

## ◆ configure() [2/4]

void NAFE33352_Base::DAC::configure | ( | double | full_scale_range | ) |

Configure logical channel

Parameters

  full_scale_range | Full scale range modifier. If it meeds to be +/-2.5V, define this variable 2.5. If it is +/-10mA, define it as 0.01.

Definition at line 95 of file NAFE33352.cpp.

## ◆ configure() [3/4]

void NAFE33352_Base::DAC::configure | ( | ModeSelect | mode,
|  | double | full_scale_range = 0.00 )

Configure logical channel

Parameters

  mode | ModeSelect selector
  full_scale_range | Full scale range modifier. If it meeds to be +/-2.5V, define this variable 2.5. If it is +/-10mA, define it as 0.01.

Definition at line 53 of file NAFE33352.cpp.

## ◆ configure() [4/4]

void NAFE33352_Base::DAC::configure | ( | uint16_t | cc0,
|  | uint16_t | cc1,
|  | uint16_t | cc2,
|  | uint16_t | cc3,
|  | uint16_t | cc4,
|  | uint16_t | cc5 )

Configure logical channel

Parameters

  cc0 | 16bit value to be set AIO_CONFIG register (0x20)
  cc1 | 16bit value to be set AO_CAL_COEF register (0x21)
  cc2 | 16bit value to be set AIO_PROT_CFG register (0x22)
  cc3 | 16bit value to be set AO_SLR_CTRL register (0x23)
  cc4 | 16bit value to be set AWG_PER register (0x24)
  cc5 | 16bit value to be set AO_SYSCFG register (0x25)

Definition at line 42 of file NAFE33352.cpp.

## ◆ operator=()

NAFE33352_Base::DAC & NAFE33352_Base::DAC::operator= | ( | double | value | ) |

Set DAC output

shorthand to set DAC output

Definition at line 105 of file NAFE33352.cpp.

## ◆ output()

void NAFE33352_Base::DAC::output | ( | double | value | ) |

Set DAC output

Parameters

  value | set value in Volt or Ampere

Definition at line 100 of file NAFE33352.cpp.

Referenced by operator=().

## Member Data Documentation

## ◆ afe_ptr

NAFE33352_Base* NAFE33352_Base::DAC::afe_ptr

pointer to NAFE33352_Base based instance

Definition at line 137 of file NAFE33352.h.

Referenced by configure(), configure(), and output().

## ◆ full_scale

double NAFE33352_Base::DAC::full_scale
| private

Definition at line 140 of file NAFE33352.h.

Referenced by configure(), configure(), and output().

## ◆ output_mode

ModeSelect NAFE33352_Base::DAC::output_mode
| private

Definition at line 139 of file NAFE33352.h.

Referenced by configure().

The documentation for this class was generated from the following files:

- NAFE33352.h
- NAFE33352.cpp