diff --git a/Libraries/PeriphDrivers/Source/SDHC/sdhc_ai87.c b/Libraries/PeriphDrivers/Source/SDHC/sdhc_ai87.c index 6377a5e93de..859e40036ea 100644 --- a/Libraries/PeriphDrivers/Source/SDHC/sdhc_ai87.c +++ b/Libraries/PeriphDrivers/Source/SDHC/sdhc_ai87.c @@ -46,6 +46,7 @@ unsigned int MXC_SDHC_Get_Clock_Config(void) /* ************************************************************************** */ int MXC_SDHC_Init(const mxc_sdhc_cfg_t *cfg) { +#ifndef MSDK_NO_GPIO_CLK_INIT mxc_gpio_regs_t *gpio = gpio_cfg_sdhc.port; // Startup the IPO clock if it's not on already @@ -62,6 +63,7 @@ int MXC_SDHC_Init(const mxc_sdhc_cfg_t *cfg) gpio->ds0 |= gpio_cfg_sdhc.mask; MXC_GPIO_Config(&gpio_cfg_sdhc); +#endif return MXC_SDHC_RevA_Init((mxc_sdhc_reva_regs_t *)MXC_SDHC, cfg); } diff --git a/Libraries/PeriphDrivers/Source/SDHC/sdhc_me10.c b/Libraries/PeriphDrivers/Source/SDHC/sdhc_me10.c index d775c49cdb4..a7135358f4b 100644 --- a/Libraries/PeriphDrivers/Source/SDHC/sdhc_me10.c +++ b/Libraries/PeriphDrivers/Source/SDHC/sdhc_me10.c @@ -37,6 +37,7 @@ /* ************************************************************************** */ int MXC_SDHC_Init(const mxc_sdhc_cfg_t *cfg) { +#ifndef MSDK_NO_GPIO_CLK_INIT MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_SDHC); MXC_GPIO_Config(&gpio_cfg_sdhc_0); @@ -44,6 +45,7 @@ int MXC_SDHC_Init(const mxc_sdhc_cfg_t *cfg) gpio_cfg_sdhc_1.port->vssel |= gpio_cfg_sdhc_1.mask; gpio_cfg_sdhc_0.port->ds_sel0 |= gpio_cfg_sdhc_0.mask; gpio_cfg_sdhc_1.port->ds_sel0 |= gpio_cfg_sdhc_1.mask; +#endif return MXC_SDHC_RevA_Init((mxc_sdhc_reva_regs_t *)MXC_SDHC, cfg); } diff --git a/Libraries/PeriphDrivers/Source/SDHC/sdhc_me13.c b/Libraries/PeriphDrivers/Source/SDHC/sdhc_me13.c index fa7d25570fd..5ac97b464d4 100644 --- a/Libraries/PeriphDrivers/Source/SDHC/sdhc_me13.c +++ b/Libraries/PeriphDrivers/Source/SDHC/sdhc_me13.c @@ -45,6 +45,7 @@ unsigned int MXC_SDHC_Get_Clock_Config(void) /* ************************************************************************** */ int MXC_SDHC_Init(const mxc_sdhc_cfg_t *cfg) { +#ifndef MSDK_NO_GPIO_CLK_INIT mxc_gpio_regs_t *gpio = gpio_cfg_sdhc.port; // Startup the HIRC96M clock if it's not on already @@ -61,6 +62,8 @@ int MXC_SDHC_Init(const mxc_sdhc_cfg_t *cfg) gpio->ds |= gpio_cfg_sdhc.mask; MXC_GPIO_Config(&gpio_cfg_sdhc); +#endif + return MXC_SDHC_RevA_Init((mxc_sdhc_reva_regs_t *)MXC_SDHC, cfg); } diff --git a/Libraries/PeriphDrivers/Source/SDHC/sdhc_me14.c b/Libraries/PeriphDrivers/Source/SDHC/sdhc_me14.c index 5b7c749a96e..165cb4bf8d8 100644 --- a/Libraries/PeriphDrivers/Source/SDHC/sdhc_me14.c +++ b/Libraries/PeriphDrivers/Source/SDHC/sdhc_me14.c @@ -46,6 +46,7 @@ unsigned int MXC_SDHC_Get_Clock_Config(void) /* ************************************************************************** */ int MXC_SDHC_Init(const mxc_sdhc_cfg_t *cfg) { +#ifndef MSDK_NO_GPIO_CLK_INIT mxc_gpio_regs_t *gpio = gpio_cfg_sdhc.port; // Startup the HIRC96M clock if it's not on already @@ -62,6 +63,8 @@ int MXC_SDHC_Init(const mxc_sdhc_cfg_t *cfg) gpio->ds0 |= gpio_cfg_sdhc.mask; MXC_GPIO_Config(&gpio_cfg_sdhc); +#endif + return MXC_SDHC_RevA_Init((mxc_sdhc_reva_regs_t *)MXC_SDHC, cfg); } diff --git a/Libraries/PeriphDrivers/max32520_files.mk b/Libraries/PeriphDrivers/max32520_files.mk index 2fe1fe316bc..bb47b9673f9 100644 --- a/Libraries/PeriphDrivers/max32520_files.mk +++ b/Libraries/PeriphDrivers/max32520_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_es17.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_es17.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_es17.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/CTB diff --git a/Libraries/PeriphDrivers/max32570_files.mk b/Libraries/PeriphDrivers/max32570_files.mk index 254b0a6fd5e..54859c12f26 100644 --- a/Libraries/PeriphDrivers/max32570_files.mk +++ b/Libraries/PeriphDrivers/max32570_files.mk @@ -45,12 +45,17 @@ PERIPH_DIR := $(LIBS_DIR)/PeriphDrivers SOURCE_DIR := $(PERIPH_DIR)/Source INCLUDE_DIR := $(PERIPH_DIR)/Include + PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ + +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me13.c + # Source files) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me13.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me13.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c diff --git a/Libraries/PeriphDrivers/max32572_files.mk b/Libraries/PeriphDrivers/max32572_files.mk index d3e1d47bd73..904c28b5531 100644 --- a/Libraries/PeriphDrivers/max32572_files.mk +++ b/Libraries/PeriphDrivers/max32572_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me55.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me55.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me55.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC diff --git a/Libraries/PeriphDrivers/max32650_files.mk b/Libraries/PeriphDrivers/max32650_files.mk index 3953e884f09..c3281efbf4d 100644 --- a/Libraries/PeriphDrivers/max32650_files.mk +++ b/Libraries/PeriphDrivers/max32650_files.mk @@ -46,12 +46,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me10.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me10.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me10.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC diff --git a/Libraries/PeriphDrivers/max32655_files.mk b/Libraries/PeriphDrivers/max32655_files.mk index fdf45ea2461..b3f2e9ef953 100644 --- a/Libraries/PeriphDrivers/max32655_files.mk +++ b/Libraries/PeriphDrivers/max32655_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me17.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me17.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me17.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC diff --git a/Libraries/PeriphDrivers/max32657_files.mk b/Libraries/PeriphDrivers/max32657_files.mk index 4b198a60a7f..c50d8cdb285 100644 --- a/Libraries/PeriphDrivers/max32657_files.mk +++ b/Libraries/PeriphDrivers/max32657_files.mk @@ -43,12 +43,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/sys_me30.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me30.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me30.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/AES diff --git a/Libraries/PeriphDrivers/max32660_files.mk b/Libraries/PeriphDrivers/max32660_files.mk index f6abe1f33e1..6c3f4f962d2 100644 --- a/Libraries/PeriphDrivers/max32660_files.mk +++ b/Libraries/PeriphDrivers/max32660_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me11.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me11.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me11.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/DMA diff --git a/Libraries/PeriphDrivers/max32662_files.mk b/Libraries/PeriphDrivers/max32662_files.mk index bb021cfecb6..1e3b99be274 100644 --- a/Libraries/PeriphDrivers/max32662_files.mk +++ b/Libraries/PeriphDrivers/max32662_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me12.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me12.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me12.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC diff --git a/Libraries/PeriphDrivers/max32665_files.mk b/Libraries/PeriphDrivers/max32665_files.mk index adc2071243f..69bdaef7463 100644 --- a/Libraries/PeriphDrivers/max32665_files.mk +++ b/Libraries/PeriphDrivers/max32665_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me14.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me14.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me14.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC diff --git a/Libraries/PeriphDrivers/max32670_files.mk b/Libraries/PeriphDrivers/max32670_files.mk index bdd7a458a26..8def0d29439 100644 --- a/Libraries/PeriphDrivers/max32670_files.mk +++ b/Libraries/PeriphDrivers/max32670_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me15.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me15.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me15.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/AES diff --git a/Libraries/PeriphDrivers/max32672_files.mk b/Libraries/PeriphDrivers/max32672_files.mk index a94eea38af7..8d26f621350 100644 --- a/Libraries/PeriphDrivers/max32672_files.mk +++ b/Libraries/PeriphDrivers/max32672_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me21.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me21.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me21.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC diff --git a/Libraries/PeriphDrivers/max32675_files.mk b/Libraries/PeriphDrivers/max32675_files.mk index 7a90f413f5d..7c0b0bddc92 100644 --- a/Libraries/PeriphDrivers/max32675_files.mk +++ b/Libraries/PeriphDrivers/max32675_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me16.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me16.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me15.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/AES diff --git a/Libraries/PeriphDrivers/max32680_files.mk b/Libraries/PeriphDrivers/max32680_files.mk index 32d49061388..c3d3fa15ace 100644 --- a/Libraries/PeriphDrivers/max32680_files.mk +++ b/Libraries/PeriphDrivers/max32680_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me20.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me20.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me17.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC diff --git a/Libraries/PeriphDrivers/max32690_files.mk b/Libraries/PeriphDrivers/max32690_files.mk index 67a944c4e09..8c10ea90ee8 100644 --- a/Libraries/PeriphDrivers/max32690_files.mk +++ b/Libraries/PeriphDrivers/max32690_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_me18.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me18.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me18.c diff --git a/Libraries/PeriphDrivers/max78000_files.mk b/Libraries/PeriphDrivers/max78000_files.mk index 1de1715cf82..c1489dbf8d2 100644 --- a/Libraries/PeriphDrivers/max78000_files.mk +++ b/Libraries/PeriphDrivers/max78000_files.mk @@ -45,12 +45,15 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_ai85.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_ai85.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_ai85.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC diff --git a/Libraries/PeriphDrivers/max78002_files.mk b/Libraries/PeriphDrivers/max78002_files.mk index 9f7ea789947..8c0eca237b8 100644 --- a/Libraries/PeriphDrivers/max78002_files.mk +++ b/Libraries/PeriphDrivers/max78002_files.mk @@ -45,6 +45,9 @@ INCLUDE_DIR := $(PERIPH_DIR)/Include PERIPH_DRIVER_INCLUDE_DIR += $(INCLUDE_DIR)/$(TARGET_UC)/ +# Expose a "PINS_FILE" option for easily overriding the pin definitions +PINS_FILE ?= $(SOURCE_DIR)/SYS/pins_ai87.c + # Source files PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_assert.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_delay.c @@ -56,7 +59,7 @@ PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/mxc_lock.c endif endif PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c -PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_ai87.c +PERIPH_DRIVER_C_FILES += $(PINS_FILE) PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_ai87.c PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC diff --git a/USERGUIDE.md b/USERGUIDE.md index 14af9c71f72..97cafa09a2b 100644 --- a/USERGUIDE.md +++ b/USERGUIDE.md @@ -2123,6 +2123,28 @@ The following table matches external part numbers to internal die types. This i | MAX78000 | AI85 | | MAX78002 | AI87 | +#### `MSDK_NO_GPIO_CLK_INIT` + +Most Peripheral Driver initialization routines involve enabling system clocks, setting clock dividers, and configuring GPIO pins. In some cases (such as for Zephyr), frameworks or tools offer their own mechanisms for handling this, or it's desirable to manually handle it in custom application code. + +The MSDK offers a mechanism for disabling the automatic initialization of clocks and GPIO pins via the `MSDK_NO_GPIO_CLK_INIT` compiler definition. To enable this for a project, add it via the `PROJ_CFLAGS` [build configuration variable](#build-variables-for-the-compiler) using the following syntax: + +```Makefile +#project.mk + +PROJ_CFLAGS += -DMSDK_NO_GPIO_CLK_INIT +``` + +???+ note "ℹ️ **Syntax Note:**" + The `-D` flag tells the compiler to define a symbol at compile-time. It should be followed by the symbol we wish to define. In this case, `MSDK_NO_GPIO_CLK_INIT`. + +#### Peripheral Driver Build Variables + +| Configuration Variable | Description | Details | +| ---------------------- | ---------------------------------------------------------- | ------------------------------------------------------------ | +| | | | +| `PINS_FILE` | Override pin definitions | This option can be used to override the default GPIO definitions used by the peripheral drivers, which can be found in the `Libraries/PeriphDrivers/Source/SYS/pins_xx.c` files in the MSDK. The file specified by this option will be passed to the build instead of the default. It's suggested to copy the default file first as a template before making modifications. | + --- ### CMSIS-DSP