Skip to content

Commit 9c72e5b

Browse files
authored
Merge pull request #8 from shaoguoji/stm32
适配新 bsp 框架
2 parents 7e55efe + 5f6c3df commit 9c72e5b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

example/rw007_stm32_port.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,15 @@ static void set_rw007_mode(int mode)
3636
int wifi_spi_device_init(void)
3737
{
3838
char sn_version[32];
39+
40+
GPIO_TypeDef *cs_gpiox;
41+
uint16_t cs_pin;
42+
43+
cs_gpiox = (GPIO_TypeDef *)((rt_base_t)GPIOA + (rt_base_t)(RW007_CS_PIN / 16) * 0x0400UL);
44+
cs_pin = (uint16_t)(1 << RW007_CS_PIN % 16);
45+
3946
set_rw007_mode(RW007_SPI_MODE);
40-
stm32_spi_bus_attach_device(RW007_CS_PIN, RW007_SPI_BUS_NAME, "wspi");
47+
rt_hw_spi_device_attach(RW007_SPI_BUS_NAME, "wspi", cs_gpiox, cs_pin);
4148
rt_hw_wifi_init("wspi");
4249

4350

0 commit comments

Comments
 (0)