Skip to content

Commit

Permalink
fixup! pinetime: add MTD configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
bergzand committed Feb 23, 2020
1 parent 5826931 commit c95eab6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions boards/pinetime/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
static mtd_spi_nor_t pinetime_nor_dev = {
.base = {
.driver = &mtd_spi_nor_driver,
.page_size = 256,
.pages_per_sector = 16,
.sector_count = 2048,
.page_size = PINETIME_NOR_PAGE_SIZE,
.pages_per_sector = PINETIME_NOR_PAGES_PER_SECTOR,
.sector_count = PINETIME_NOR_SECTOR_COUNT,
},
.flag = SPI_NOR_F_SECT_4K | SPI_NOR_F_SECT_32K,
.flag = PINETIME_NOR_FLAGS,
.opcode = &mtd_spi_nor_opcode_default,
.spi = PINETIME_NOR_SPI_DEV,
.cs = PINETIME_NOR_SPI_CS,
Expand Down
14 changes: 9 additions & 5 deletions boards/pinetime/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ extern "C" {

/**
* @name PineTime NOR flash hardware configuration
* @{
*/
/** @{ */
#define PINETIME_NOR_SPI_DEV SPI_DEV(0)
#define PINETIME_NOR_SPI_CLK SPI_CLK_10MHZ
#define PINETIME_NOR_SPI_CS GPIO_PIN(0, 5)
#define PINETIME_NOR_SPI_MODE SPI_MODE_3
#define PINETIME_NOR_PAGE_SIZE (256)
#define PINETIME_NOR_PAGES_PER_SECTOR (16)
#define PINETIME_NOR_SECTOR_COUNT (2048)
#define PINETIME_NOR_FLAGS (SPI_NOR_F_SECT_4K | SPI_NOR_F_SECT_32K)
#define PINETIME_NOR_SPI_DEV SPI_DEV(0)
#define PINETIME_NOR_SPI_CLK SPI_CLK_10MHZ
#define PINETIME_NOR_SPI_CS GPIO_PIN(0, 5)
#define PINETIME_NOR_SPI_MODE SPI_MODE_3
/** @} */

/**
Expand Down

0 comments on commit c95eab6

Please sign in to comment.