Skip to content

Commit abea135

Browse files
author
oclyke
committed
add variant configurations
1 parent c8b3b9c commit abea135

File tree

18 files changed

+286
-0
lines changed

18 files changed

+286
-0
lines changed

variants/SFE_ARTEMIS_ATP/variant.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include "variant.h"
77

8+
UART Serial1(SERIAL1_TX, SERIAL1_RX);
9+
810
void initVariant(void){
911

1012
}

variants/SFE_ARTEMIS_ATP/variant.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@
2222
#define VARIANT_Wire_SDA I2C_SDA
2323
#define VARIANT_Wire_SCL I2C_SCL
2424

25+
// UART
26+
extern UART Serial1;
27+
2528
#endif // _VARIANT_H_
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
// This file is subject to the terms and conditions defined in
3+
// file 'LICENSE.md', which is part of this source code package.
4+
*/
5+
6+
#include "bridge/pins.h"
7+
8+
const pin_size_t variantPinCount = 17;
9+
10+
PinState variantPinStates[variantPinCount] = {
11+
{D0, 13, NULL, /*NULL, NULL, NULL,*/ NULL},
12+
{D1, 33, NULL, /*NULL, NULL, NULL,*/ NULL},
13+
{D2, 11, NULL, /*NULL, NULL, NULL,*/ NULL},
14+
{D3, 29, NULL, /*NULL, NULL, NULL,*/ NULL},
15+
{D4, 18, NULL, /*NULL, NULL, NULL,*/ NULL},
16+
{D5, 31, NULL, /*NULL, NULL, NULL,*/ NULL},
17+
{D6, 43, NULL, /*NULL, NULL, NULL,*/ NULL},
18+
{D7, 42, NULL, /*NULL, NULL, NULL,*/ NULL},
19+
{D8, 38, NULL, /*NULL, NULL, NULL,*/ NULL},
20+
{D9, 39, NULL, /*NULL, NULL, NULL,*/ NULL},
21+
{D10, 40, NULL, /*NULL, NULL, NULL,*/ NULL},
22+
{D11, 5, NULL, /*NULL, NULL, NULL,*/ NULL},
23+
{D12, 7, NULL, /*NULL, NULL, NULL,*/ NULL},
24+
{D13, 6, NULL, /*NULL, NULL, NULL,*/ NULL},
25+
{D14, 35, NULL, /*NULL, NULL, NULL,*/ NULL},
26+
{D15, 32, NULL, /*NULL, NULL, NULL,*/ NULL},
27+
{D16, 12, NULL, /*NULL, NULL, NULL,*/ NULL},
28+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
// This file is subject to the terms and conditions defined in
3+
// file 'LICENSE.md', which is part of this source code package.
4+
*/
5+
6+
#ifndef _VARIANT_PINS_H_
7+
#define _VARIANT_PINS_H_
8+
9+
#define LED_BUILTIN pinNumberByName(LED1)
10+
11+
#endif // _VARIANT_PINS_H_
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
// This file is subject to the terms and conditions defined in
3+
// file 'LICENSE.md', which is part of this source code package.
4+
*/
5+
6+
#include "variant.h"
7+
8+
UART Serial1(SERIAL1_TX, SERIAL1_RX);
9+
10+
void initVariant(void){
11+
12+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
// This file is subject to the terms and conditions defined in
3+
// file 'LICENSE.md', which is part of this source code package.
4+
*/
5+
6+
#ifndef _VARIANT_H_
7+
#define _VARIANT_H_
8+
9+
#include "Arduino.h"
10+
11+
#include "config/pins.h"
12+
13+
#define VARIANT_SPI_INTFCS 1
14+
#define VARIANT_WIRE_INTFCS 2
15+
16+
// SPI
17+
#define VARIANT_SPI_SDI SPI_SDI
18+
#define VARIANT_SPI_SDO SPI_SDO
19+
#define VARIANT_SPI_CLK SPI_CLK
20+
21+
// Wire
22+
#define VARIANT_Wire_SDA I2C_SDA
23+
#define VARIANT_Wire_SCL I2C_SCL
24+
25+
#define VARIANT_Wire1_SDA I2C1_SDA
26+
#define VARIANT_Wire1_SCL I2C1_SCL
27+
28+
// UART
29+
extern UART Serial1;
30+
31+
#endif // _VARIANT_H_
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
// This file is subject to the terms and conditions defined in
3+
// file 'LICENSE.md', which is part of this source code package.
4+
*/
5+
6+
#include "bridge/pins.h"
7+
8+
const pin_size_t variantPinCount = 25;
9+
10+
PinState variantPinStates[variantPinCount] = {
11+
{D0, 25, NULL, /*NULL, NULL, NULL,*/ NULL},
12+
{D1, 24, NULL, /*NULL, NULL, NULL,*/ NULL},
13+
{D2, 44, NULL, /*NULL, NULL, NULL,*/ NULL},
14+
{D3, 35, NULL, /*NULL, NULL, NULL,*/ NULL},
15+
{D4, 4, NULL, /*NULL, NULL, NULL,*/ NULL},
16+
{D5, 22, NULL, /*NULL, NULL, NULL,*/ NULL},
17+
{D6, 23, NULL, /*NULL, NULL, NULL,*/ NULL},
18+
{D7, 27, NULL, /*NULL, NULL, NULL,*/ NULL},
19+
{D8, 28, NULL, /*NULL, NULL, NULL,*/ NULL},
20+
{D9, 32, NULL, /*NULL, NULL, NULL,*/ NULL},
21+
{D10, 14, NULL, /*NULL, NULL, NULL,*/ NULL},
22+
{D11, 7, NULL, /*NULL, NULL, NULL,*/ NULL},
23+
{D12, 6, NULL, /*NULL, NULL, NULL,*/ NULL},
24+
{D13, 5, NULL, /*NULL, NULL, NULL,*/ NULL},
25+
{D14, 40, NULL, /*NULL, NULL, NULL,*/ NULL},
26+
{D15, 39, NULL, /*NULL, NULL, NULL,*/ NULL},
27+
{D16, 43, NULL, /*NULL, NULL, NULL,*/ NULL},
28+
{D17, 42, NULL, /*NULL, NULL, NULL,*/ NULL},
29+
{D18, 26, NULL, /*NULL, NULL, NULL,*/ NULL},
30+
{D19, 33, NULL, /*NULL, NULL, NULL,*/ NULL},
31+
{D20, 13, NULL, /*NULL, NULL, NULL,*/ NULL},
32+
{D21, 11, NULL, /*NULL, NULL, NULL,*/ NULL},
33+
{D22, 29, NULL, /*NULL, NULL, NULL,*/ NULL},
34+
{D23, 12, NULL, /*NULL, NULL, NULL,*/ NULL},
35+
{D24, 31, NULL, /*NULL, NULL, NULL,*/ NULL},
36+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
// This file is subject to the terms and conditions defined in
3+
// file 'LICENSE.md', which is part of this source code package.
4+
*/
5+
6+
#ifndef _VARIANT_PINS_H_
7+
#define _VARIANT_PINS_H_
8+
9+
#define LED_BUILTIN pinNumberByName(LED1)
10+
11+
#endif // _VARIANT_PINS_H_
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
// This file is subject to the terms and conditions defined in
3+
// file 'LICENSE.md', which is part of this source code package.
4+
*/
5+
6+
#include "variant.h"
7+
8+
UART Serial1(SERIAL1_TX, SERIAL1_RX);
9+
10+
void initVariant(void){
11+
12+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
// This file is subject to the terms and conditions defined in
3+
// file 'LICENSE.md', which is part of this source code package.
4+
*/
5+
6+
#ifndef _VARIANT_H_
7+
#define _VARIANT_H_
8+
9+
#include "Arduino.h"
10+
11+
#include "config/pins.h"
12+
13+
#define VARIANT_SPI_INTFCS 1
14+
#define VARIANT_WIRE_INTFCS 1
15+
16+
// SPI
17+
#define VARIANT_SPI_SDI SPI_SDI
18+
#define VARIANT_SPI_SDO SPI_SDO
19+
#define VARIANT_SPI_CLK SPI_CLK
20+
21+
// Wire
22+
#define VARIANT_Wire_SDA I2C_SDA
23+
#define VARIANT_Wire_SCL I2C_SCL
24+
25+
// UART
26+
extern UART Serial1;
27+
28+
#endif // _VARIANT_H_

0 commit comments

Comments
 (0)