-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19777: cpu/avr8_common: Prepare for rework ISR r=benpicco a=nandojve ### Contribution description This prepares for rework how ISR is handled for AVR-8 platform. It is not expected changes on the behavior but tests on other boards were welcome to avoid regressions. #### Improvements * Split UART state from ISR states. Now it is necessary two variables and GPIORx registers are automatically selected when available. * UART states now supports up to 8 UARTs. * Added AVR8_ISR macro do clean-up and hide internals related to ISR processing. This allows changes on ISR without any other changes on drivers. ### Testing procedure Tests were conducted using atmega328p-xplained-mini and atxmega-a1u-xpro and the zigduino board was only built. The example thread_duel was used to test regressions. 19798: cpu/nrf53: add I2C and SPI support r=benpicco a=dylad ### Contribution description This PR provides support for nRF53 SPI and I2C. It also moves common structs from each nRF CPU folder to `cpu/nrf5x_common` to avoid duplication. Moreover, since nRF9160 and nRF5340 have shared IRQ for UART/SPI/I2C. Both this families now use a common file to register and manage these interrupts. Note that nRF9160 have different name for its interrupts than nRF5340 but they have the same purpose. ### Testing procedure Since some structs were moved around, I think this PR should be carefully tested against nRF52, nRF53 and nRF9160 to avoid any issues. On nRF5340DK-APP, SPI can be tested with its onboard SPI flash. ### Issues/PRs references Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com> Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
- Loading branch information
Showing
41 changed files
with
955 additions
and
1,158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ifneq (,$(filter mtd,$(USEMODULE))) | ||
USEMODULE += mtd_spi_nor | ||
endif | ||
|
||
# default to using littlefs2 on the external flash | ||
ifneq (,$(filter vfs_default,$(USEMODULE))) | ||
USEPKG += littlefs2 | ||
USEMODULE += mtd | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2023 Mesotic SAS | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @ingroup boards_nrf5340dk-app | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific implementations for the Nordic nRF5340DK board | ||
* | ||
* @author Dylan Laduranty <dylan.laduranty@mesotic.com> | ||
* @} | ||
*/ | ||
|
||
#include "board.h" | ||
#include "periph/gpio.h" | ||
#include "timex.h" | ||
#ifdef MODULE_VFS_DEFAULT | ||
#include "vfs_default.h" | ||
#endif | ||
|
||
#ifdef MODULE_MTD_SPI_NOR | ||
#include "mtd_spi_nor.h" | ||
/* MX25R64 */ | ||
static const mtd_spi_nor_params_t _nrf5340_nor_params = { | ||
.opcode = &mtd_spi_nor_opcode_default, | ||
.wait_chip_erase = 240 * US_PER_SEC, | ||
.wait_64k_erase = 800 * US_PER_MS, | ||
.wait_sector_erase = 240 * US_PER_MS, | ||
.wait_chip_wake_up = 1 * US_PER_MS, | ||
.clk = MHZ(54), | ||
.flag = SPI_NOR_F_SECT_4K | SPI_NOR_F_SECT_64K, | ||
.spi = SPI_DEV(0), | ||
.mode = SPI_MODE_0, | ||
.cs = BOARD_QSPI_PIN_CS, | ||
.wp = BOARD_QSPI_PIN_WP, | ||
.hold = BOARD_QSPI_PIN_HOLD, | ||
}; | ||
|
||
static mtd_spi_nor_t nrf5340_nor_dev = { | ||
.base = { | ||
.driver = &mtd_spi_nor_driver, | ||
.page_size = 256, | ||
.pages_per_sector = 16, | ||
}, | ||
.params = &_nrf5340_nor_params, | ||
}; | ||
mtd_dev_t *mtd0 = (mtd_dev_t *)&nrf5340_nor_dev; | ||
|
||
#ifdef MODULE_VFS_DEFAULT | ||
VFS_AUTO_MOUNT(littlefs2, VFS_MTD(nrf5340_nor_dev), VFS_DEFAULT_NVM(0), 0); | ||
#endif | ||
#endif /* MODULE_MTD_SPI_NOR */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.