8000 Merge pull request #937 from tannewt/separate_peripherals_lib · sparkfun/circuitpython@e475256 · GitHub
[go: up one dir, main page]

Skip to content

Commit e475256

Browse files
authored
Merge pull request adafruit#937 from tannewt/separate_peripherals_lib
Split out the peripherals library in preparation of sharing with MakeCode
2 parents 5ce1d71 + a5e03b7 commit e475256

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+67
-5952
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@
6767
[submodule "frozen/Adafruit_CircuitPython_DotStar"]
6868
path = frozen/Adafruit_CircuitPython_DotStar
6969
url = https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git
70+
[submodule "ports/atmel-samd/peripherals"]
71+
path = ports/atmel-samd/peripherals
72+
url = https://github.com/adafruit/samd-peripherals.git

ports/atmel-samd/Makefile

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ INC += -I. \
5555
-Iasf4_conf/$(CHIP_FAMILY) \
5656
-Iboards/$(BOARD) \
5757
-Iboards/ \
58+
-Iperipherals/ \
5859
-Ifreetouch \
5960
-I$(BUILD)
6061

@@ -248,21 +249,21 @@ SRC_C = \
248249
flash_api.c \
249250
mphalport.c \
250251
reset.c \
251-
peripherals/clocks.c \
252-
peripherals/dma.c \
253-
peripherals/events.c \
254-
peripherals/external_interrupts.c \
255-
peripherals/sercom.c \
256-
peripherals/timers.c \
257-
peripherals/$(CHIP_FAMILY)/adc.c \
258-
peripherals/$(CHIP_FAMILY)/cache.c \
259-
peripherals/$(CHIP_FAMILY)/clocks.c \
260-
peripherals/$(CHIP_FAMILY)/dma.c \
261-
peripherals/$(CHIP_FAMILY)/events.c \
262-
peripherals/$(CHIP_FAMILY)/external_interrupts.c \
263-
peripherals/$(CHIP_FAMILY)/pins.c \
264-
peripherals/$(CHIP_FAMILY)/sercom.c \
265-
peripherals/$(CHIP_FAMILY)/timers.c \
252+
peripherals/samd/clocks.c \
253+
peripherals/samd/dma.c \
254+
peripherals/samd/events.c \
255+
peripherals/samd/external_interrupts.c \
256+
peripherals/samd/sercom.c \
257+
peripherals/samd/timers.c \
258+
peripherals/samd/$(CHIP_FAMILY)/adc.c \
259+
peripherals/samd/$(CHIP_FAMILY)/cache.c \
260+
peripherals/samd/$(CHIP_FAMILY)/clocks.c \
261+
peripherals/samd/$(CHIP_FAMILY)/dma.c \
262+
peripherals/samd/$(CHIP_FAMILY)/events.c \
263+
peripherals/samd/$(CHIP_FAMILY)/external_interrupts.c \
264+
peripherals/samd/$(CHIP_FAMILY)/pins.c \
265+
peripherals/samd/$(CHIP_FAMILY)/sercom.c \
266+
peripherals/samd/$(CHIP_FAMILY)/timers.c \
266267
tick.c \
267268
usb.c \
268269
usb_mass_storage.c \
@@ -402,7 +403,7 @@ ifneq ($(CHIP_VARIANT),SAMD51G18A)
402403
audiobusio/__init__.c \
403404
audiobusio/I2SOut.c \
404405
audiobusio/PDMIn.c
405-
SRC_C += peripherals/i2s.c peripherals/$(CHIP_FAMILY)/i2s.c
406+
SRC_C += peripherals/samd/i2s.c peripherals/samd/$(CHIP_FAMILY)/i2s.c
406407
endif
407408
endif
408409

ports/atmel-samd/audio_dma.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
*/
2626

2727
#include "audio_dma.h"
28-
#include "peripherals/clocks.h"
29-
#include "peripherals/events.h"
30-
#include "peripherals/dma.h"
28+
#include "samd/clocks.h"
29+
#include "samd/events.h"
30+
#include "samd/dma.h"
3131

3232
#include "shared-bindings/audioio/RawSample.h"
3333
#include "shared-bindings/audioio/WaveFile.h"

