Skip to content

Commit

Permalink
Add SFLASH support to Grasshopper-L082CZ
Browse files Browse the repository at this point in the history
  • Loading branch information
GrumpyOldPizza committed Aug 12, 2018
1 parent 1c9e497 commit e2212a4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Grasshopper-L082CZ.menu.dosfs.none.build.dosfs_sflash=0
Grasshopper-L082CZ.menu.dosfs.sdspi=SDCARD (SPI)
Grasshopper-L082CZ.menu.dosfs.sdspi.build.dosfs_sdcard=1
Grasshopper-L082CZ.menu.dosfs.sdspi.build.dosfs_sflash=0
Grasshopper-L082CZ.menu.dosfs.sfspi=SFLASH (SPI)
Grasshopper-L082CZ.menu.dosfs.sfspi.build.dosfs_sdcard=0
Grasshopper-L082CZ.menu.dosfs.sfspi.build.dosfs_sflash=1

Grasshopper-L082CZ.menu.speed.32=32 MHz
Grasshopper-L082CZ.menu.speed.32.build.f_cpu=32000000L
Expand Down
7 changes: 6 additions & 1 deletion variants/Grasshopper-L082CZ/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern const PinDescription g_APinDescription[PINS_COUNT] =
{ NULL, 0, STM32L0_GPIO_PIN_NONE, 0, PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_CHANNEL_NONE },
{ GPIOA, STM32L0_GPIO_PIN_MASK(STM32L0_GPIO_PIN_PA13), STM32L0_GPIO_PIN_PA13, (PIN_ATTR_SWD | PIN_ATTR_EXTI), PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_CHANNEL_NONE },
{ GPIOA, STM32L0_GPIO_PIN_MASK(STM32L0_GPIO_PIN_PA14), STM32L0_GPIO_PIN_PA14, (PIN_ATTR_SWD | PIN_ATTR_EXTI), PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_CHANNEL_NONE },
#if (DOSFS_SDCARD >= 1)
#if (DOSFS_SDCARD >= 1) || (DOSFS_SFLASH >= 1)
{ NULL, STM32L0_GPIO_PIN_MASK(STM32L0_GPIO_PIN_PB12), STM32L0_GPIO_PIN_PB12, (PIN_ATTR_EXTI), PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_CHANNEL_NONE },
{ NULL, STM32L0_GPIO_PIN_MASK(STM32L0_GPIO_PIN_PB15), STM32L0_GPIO_PIN_PB15, (PIN_ATTR_EXTI), PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_CHANNEL_NONE },
{ NULL, STM32L0_GPIO_PIN_MASK(STM32L0_GPIO_PIN_PB14), STM32L0_GPIO_PIN_PB14, (PIN_ATTR_EXTI), PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_CHANNEL_NONE },
Expand Down Expand Up @@ -167,6 +167,11 @@ extern const stm32l0_sdspi_params_t g_SDSPIParams = {
STM32L0_GPIO_PIN_PB12,
};


extern const stm32l0_sfspi_params_t g_SFSPIParams = {
STM32L0_GPIO_PIN_PB12,
};

void initVariant()
{
CMWX1ZZABZ_Initialize(STM32L0_GPIO_PIN_PH1, STM32L0_GPIO_PIN_NONE);
Expand Down
2 changes: 2 additions & 0 deletions variants/Grasshopper-L082CZ/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#define STM32L0_CONFIG_PIN_VBUS STM32L0_GPIO_PIN_PA8
#define STM32L0_CONFIG_ANTENNA_GAIN -2.5f

#define STM32L0_CONFIG_SFLASH_DATA_START (256 * 1024)

#define USBCON

/** Master clock frequency */
Expand Down

0 comments on commit e2212a4

Please sign in to comment.