void?SPI0_Init(void) { ????GPIOB_SetBits(bSCK0); //????GPIOPinRemap(ENABLE,?RB_PIN_UART1); ????GPIOB_ModeCfg(bAIN6,?GPIO_ModeIN_PU); ????GPIOB_ModeCfg(bSCK0,?GPIO_ModeOut_PP_20mA); //????UART1_DefInit(); ????DelayMs(100); ????/*?SPI?0?*/ ????GPIOA_SetBits(bAIN6); ????GPIOA_ModeCfg(bAIN6?|?bSCK0?|?bMOSI,?GPIO_ModeOut_PP_20mA); ????//SPI0_MasterDefInit(); ????R8_SPI0_CLOCK_DIV?=?4;?//?主頻時鐘4分頻 ????R8_SPI0_CTRL_MOD?=?RB_SPI_ALL_CLEAR; ????R8_SPI0_CTRL_MOD?=?RB_SPI_MOSI_OE?|?RB_SPI_SCK_OE; ????R8_SPI0_CTRL_CFG?|=?RB_SPI_AUTO_IF;?????//?訪問BUFFER/FIFO自動清除IF_BYTE_END標(biāo)志 //????R8_SPI0_CTRL_CFG?&=?~RB_SPI_DMA_ENABLE; } void?LCD_FlashPicture(uint16_t?sx,uint16_t?sy,uint16_t?x_size,uint16_t?y_size,uint32_t?addr) { ????uint32_t?pack_size?=?x_size?*?y_size; ????????LCD_SetWindows(0,0,127,127); ????????//?DMA?連續(xù)發(fā)送 ????????GPIOA_ResetBits(bAIN6); ????????SPI0_MasterDMATrans((uint8_t?*)&addr,?pack_size); ????????GPIOA_SetBits(bAIN6); ????????DelayMs(2); }
我用
SPI0_MasterDMATrans
這個函數(shù)發(fā)送數(shù)據(jù),結(jié)果,LCD屏幕沒有顯示數(shù)據(jù),很奇怪,求解惑
熱門產(chǎn)品 :
CH397: 高集成度、低功耗USB網(wǎng)卡芯片