Skip to content

Commit a26d607

Browse files
MiKfbraghiroli
authored andcommitted
Added specific SME initialization
1 parent 72b03a4 commit a26d607

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

hardware/AMEL/samd/variants/AMEL_SmartEverything/variant.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,17 @@ const PinDescription g_APinDescription[]=
222222
{ PORTA, 12, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM2_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // TCC2/WO[0]
223223
{ PORTB, 11, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM5_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // TC5/WO[1]
224224
{ PORTB, 10, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM5_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // TC5/WO[1]
225+
226+
/*
227+
* +------------+------------------+--------+-----------------+--------------------------------------------------------------------------------------------------------
228+
* | | I/O Exte | | |
229+
* +------------+------------------+--------+-----------------+--------------------------------------------------------------------------------------------------------
230+
* | 48 | IO_EXT_RST | PA13 | | EXTINT[13] SERCOM2/ PAD[1] SERCOM4/ PAD[1] TCC2/WO[1] TCC0/ WO[7] AC/CMP[1]
231+
* | 49 | IO_EXT_INT | PB06 | |EXTINT[6] AIN[14] Y[12]
232+
* +------------+------------------+--------+-----------------+--------------------------------------------------------------------------------------------------------
233+
*/
234+
{ PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM2_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // TCC2/WO[1]
235+
{ PORTB, 06, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 }, // ADC/AIN[14]
225236
} ;
226237

227238

hardware/AMEL/samd/variants/AMEL_SmartEverything/variant.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ extern "C"
8888
#define PIN_LED3 PIN_LED_TXL
8989
#define LED_BUILTIN PIN_LED_13
9090

91+
92+
93+
// I/O Extender
94+
#define PIN_IO_EXT_RST (48u)
95+
#define PIN_IO_EXT_INT (49u)
96+
9197
/*
9298
* Analog pins
9399
*/
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2015 Amel-Tech (a division of Amel Srl). All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13+
See the GNU Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
#include <Arduino.h>
20+
21+
void initVariant() {
22+
// reset the I/O Extender
23+
pinMode(PIN_IO_EXT_RST, OUTPUT);
24+
digitalWrite(PIN_IO_EXT_RST, LOW);
25+
delay(10); // just wait a while
26+
digitalWrite(PIN_IO_EXT_RST, HIGH);
27+
}
28+

0 commit comments

Comments
 (0)