pikapython/bsp/w806/Demo/spi/wm_hal_msp.c
2022-03-28 17:19:25 +08:00

23 lines
474 B
C

#include "wm_hal.h"
void HAL_MspInit(void)
{
}
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
{
__HAL_RCC_SPI_CLK_ENABLE();
__HAL_AFIO_REMAP_SPI_CS(GPIOB, GPIO_PIN_4);
__HAL_AFIO_REMAP_SPI_CLK(GPIOB, GPIO_PIN_2);
__HAL_AFIO_REMAP_SPI_MISO(GPIOB, GPIO_PIN_3);
__HAL_AFIO_REMAP_SPI_MOSI(GPIOB, GPIO_PIN_5);
}
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
{
__HAL_RCC_SPI_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5);
}