ports/atmel-samd/bindings/samd/Clock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626

2727
#include "bindings/samd/Clock.h"
28-
#include "peripherals/clocks.h"
28+
#include "samd/clocks.h"
2929
#include "py/obj.h"
3030
#include "py/objproperty.h"
3131
#include "py/runtime.h"

ports/atmel-samd/board_busses.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include "shared-bindings/microcontroller/Pin.h"
3232
#include "mpconfigboard.h"
33-
#include "peripherals/pins.h"
33+
#include "samd/pins.h"
3434
#include "py/runtime.h"
3535

3636
#if !defined(DEFAULT_I2C_BUS_SDA) || !defined(DEFAULT_I2C_BUS_SCL)

ports/atmel-samd/common-hal/analogio/AnalogIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "py/binary.h"
3535
#include "py/mphal.h"
3636

37-
#include "peripherals/adc.h"
37+
#include "samd/adc.h"
3838
#include "shared-bindings/analogio/AnalogIn.h"
3939

4040
#include "atmel_start_pins.h"

ports/atmel-samd/common-hal/audiobusio/I2SOut.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545
#include "hpl/pm/hpl_pm_base.h"
4646
#endif
4747

48-
#include "peripherals/clocks.h"
49-
#include "peripherals/dma.h"
50-
#include "peripherals/events.h"
51-
#include "peripherals/i2s.h"
52-
#include "peripherals/pins.h"
53-
#include "peripherals/timers.h"
48+
#include "samd/clocks.h"
49+
#include "samd/dma.h"
50+
#include "samd/events.h"
51+
#include "samd/i2s.h"
52+
#include "samd/pins.h"
53+
#include "samd/timers.h"
5454

5555
#include "audio_dma.h"
5656

ports/atmel-samd/common-hal/audiobusio/PDMIn.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
#include "hal/include/hal_gpio.h"
4242
#include "hal/utils/include/utils.h"
4343

44-
#include "peripherals/clocks.h"
45-
#include "peripherals/events.h"
46-
#include "peripherals/i2s.h"
47-
#include "peripherals/pins.h"
48-
#include "peripherals/dma.h"
44+
#include "samd/clocks.h"
45+
#include "samd/events.h"
46+
#include "samd/i2s.h"
47+
#include "samd/pins.h"
48+
#include "samd/dma.h"
4949

5050
#include "audio_dma.h"
5151
#include "tick.h"

ports/atmel-samd/common-hal/audioio/AudioOut.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646

4747
#include "audio_dma.h"
4848

49-
#include "peripherals/dma.h"
50-
#include "peripherals/events.h"
51-
#include "peripherals/pins.h"
52-
#include "peripherals/timers.h"
49+
#include "samd/dma.h"
50+
#include "samd/events.h"
51+
#include "samd/pins.h"
52+
#include "samd/timers.h"
5353

5454
void audioout_reset(void) {
5555
}

ports/atmel-samd/common-hal/busio/I2C.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "hal/include/hal_i2c_m_sync.h"
3333
#include "hal/include/hpl_i2c_m_sync.h"
3434

35-
#include "peripherals/sercom.h"
35+
#include "samd/sercom.h"
3636
#include "shared-bindings/microcontroller/__init__.h"
3737

3838

ports/atmel-samd/common-hal/busio/SPI.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
#include "hal/include/hpl_spi_m_sync.h"
3737
#include "supervisor/shared/rgb_led_status.h"
3838

39-
#include "peripherals/dma.h"
40-
#include "peripherals/sercom.h"
39+
#include "samd/dma.h"
40+
#include "samd/sercom.h"
4141

