Skip to content

ports: analog: Add MAX32650 & MAX32665 - #11329

Open
Brandon-Hurst wants to merge 23 commits into
adafruit:mainfrom
Brandon-Hurst:ports/analog/add-max32650-max32665
Open

ports: analog: Add MAX32650 & MAX32665#11329
Brandon-Hurst wants to merge 23 commits into
adafruit:mainfrom
Brandon-Hurst:ports/analog/add-max32650-max32665

Conversation

@Brandon-Hurst

Copy link
Copy Markdown

Description

Add support for MAX32650 and MAX32665-based evaluation boards to the analog port. Includes some cleanup of the build system, linkerscripts, and peripheral drivers for portability.

Testing

Tested builds of all boards successfully + functionally tested on MAX32650FTHR.

Signed-off-by: Brandon <brandon.hurst97@gmail.com>
Signed-off-by: Brandon <brandon.hurst97@gmail.com>
Signed-off-by: Brandon <brandon.hurst97@gmail.com>
Signed-off-by: Brandon <brandon.hurst97@gmail.com>
Signed-off-by: Brandon <brandon.hurst97@gmail.com>
- Add include entries for MAX32650 and MAX32666
- Rename MAX32666 macro to MAX32665 to be compatible with
  MSDK naming and GNU Make variables from MSDK.

Signed-off-by: Brandon <brandon.hurst97@gmail.com>
Signed-off-by: Brandon <brandon.hurst97@gmail.com>
Signed-off-by: Brandon <brandon.hurst97@gmail.com>
Signed-off-by: Brandon <brandon.hurst97@gmail.com>
Cleanup and re-organize port-level Makefile.

- Eliminate redundant include / source additions
- Unify comment style and create logical sections
- Inlude MSDK peripheral makefiles for each target
- Mostly unify separate INC and SRC_C blocks
- Refactor CFLAGs ordering
- Add "pristine" build target for convenience
- Reorganize build & flash rules
Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
- *usb.c*: Place USB hardware clock / power into separate init_usb functions.
- *internal_flash.c*: Move Flash and Instruction Cache Controller
operations into different functions for different targets.
- *port.c*: Create macros abstracting RTC alarms & enables for different
register structures.

Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
- Add MCU-specific includes in peripherals/pins.h for MAX32650
& MAX32665
- Fix some issues with SPI pins not matching the datasheet / MSDK
for MAX32650 / MAX32665

Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
…ntroller

- *microcontroller/Pin.c*: Use mxc_gpio_reva_regs_t for standardizing different
GPIO register structures.
- *microcontroller/Processor.c*:
  - Guard MAX32690 GPIO4 specific operations with preproc macros.
  - Use mxc_gpio_reva_regs_t for direct register operations to improve portability.

Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
- Add gpio_init function to normalize disparate GPIO_Init usage of port parameter
- Modify ticks usage in interrupt_after_ticks to fix possible zero result from integer division

Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
- Move Init & Flow Control into wrapper functions in peripherals/
- Unify API differences (e.g. AsyncHandler doesn't always return an err)
- Create UART register macro for TX_BUSY checking in peripherals/

Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
Use register wrapper macros to improve portability for I2C.

This includes macros for the CTRL, STATUS, INTFL0, and FIFO registers.
Additionally, some field values for MST_MODE, BUSY, ACK, and NACK are used.

Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
- Unify initialization into spi_init function in peripherals
- Use mxc_spi_mode_t to unify SPI mode handling across MSDK APIs
- Set default TX data with MXC_SPI_SetDefaultTXData to account for different
mxc_spi_req_t structures across parts.
- Implement spi_init for MAX32690/MAX32650/MAX32665

Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
- Unify common PeriphDriver files outside of MCU-specific .mk files.
- Add warning suppression for "set-but-unused" to accommodate DMA driver
update

Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
- Fix pinsToSpi function signature to correctly matchup pins
- Pin changes for MAX32665 to match package on common Eval boards
- Use '&' instead of '==' for pinmasks to allow for easier pin usage in C code
(This may make it simpler to copy GPIO structs from MSDK down the line)

Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
Signed-off-by: Brandon-Hurst <brandon.hurst97@gmail.com>
Signed-off-by: Brandon Hurst <brandon.hurst97@gmail.com>

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates! A couple files I don't think add value and should be deleted. Otherwise ok.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't bother adding this. It isn't helpful.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants