MCP4812 library modifying MCP4822 library * Copyright (c) 2008-2010, Lerche

Embed: (wiki syntax)

« Back to documentation index

MCP4812 Class Reference

MCP4812 Class Reference

Interface to a 10-bit SPI dual-output DAC. More...

#include <MCP4812.h>

Public Member Functions

 MCP4812 (PinName mosi, PinName sclk, PinName ncs)
 Constructor: MCP4812.
void writeA (int ValueA, int gainA)
 Write to the A-output, max 1023 (0x3FF) with 2/4 mV steps.
void writeB (int ValueB, int gainB)
 Write to the B-output, max 1023 (0x3FF) with 2/4 mV steps.
void write (char chan, int value, int gain)
 Write to any output, accoding to letter.
void shdn ()
 Shutdown the output on specific channel.

Detailed Description

Interface to a 10-bit SPI dual-output DAC.

Definition at line 31 of file MCP4812.h.


Constructor & Destructor Documentation

MCP4812 ( PinName  mosi,
PinName  sclk,
PinName  ncs 
)

Constructor: MCP4812.

Parameters:
MOSI- The SPI Data out pin
SCLK- The SPI clock pin
/CS- The ChipSelect pin

Definition at line 30 of file MCP4812.cpp.


Member Function Documentation

void shdn (  )

Shutdown the output on specific channel.

Definition at line 108 of file MCP4812.cpp.

void write ( char  chan,
int  value,
int  gain 
)

Write to any output, accoding to letter.

Definition at line 71 of file MCP4812.cpp.

void writeA ( int  ValueA,
int  gainA 
)

Write to the A-output, max 1023 (0x3FF) with 2/4 mV steps.

Parameters:
ValueAThe value to be written

Definition at line 39 of file MCP4812.cpp.

void writeB ( int  ValueB,
int  gainB 
)

Write to the B-output, max 1023 (0x3FF) with 2/4 mV steps.

Parameters:
ValueBThe valkue to be written

Definition at line 55 of file MCP4812.cpp.