Prusa MINI Firmware overview
|
◆ HAL_SPI_Init()
◆ HAL_SPI_DeInit()
◆ HAL_SPI_MspInit()
SPI MSP Initialization This function configures the hardware resources used in this example.
- Parameters
-
- Return values
-
SPI2 GPIO Configuration PC2 ---—> SPI2_MISO PC3 ---—> SPI2_MOSI PB10 ---—> SPI2_SCK
SPI3 GPIO Configuration PC10 ---—> SPI3_SCK PC11 ---—> SPI3_MISO PC12 ---—> SPI3_MOSI
273 GPIO_InitStruct.
Alternate = GPIO_AF5_SPI2;
280 GPIO_InitStruct.
Alternate = GPIO_AF5_SPI2;
304 }
else if (hspi->
Instance == SPI3) {
309 __HAL_RCC_SPI3_CLK_ENABLE();
321 GPIO_InitStruct.
Alternate = GPIO_AF6_SPI3;
◆ HAL_SPI_MspDeInit()
SPI MSP De-Initialization This function freeze the hardware resources used in this example.
- Parameters
-
- Return values
-
SPI2 GPIO Configuration PC2 ---—> SPI2_MISO PC3 ---—> SPI2_MOSI PB10 ---—> SPI2_SCK
SPI3 GPIO Configuration PC10 ---—> SPI3_SCK PC11 ---—> SPI3_MISO PC12 ---—> SPI3_MOSI
360 }
else if (hspi->
Instance == SPI3) {
365 __HAL_RCC_SPI3_CLK_DISABLE();
uint32_t PeriphDataAlignment
Definition: stm32f4xx_hal_dma.h:80
#define GPIO_MODE_AF_PP
Definition: stm32f4xx_hal_gpio.h:138
HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma)
#define DMA_CHANNEL_0
Definition: stm32f4xx_hal_dma.h:218
uint32_t PeriphInc
Definition: stm32f4xx_hal_dma.h:74
uint32_t FIFOMode
Definition: stm32f4xx_hal_dma.h:94
#define DMA_PRIORITY_MEDIUM
Definition: stm32f4xx_hal_dma.h:309
Definition: stm32f4xx_hal_def.h:57
DMA_Stream_TypeDef * Instance
Definition: stm32f4xx_hal_dma.h:157
SPI_TypeDef * Instance
Definition: stm32f4xx_hal_spi.h:122
uint32_t Mode
Definition: stm32f4xx_hal_gpio.h:68
#define __HAL_RCC_GPIOB_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:409
#define GPIO_PIN_2
Definition: stm32f4xx_hal_gpio.h:104
uint32_t Alternate
Definition: stm32f4xx_hal_gpio.h:77
uint32_t Pull
Definition: stm32f4xx_hal_gpio.h:71
#define FLASH_MOSI_Pin
Definition: main.h:175
void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
DMA_InitTypeDef Init
Definition: stm32f4xx_hal_dma.h:159
uint32_t Direction
Definition: stm32f4xx_hal_dma.h:70
uint32_t Priority
Definition: stm32f4xx_hal_dma.h:91
#define GPIO_PIN_10
Definition: stm32f4xx_hal_gpio.h:112
#define DMA_PINC_DISABLE
Definition: stm32f4xx_hal_dma.h:256
#define FLASH_MISO_Pin
Definition: main.h:173
#define DMA_MINC_ENABLE
Definition: stm32f4xx_hal_dma.h:265
#define FLASH_SCK_Pin
Definition: main.h:171
uint32_t MemInc
Definition: stm32f4xx_hal_dma.h:77
#define __HAL_RCC_SPI2_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:500
#define GPIO_PIN_3
Definition: stm32f4xx_hal_gpio.h:105
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
uint32_t Channel
Definition: stm32f4xx_hal_dma.h:67
#define GPIO_NOPULL
Definition: stm32f4xx_hal_gpio.h:170
#define GPIO_SPEED_FREQ_VERY_HIGH
Definition: stm32f4xx_hal_gpio.h:161
uint32_t Mode
Definition: stm32f4xx_hal_dma.h:86
#define DMA_MDATAALIGN_BYTE
Definition: stm32f4xx_hal_dma.h:286
#define DMA_FIFOMODE_DISABLE
Definition: stm32f4xx_hal_dma.h:320
#define __HAL_RCC_GPIOC_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:416
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.c:1057
DMA_HandleTypeDef hdma_spi2_tx
Definition: main.c:83
uint32_t Pin
Definition: stm32f4xx_hal_gpio.h:65
uint32_t Speed
Definition: stm32f4xx_hal_gpio.h:74
#define DMA_NORMAL
Definition: stm32f4xx_hal_dma.h:297
#define DMA_PDATAALIGN_BYTE
Definition: stm32f4xx_hal_dma.h:275
DMA_HandleTypeDef * hdmatx
Definition: stm32f4xx_hal_spi.h:142
uint32_t MemDataAlignment
Definition: stm32f4xx_hal_dma.h:83
#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__)
Definition: stm32f4xx_hal_def.h:81
#define DMA_MEMORY_TO_PERIPH
Definition: stm32f4xx_hal_dma.h:245
HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma)
#define __HAL_RCC_SPI2_CLK_DISABLE()
Definition: stm32f4xx_hal_rcc.h:538
GPIO Init structure definition.
Definition: stm32f4xx_hal_gpio.h:63