This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
reprapfirmware-dc42/Libraries/SamNonDuePin/SamNonDuePin.h
David Crocker 6525a46a52 Version 1.09m
New features
============
The PWM frequency for the heated bed and for any heater used as a
chamber heater is now 10Hz for bettercompatibility with DC-AC SSRs.

The PWM frequency for fans is now configurable using the F paramete ron
the M106 command. The default is 500Hz, which gives esonable control of
fans not designed for PWM. Increase it to 25000Hz when using 4-wire PWM
fans.

When a Duet 0.8.5 board is configured or detected, the fan control is
now automatically inverted. If you previously used M106 P0 I1 in
config.g to invert it, you will need to remove that.

M579 (scale Cartesian axes) is now implemented (thanks chrishamm).

M114, M119 and M573 commands can now be executed concurrently with other
commands.

When DDA debugging is enabled, the debug output now includes all active
extruders instead of just the first two.

M408 S0 now includes the fan speeds (for PanelDue).

M119 now reports the Z probe as well as the endstop switch states.

A tool can now be defined even if a tool with the same tool number
exists already. The existing tool will be shut down and deleted.

The bed heater can now be disabled using M140 S-1 (thanks chrishamm).

The chamber heater (if present) and the endstop switch states are now
reported to the web interface (thanks chrishamm).

Increased defauklt Z prove dive height to 5mm.

Increased default PID Ki to 0.2

Bug fixes
=========
On a CoreXY machine, XY speeds were too low by a factor of sqrt(2).

On a delta machine, after running auto calibration the Z=0 height could
be slightly inaccurate, depending on the difference between the X and Z
endstop corrections

When using a non-intelligent modulated Z probe on a Duet 0.8.5, the
modulation pin number was incorrect.

The M27 (Report SD card print status) response was inverted compared to
what it should be. When in Marlin mode it now includes the "byte n/m"
field that some versions of Pronterface expect.

Cold extrusion prevention did not work - an error message was generated,
but the extruder was driven anyway.

M999 PERASE is now more reliable (thanks chrishamm).

M23, M30 and M32 commands did not work when the filename parameter
passed included an absolute path.

//A T command inside a macro file did not execute the tool change macros
files.

A memory leak occurred when a tool was deleted.

All moves are now completed before switching to CoreXY mode.

Polling requests from PanelDue were not relied to when a macro was being
executed

M667 with no parameters returned an incorrect string
2015-12-06 22:12:31 +00:00

101 lines
3.9 KiB
C++

/*
Copyright (c) 2011 Arduino. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
Code from wiring-digital.c and wiring-analog.c from the arduino core.
See SamNonDuePin.cpp file for more info
*/
#ifndef SAM_NON_DUE_PIN_H
#define SAM_NON_DUE_PIN_H
#include "Arduino.h"
// Number of pins defined in PinDescription array
//#define PINS_C 28 //not used
// Undefined pins constants so the undef pins can be referred to a Xn rather than n
// Any pin numbers below X0 we assume are ordinary Due pin numbers
// Note: these must all be <=127 because pin numbers are held in int8_t in some places.
// There are 92 pins defined in the Arduino Due core as at version 1.5.4, so these must all be >=92
// 2015-07-08 Tony@t3p3 Added the additional pins for the Duet 0.8.5, changed the mapping to start at 93 (>=92) and
// finish at 126 (<=127).
static const uint8_t X0 = 93;
static const uint8_t X1 = 94;
static const uint8_t X2 = 95;
static const uint8_t X3 = 96;
static const uint8_t X4 = 97;
static const uint8_t X5 = 98;
static const uint8_t X6 = 99;
static const uint8_t X7 = 100;
static const uint8_t X8 = 101;
static const uint8_t X9 = 102;
static const uint8_t X10 = 103;
static const uint8_t X11 = 104;
static const uint8_t X12 = 105; //probe
static const uint8_t X13 = 106;
static const uint8_t X14 = 107;
static const uint8_t X15 = 108;
static const uint8_t X16 = 109;
static const uint8_t X17 = 110;
//HSMCI
static const uint8_t PIN_HSMCI_MCCDA_GPIO = 111;
static const uint8_t PIN_HSMCI_MCCK_GPIO = 112;
static const uint8_t PIN_HSMCI_MCDA0_GPIO = 113;
static const uint8_t PIN_HSMCI_MCDA1_GPIO = 114;
static const uint8_t PIN_HSMCI_MCDA2_GPIO = 115;
static const uint8_t PIN_HSMCI_MCDA3_GPIO = 116;
//EMAC
static const uint8_t PIN_EMAC_EREFCK = 117;
static const uint8_t PIN_EMAC_ETXEN = 118;
static const uint8_t PIN_EMAC_ETX0 = 119;
static const uint8_t PIN_EMAC_ETX1 = 120;
static const uint8_t PIN_EMAC_ECRSDV = 121;
static const uint8_t PIN_EMAC_ERX0 = 122;
static const uint8_t PIN_EMAC_ERX1 = 123;
static const uint8_t PIN_EMAC_ERXER = 124;
static const uint8_t PIN_EMAC_EMDC = 125;
static const uint8_t PIN_EMAC_EMDIO = 126;
// Class to give fast access to digital output pins for stepping
class OutputPin
{
Pio *pPort;
uint32_t ulPin;
public:
explicit OutputPin(unsigned int pin);
OutputPin() : pPort(PIOC), ulPin(1 << 31) {} // default constructor needed for array init - accesses PC31 which isn't on the package, so safe
void SetHigh() const { pPort->PIO_SODR = ulPin; }
void SetLow() const { pPort->PIO_CODR = ulPin; }
};
// struct used to hold the descriptions for the "non Arduino" pins.
// from the Arduino.h files
extern const PinDescription nonDuePinDescription[] ;
extern void pinModeNonDue(uint32_t ulPin, uint32_t ulMode, uint32_t debounceCutoff = 0); // NB only one debounce cutoff frequency can be set per PIO
extern void digitalWriteNonDue(uint32_t ulPin, uint32_t ulVal);
extern int digitalReadNonDue(uint32_t ulPin);
extern OutputPin getPioPin(uint32_t ulPin);
extern void analogWriteNonDue(uint32_t ulPin, uint32_t ulValue, uint16_t freq);
extern void analogOutputNonDue();
extern void hsmciPinsinit();
extern void ethPinsInit();
extern adc_channel_num_t PinToAdcChannel(int pin); // convert an analog pin number to an ADC channel
#endif /* SAM_NON_DUE_PIN_H */