diff --git a/boards.txt b/boards.txt index 0ca2dd00..0c084f62 100644 --- a/boards.txt +++ b/boards.txt @@ -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 diff --git a/variants/Grasshopper-L082CZ/variant.cpp b/variants/Grasshopper-L082CZ/variant.cpp index bb332b4c..451b8e3b 100644 --- a/variants/Grasshopper-L082CZ/variant.cpp +++ b/variants/Grasshopper-L082CZ/variant.cpp @@ -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 }, @@ -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); diff --git a/variants/Grasshopper-L082CZ/variant.h b/variants/Grasshopper-L082CZ/variant.h index 23318a28..c495f3b9 100644 --- a/variants/Grasshopper-L082CZ/variant.h +++ b/variants/Grasshopper-L082CZ/variant.h @@ -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 */