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.cpp
David Crocker 206f85c690 Version 1.09t beta 2
Got rid of most of module SamNonDuePin because CoreDuet now provides the
required functionality
No need to define function watchdogSetup any more because the core no
longer calls it
2016-03-10 14:10:48 +00:00

66 lines
2.2 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 adapted from wiring-digital.c and from variant.cpp from the Arduino software
This allows access to the pins on the SAM3X8E that are not defined in the Arduino
pin description.
*/
#include "SamNonDuePin.h"
// Build a short-form pin descriptor for a IO pin
OutputPin::OutputPin(unsigned int pin)
{
const PinDescription& pinDesc = GetPinDescription(pin);
pPort = pinDesc.pPort;
ulPin = pinDesc.ulPin;
}
static void ConfigurePin(const PinDescription& pinDesc)
{
PIO_Configure(pinDesc.pPort, pinDesc.ulPinType, pinDesc.ulPin, pinDesc.ulPinConfiguration);
}
//initialise HSMCI pins
void hsmciPinsinit()
{
ConfigurePin(g_APinDescription[PIN_HSMCI_MCCDA_GPIO]);
ConfigurePin(g_APinDescription[PIN_HSMCI_MCCK_GPIO]);
ConfigurePin(g_APinDescription[PIN_HSMCI_MCDA0_GPIO]);
ConfigurePin(g_APinDescription[PIN_HSMCI_MCDA1_GPIO]);
ConfigurePin(g_APinDescription[PIN_HSMCI_MCDA2_GPIO]);
ConfigurePin(g_APinDescription[PIN_HSMCI_MCDA3_GPIO]);
}
//initialise ethernet pins
void ethPinsInit()
{
ConfigurePin(g_APinDescription[PIN_EMAC_EREFCK]);
ConfigurePin(g_APinDescription[PIN_EMAC_ETXEN]);
ConfigurePin(g_APinDescription[PIN_EMAC_ETX0]);
ConfigurePin(g_APinDescription[PIN_EMAC_ETX1]);
ConfigurePin(g_APinDescription[PIN_EMAC_ECRSDV]);
ConfigurePin(g_APinDescription[PIN_EMAC_ERX0]);
ConfigurePin(g_APinDescription[PIN_EMAC_ERX1]);
ConfigurePin(g_APinDescription[PIN_EMAC_ERXER]);
ConfigurePin(g_APinDescription[PIN_EMAC_EMDC]);
ConfigurePin(g_APinDescription[PIN_EMAC_EMDIO]);
}
// End