Prusa MINI Firmware overview
stepper_dac.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * Based on Sprinter and grbl.
6  * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 /**
25  * stepper_dac.h - To set stepper current via DAC
26  */
27 
28 #include "dac_mcp4728.h"
29 
30 int dac_init();
31 void dac_current_percent(uint8_t channel, float val);
32 void dac_current_raw(uint8_t channel, uint16_t val);
33 void dac_print_values();
34 void dac_commit_eeprom();
dac_init
int dac_init()
XYZEval
Definition: types.h:101
dac_current_raw
void dac_current_raw(uint8_t channel, uint16_t val)
mcp4728_setDrvPct
void mcp4728_setDrvPct(xyze_uint8_t &pct)
OUT_WRITE
#define OUT_WRITE(IO, V)
Definition: fastio.h:108
RESET
#define RESET
Definition: dac_mcp4728.h:34
LOW
#define LOW
Definition: wiring_constants.h:70
X_AXIS
Definition: types.h:37
RECIPROCAL
#define RECIPROCAL(x)
Definition: macros.h:273
mcp4728_getDrvPct
uint8_t mcp4728_getDrvPct(const uint8_t channel)
DAC_DISABLE_PIN
#define DAC_DISABLE_PIN
Definition: pins_RIGIDBOARD_V2.h:47
mcp4728_setVref_all
uint8_t mcp4728_setVref_all(const uint8_t value)
i
uint8_t i
Definition: screen_test_graph.c:72
DAC_STEPPER_VREF
#define DAC_STEPPER_VREF
Definition: pins_RIGIDBOARD_V2.h:45
DAC_STEPPER_GAIN
#define DAC_STEPPER_GAIN
Definition: pins_RIGIDBOARD_V2.h:46
AxisEnum
AxisEnum
Definition: types.h:36
mcp4728_eepromWrite
uint8_t mcp4728_eepromWrite()
SERIAL_ECHO_START
#define SERIAL_ECHO_START()
Definition: serial.h:179
mcp4728_setGain_all
uint8_t mcp4728_setGain_all(const uint8_t value)
stepper_dac.h
NOMORE
#define NOMORE(v, n)
Definition: macros.h:133
SERIAL_ECHO_MSG
#define SERIAL_ECHO_MSG(S)
Definition: serial.h:183
dac_commit_eeprom
void dac_commit_eeprom()
mcp4728_analogWrite
uint8_t mcp4728_analogWrite(const uint8_t channel, const uint16_t value)
SERIAL_ECHOLNPAIR
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
uint8_t
const uint8_t[]
Definition: 404_html.c:3
DAC_MOTOR_CURRENT_DEFAULT
#define DAC_MOTOR_CURRENT_DEFAULT
Definition: pins_RIGIDBOARD_V2.h:51
dac_print_values
void dac_print_values()
mcp4728_getValue
uint16_t mcp4728_getValue(const uint8_t channel)
Y_AXIS
Definition: types.h:38
dac_current_get_percent
uint8_t dac_current_get_percent(AxisEnum axis)
dac_current_percent
void dac_current_percent(uint8_t channel, float val)
Z_AXIS
Definition: types.h:39
mcp4728_init
void mcp4728_init()
dac_current_set_percents
void dac_current_set_percents(xyze_uint8_t &pct)
dac_mcp4728.h
E_AXIS
Definition: types.h:40
DAC_STEPPER_MAX
#define DAC_STEPPER_MAX
Definition: pins_RIGIDBOARD_V2.h:44
LOOP_XYZE
#define LOOP_XYZE(VAR)
Definition: types.h:61
DAC_STEPPER_ORDER
#define DAC_STEPPER_ORDER
Definition: pins_RIGIDBOARD_V2.h:40
DAC_STEPPER_SENSE
#define DAC_STEPPER_SENSE
Definition: pins_RIGIDBOARD_V2.h:42
UPDATE
#define UPDATE
Definition: dac_mcp4728.h:36
mcp4728_simpleCommand
uint8_t mcp4728_simpleCommand(const byte simpleCommand)