Skip to content

Commit 8df19bb

Browse files
author
Jim Lindblom
committed
Adding I2S defines to samd variants
1 parent 9f30b90 commit 8df19bb

File tree

5 files changed

+54
-18
lines changed

5 files changed

+54
-18
lines changed

IDE_Board_Manager/package_sparkfun_index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@
163163
"category":"Contributed",
164164
"url":"https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.3.2.tar.bz2",
165165
"archiveFileName":"sparkfun-samd-1.3.2.tar.bz2",
166-
"checksum":"SHA-256:4765b696b5cafcab9de28663e50600e78e3724ecf21763d8762983d8960741df",
167-
"size":"204905",
166+
"checksum":"SHA-256:eb4274a3df4c6c4dbc1396600b1efc9cd9454e5be4880530ff87ba4fb3e6216a",
167+
"size":"206253",
168168
"help":{
169169
"online":"https://forums.sparkfun.com"
170170
},
1.32 KB
Binary file not shown.

sparkfun/samd/variants/SparkFun_9DoF_M0/variant.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#ifndef _VARIANT_ARDUINO_ZERO_
2020
#define _VARIANT_ARDUINO_ZERO_
2121

22-
// The definitions here needs a SAMD core >=1.6.3
23-
#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10603
22+
// The definitions here needs a SAMD core >=1.6.6
23+
#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10606
2424

2525
/*----------------------------------------------------------------------------
2626
* Definitions
@@ -57,6 +57,7 @@ extern "C"
5757
#define NUM_DIGITAL_PINS (14u)
5858
#define NUM_ANALOG_INPUTS (6u)
5959
#define NUM_ANALOG_OUTPUTS (1u)
60+
#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1)
6061

6162
#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) )
6263
#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin )
@@ -75,9 +76,6 @@ extern "C"
7576
*/
7677
// #define digitalPinToTimer(P)
7778

78-
// Interrupts
79-
#define digitalPinToInterrupt(P) ( g_APinDescription[P].ulExtInt )
80-
8179
// LEDs
8280
#define PIN_LED_13 (13u)
8381
#define PIN_LED_RXL (25u)
@@ -153,13 +151,27 @@ static const uint8_t SCK = PIN_SPI_SCK ;
153151
#define PERIPH_WIRE sercom3
154152
#define WIRE_IT_HANDLER SERCOM3_Handler
155153

154+
static const uint8_t SDA = PIN_WIRE_SDA;
155+
static const uint8_t SCL = PIN_WIRE_SCL;
156+
156157
/*
157158
* USB
158159
*/
159160
#define PIN_USB_HOST_ENABLE (27ul)
160161
#define PIN_USB_DM (28ul)
161162
#define PIN_USB_DP (29ul)
162163

164+
/*
165+
* I2S Interfaces
166+
*/
167+
#define I2S_INTERFACES_COUNT 1
168+
169+
#define I2S_DEVICE 0
170+
#define I2S_CLOCK_GENERATOR 3
171+
#define PIN_I2S_SD (9u)
172+
#define PIN_I2S_SCK (1u)
173+
#define PIN_I2S_FS (0u)
174+
163175
#ifdef __cplusplus
164176
}
165177
#endif

sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#ifndef _VARIANT_ARDUINO_ZERO_
2020
#define _VARIANT_ARDUINO_ZERO_
2121

22-
// The definitions here needs a SAMD core >=1.6.3
23-
#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10603
22+
// The definitions here needs a SAMD core >=1.6.6
23+
#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10606
2424

2525
/*----------------------------------------------------------------------------
2626
* Definitions
@@ -57,6 +57,7 @@ extern "C"
5757
#define NUM_DIGITAL_PINS (14u)
5858
#define NUM_ANALOG_INPUTS (6u)
5959
#define NUM_ANALOG_OUTPUTS (1u)
60+
#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1)
6061

6162
#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) )
6263
#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin )
@@ -75,9 +76,6 @@ extern "C"
7576
*/
7677
// #define digitalPinToTimer(P)
7778

78-
// Interrupts
79-
#define digitalPinToInterrupt(P) ( g_APinDescription[P].ulExtInt )
80-
8179
// LEDs
8280
#define PIN_LED_13 (13u)
8381
#define PIN_LED_RXL (25u)
@@ -157,13 +155,27 @@ static const uint8_t SCK = PIN_SPI_SCK;
157155
#define PERIPH_WIRE sercom3
158156
#define WIRE_IT_HANDLER SERCOM3_Handler
159157

158+
static const uint8_t SDA = PIN_WIRE_SDA;
159+
static const uint8_t SCL = PIN_WIRE_SCL;
160+
160161
/*
161162
* USB
162163
*/
163164
#define PIN_USB_HOST_ENABLE (27ul)
164165
#define PIN_USB_DM (28ul)
165166
#define PIN_USB_DP (29ul)
166167

168+
/*
169+
* I2S Interfaces
170+
*/
171+
#define I2S_INTERFACES_COUNT 1
172+
173+
#define I2S_DEVICE 0
174+
#define I2S_CLOCK_GENERATOR 3
175+
#define PIN_I2S_SD (9u)
176+
#define PIN_I2S_SCK (1u)
177+
#define PIN_I2S_FS (0u)
178+
167179
#ifdef __cplusplus
168180
}
169181
#endif

sparkfun/samd/variants/arduino_zero/variant.h

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#ifndef _VARIANT_ARDUINO_ZERO_
2020
#define _VARIANT_ARDUINO_ZERO_
2121

22-
// The definitions here needs a SAMD core >=1.6.3
23-
#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10603
22+
// The definitions here needs a SAMD core >=1.6.6
23+
#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10606
2424

2525
/*----------------------------------------------------------------------------
2626
* Definitions
@@ -54,9 +54,10 @@ extern "C"
5454

5555
// Number of pins defined in PinDescription array
5656
#define PINS_COUNT (26u)
57-
#define NUM_DIGITAL_PINS (14u)
57+
#define NUM_DIGITAL_PINS (20u)
5858
#define NUM_ANALOG_INPUTS (6u)
5959
#define NUM_ANALOG_OUTPUTS (1u)
60+
#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1)
6061

6162
#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) )
6263
#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin )
@@ -75,9 +76,6 @@ extern "C"
7576
*/
7677
// #define digitalPinToTimer(P)
7778

78-
// Interrupts
79-
#define digitalPinToInterrupt(P) ( g_APinDescription[P].ulExtInt )
80-
8179
// LEDs
8280
#define PIN_LED_13 (13u)
8381
#define PIN_LED_RXL (25u)
@@ -153,13 +151,27 @@ static const uint8_t SCK = PIN_SPI_SCK ;
153151
#define PERIPH_WIRE sercom3
154152
#define WIRE_IT_HANDLER SERCOM3_Handler
155153

154+
static const uint8_t SDA = PIN_WIRE_SDA;
155+
static const uint8_t SCL = PIN_WIRE_SCL;
156+
156157
/*
157158
* USB
158159
*/
159160
#define PIN_USB_HOST_ENABLE (27ul)
160161
#define PIN_USB_DM (28ul)
161162
#define PIN_USB_DP (29ul)
162163

164+
/*
165+
* I2S Interfaces
166+
*/
167+
#define I2S_INTERFACES_COUNT 1
168+
169+
#define I2S_DEVICE 0
170+
#define I2S_CLOCK_GENERATOR 3
171+
#define PIN_I2S_SD (9u)
172+
#define PIN_I2S_SCK (1u)
173+
#define PIN_I2S_FS (0u)
174+
163175
#ifdef __cplusplus
164176
}
165177
#endif

0 commit comments

Comments
 (0)