Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otMCP48FVBxx Class Reference
[DAC MCP48FVBxx - Procedures for single/dual 8/10/12bit DAC MCP48FVBxxDAC MCP48FVBxx - Procedures for single/dual 8/10/12bit DAC MCP48FVBxx]

Class that allows to use MCP48FVBxx DAC.

#include <otMCP48FVBxx.h>

Inheritance diagram for otMCP48FVBxx:

otBrushedMotorShield

Public Types

typedef otMCP48FVBxx::DacChannel DacChannel
typedef otMCP48FVBxx::DacBit DacBit
typedef otMCP48FVBxx::Reference Reference
enum  DacChannel { OUT_0, OUT_1 }
enum  DacBit { BIT_8, BIT_10, BIT_12 }
enum  Address {
  R_DAC0, R_DAC1, R_VREF = 8, R_POWER = 9,
  R_GAIN = 10
}
enum  Reference { EXTERNAL = 3, INTERNAL = 1, VDD = 0 }

Public Member Functions

 otMCP48FVBxx ()
void init (DacBit bit=BIT_8, U8 spiOffsetIndex=0)
void setVref (Reference ref, F32 val=1.22f)
void setGain (bool x2_0, bool x2_1=false)
void writeData (DacChannel ch, U16 val)
void writeData (DacChannel ch, F32 volt)
void selectSpiChan ()

Member Typedef Documentation

typedef otMCP48FVBxx::DacBit otMCP48FVBxx.DacBit
 

typedef otMCP48FVBxx::DacChannel otMCP48FVBxx.DacChannel
 

typedef otMCP48FVBxx::Reference otMCP48FVBxx.Reference
 


Member Enumeration Documentation

enum otMCP48FVBxx::Address
 

Enumeration values:
R_DAC0  Output 0.
R_DAC1  Output 1.
R_VREF  Voltage reference selection.
R_POWER  Power controls.
R_GAIN  Gain controls.

enum otMCP48FVBxx::DacBit
 

Enumeration values:
BIT_8  8 bit
BIT_10  10 bit
BIT_12  12 bit

enum otMCP48FVBxx::DacChannel
 

Enumeration values:
OUT_0  Output 0.
OUT_1  Output 1.

enum otMCP48FVBxx::Reference
 

Enumeration values:
EXTERNAL  External reference.
INTERNAL  Internal reference, 1.22V.
VDD  Power supply used as reference.


Constructor & Destructor Documentation

otMCP48FVBxx.otMCP48FVBxx  ) 
 

Create the class


Member Function Documentation

void otMCP48FVBxx.init DacBit  bit = BIT_8,
U8  spiOffsetIndex = 0
 

Init DAC

Parameters:
bit Set DAC resolution see DacBit
spiOffsetIndex Offset in the initialization table of SPI devices

void otMCP48FVBxx.selectSpiChan  ) 
 

Enable it's SPI channel

void otMCP48FVBxx.setGain bool  x2_0,
bool  x2_1 = false
 

Set the gain for each DAC channel

Parameters:
x2_0 True if the gain set to x2 on output 0
x2_1 True if the gain set to x2 on output 1

void otMCP48FVBxx.setVref Reference  ref,
F32  val = 1.22f
 

Set DAC voltage reference

Parameters:
ref Set DAC voltage reference see Reference
val Value of voltage reference when must be specified

void otMCP48FVBxx.writeData DacChannel  ch,
F32  volt
 

Set at specified volt selected DAC output

Parameters:
ch DAC output selection
volt Output voltage

void otMCP48FVBxx.writeData DacChannel  ch,
U16  val
 

Write raw data of specified DAC output

Parameters:
ch DAC output selection
val Raw DAC data


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0