Skip to content

Commit

Permalink
feat(PeriphDrivers, Documentation): Add Ability to Override Default P…
Browse files Browse the repository at this point in the history
…in Definitions, Document `MSDK_NO_GPIO_CLK_INIT`, Check for `MSDK_NO_GPIO_CLK_INIT` in SDHC Drivers (#1210)
  • Loading branch information
Jake-Carter authored Oct 8, 2024
1 parent 79c0d9a commit b21fba4
Show file tree
Hide file tree
Showing 21 changed files with 98 additions and 16 deletions.
2 changes: 2 additions & 0 deletions Libraries/PeriphDrivers/Source/SDHC/sdhc_ai87.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

Expand Down
2 changes: 2 additions & 0 deletions Libraries/PeriphDrivers/Source/SDHC/sdhc_me10.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@
/* ************************************************************************** */
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);
MXC_GPIO_Config(&gpio_cfg_sdhc_1);
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);
}
Expand Down
3 changes: 3 additions & 0 deletions Libraries/PeriphDrivers/Source/SDHC/sdhc_me13.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

Expand Down
3 changes: 3 additions & 0 deletions Libraries/PeriphDrivers/Source/SDHC/sdhc_me14.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32520_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion Libraries/PeriphDrivers/max32570_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32572_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32650_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32655_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32657_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32660_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32662_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32665_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32670_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32672_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32675_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32680_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max32690_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max78000_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Libraries/PeriphDrivers/max78002_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 22 additions & 0 deletions USERGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b21fba4

Please sign in to comment.