Prusa MINI Firmware overview
dac_mcp4728.h File Reference
#include "../../core/types.h"
#include <Wire.h>

Go to the source code of this file.

Macros

#define defaultVDD   DAC_STEPPER_MAX
 
#define BASE_ADDR   0x60
 
#define RESET   0b00000110
 
#define WAKE   0b00001001
 
#define UPDATE   0b00001000
 
#define MULTIWRITE   0b01000000
 
#define SINGLEWRITE   0b01011000
 
#define SEQWRITE   0b01010000
 
#define VREFWRITE   0b10000000
 
#define GAINWRITE   0b11000000
 
#define POWERDOWNWRITE   0b10100000
 
#define GENERALCALL   0b00000000
 
#define GAINWRITE   0b11000000
 
#define DAC_DEV_ADDRESS   (BASE_ADDR | DAC_OR_ADDRESS)
 

Functions

void mcp4728_init ()
 
uint8_t mcp4728_analogWrite (const uint8_t channel, const uint16_t value)
 
uint8_t mcp4728_eepromWrite ()
 
uint8_t mcp4728_setVref_all (const uint8_t value)
 
uint8_t mcp4728_setGain_all (const uint8_t value)
 
uint16_t mcp4728_getValue (const uint8_t channel)
 
uint8_t mcp4728_fastWrite ()
 
uint8_t mcp4728_simpleCommand (const byte simpleCommand)
 
uint8_t mcp4728_getDrvPct (const uint8_t channel)
 
void mcp4728_setDrvPct (xyze_uint8_t &pct)
 

Macro Definition Documentation

◆ defaultVDD

#define defaultVDD   DAC_STEPPER_MAX

Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]

Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. Arduino library for MicroChip MCP4728 I2C D/A converter.

◆ BASE_ADDR

#define BASE_ADDR   0x60

◆ RESET

#define RESET   0b00000110

◆ WAKE

#define WAKE   0b00001001

◆ UPDATE

#define UPDATE   0b00001000

◆ MULTIWRITE

#define MULTIWRITE   0b01000000

◆ SINGLEWRITE

#define SINGLEWRITE   0b01011000

◆ SEQWRITE

#define SEQWRITE   0b01010000

◆ VREFWRITE

#define VREFWRITE   0b10000000

◆ GAINWRITE [1/2]

#define GAINWRITE   0b11000000

◆ POWERDOWNWRITE

#define POWERDOWNWRITE   0b10100000

◆ GENERALCALL

#define GENERALCALL   0b00000000

◆ GAINWRITE [2/2]

#define GAINWRITE   0b11000000

◆ DAC_DEV_ADDRESS

#define DAC_DEV_ADDRESS   (BASE_ADDR | DAC_OR_ADDRESS)

Function Documentation

◆ mcp4728_init()

void mcp4728_init ( )

◆ mcp4728_analogWrite()

uint8_t mcp4728_analogWrite ( const uint8_t  channel,
const uint16_t  value 
)

◆ mcp4728_eepromWrite()

uint8_t mcp4728_eepromWrite ( )

◆ mcp4728_setVref_all()

uint8_t mcp4728_setVref_all ( const uint8_t  value)

◆ mcp4728_setGain_all()

uint8_t mcp4728_setGain_all ( const uint8_t  value)

◆ mcp4728_getValue()

uint16_t mcp4728_getValue ( const uint8_t  channel)

◆ mcp4728_fastWrite()

uint8_t mcp4728_fastWrite ( )

◆ mcp4728_simpleCommand()

uint8_t mcp4728_simpleCommand ( const byte  simpleCommand)

◆ mcp4728_getDrvPct()

uint8_t mcp4728_getDrvPct ( const uint8_t  channel)

◆ mcp4728_setDrvPct()

void mcp4728_setDrvPct ( xyze_uint8_t pct)