STM8 SPI主机

    xiaoxiao2025-06-14  19

    硬件平台:stm8s103 编译环境:IAR for stm8

    //spi初始化 void spiMasterIint(void) { SPI->CR1 = 0x2c; SPI->CR2 = 0x03; SPI->CRCPR = 0x07; SPI->CR1 |= 0x40; } spi接收发送 unsigned char spiRW(unsignde char date) { while(!(SPI->SR&0x02)); SPI->DR = data; while(!(SPI->SR&0x01)); return SPI->DR; }
    转载请注明原文地址: https://ju.6miu.com/read-1299954.html
    最新回复(0)