4242
void common_hal_busio_spi_construct(busio_spi_obj_t *self,
4343
const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi,

ports/atmel-samd/common-hal/busio/UART.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#include "hal/include/hal_usart_async.h"
4343
#include "hal/include/hpl_usart_async.h"
4444

45-
#include "peripherals/sercom.h"
45+
#include "samd/sercom.h"
4646

4747
// Do-nothing callback needed so that usart_async code will enable rx interrupts.
4848
// See comment below re usart_async_register_callback()

ports/atmel-samd/common-hal/microcontroller/Pin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "atmel_start_pins.h"
3030
#include "hal/include/hal_gpio.h"
3131

32-
#include "peripherals/pins.h"
32+
#include "samd/pins.h"
3333
#include "supervisor/shared/rgb_led_status.h"
3434

3535
#ifdef MICROPY_HW_NEOPIXEL

ports/atmel-samd/common-hal/microcontroller/Pin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ void reset_all_pins(void);
8181
void reset_pin(uint8_t pin);
8282
void claim_pin(const mcu_pin_obj_t* pin);
8383

84-
#include "peripherals/pins.h"
84+
#include "peripherals/samd/pins.h"
8585

8686
#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_MICROCONTROLLER_PIN_H

ports/atmel-samd/common-hal/microcontroller/Processor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
#include "common-hal/microcontroller/Processor.h"
6565

66-
#include "peripherals/adc.h"
66+
#include "samd/adc.h"
6767

6868
#include "peripheral_clk_config.h"
6969

ports/atmel-samd/common-hal/pulseio/PWMOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434

3535
#include "atmel_start_pins.h"
3636
#include "hal/utils/include/utils_repeat_macro.h"
37-
#include "peripherals/timers.h"
37+
#include "samd/timers.h"
3838

39-
#include "peripherals/pins.h"
39+
#include "samd/pins.h"
4040

4141
#undef ENABLE
4242

ports/atmel-samd/common-hal/pulseio/PulseIn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
#include "mpconfigport.h"
3636
#include "py/gc.h"
3737
#include "py/runtime.h"
38-
#include "peripherals/external_interrupts.h"
39-
#include "peripherals/pins.h"
38+
#include "samd/external_interrupts.h"
39+
#include "samd/pins.h"
4040
#include "shared-bindings/microcontroller/__init__.h"
4141
#include "shared-bindings/pulseio/PulseIn.h"
4242

ports/atmel-samd/common-hal/pulseio/PulseOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "hal/include/hal_gpio.h"
3232

3333
#include "mpconfigport.h"
34-
#include "peripherals/pins.h"
35-
#include "peripherals/timers.h"
34+
#include "samd/pins.h"
35+
#include "samd/timers.h"
3636
#include "py/gc.h"
3737
#include "py/runtime.h"
3838
#include "shared-bindings/pulseio/PulseOut.h"

ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#include "atmel_start_pins.h"
3030

31-
#include "peripherals/external_interrupts.h"
31+
#include "samd/external_interrupts.h"
3232
#include "py/runtime.h"
3333

3434
void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t* self,

ports/atmel-samd/common-hal/touchio/TouchIn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
#include "hpl/pm/hpl_pm_base.h"
3838
#endif
3939

40-
#include "peripherals/clocks.h"
41-
#include "peripherals/pins.h"
40+
#include "samd/clocks.h"
41+
#include "samd/pins.h"
4242

4343
#include "tick.h"
4444
#include "adafruit_ptc.h"

ports/atmel-samd/external_flash/qspi_flash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#include "mpconfigboard.h" // for EXTERNAL_FLASH_QSPI_DUAL
3333

3434
#include "external_flash/common_commands.h"
35-
#include "peripherals/cache.h"
36-
#include "peripherals/dma.h"
35+
#include "samd/cache.h"
36+
#include "samd/dma.h"
3737

3838
#include "atmel_start_pins.h"
3939
#include "hal_gpio.h"

ports/atmel-samd/external_flash/spi_flash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <string.h>
3030

3131
#include "external_flash/common_commands.h"
32-
#include "peripherals/sercom.h"
32+
#include "samd/sercom.h"
3333
#include "py/mpconfig.h"
3434

3535
#include "hal_gpio.h"

ports/atmel-samd/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ extern const struct _mp_obj_module_t usb_hid_module;
318318

319319
#define MP_STATE_PORT MP_STATE_VM
320320

321-
#include "peripherals/dma.h"
321+
#include "peripherals/samd/dma.h"
322322

323323
#define MICROPY_PORT_ROOT_POINTERS \
324324
const char *readline_hist[8]; \

ports/atmel-samd/peripherals

Submodule peripherals added at 5b18f0a

ports/atmel-samd/peripherals/adc.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

ports/atmel-samd/peripherals/cache.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0