完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
|
相关推荐
4 个讨论
|
|
使用蓝牙串口连接在UART1上,可是发不回数据, #include #include #include "inc/hw_ints.h" #include "inc/hw_memmap.h" #include "driverlib/debug.h" #include "driverlib/fpu.h" #include "driverlib/gpio.h" #include "driverlib/interrupt.h" #include "driverlib/pin_map.h" #include "driverlib/rom.h" #include "driverlib/sysctl.h" #include "driverlib/uart.h" //***************************************************************************** // // The UART interrupt handler. // //***************************************************************************** void UARTIntHandler(void) [ uint32_t ui32Status; // // Get the interrrupt status. // ui32Status = UARTIntStatus(UART1_BASE, true); // // Clear the asserted interrupts. // UARTIntClear(UART1_BASE, ui32Status); // // Loop while there are characters in the receive FIFO. // while(UARTCharsAvail(UART1_BASE)) [ // // Read the next character from the UART and write it back to the UART. // UARTCharPutNonBlocking(UART1_BASE, UARTCharGetNonBlocking(UART1_BASE)); // // Blink the LED to show a character transfer is occuring. // GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2); // // Delay for 1 millisecond. Each SysCtlDelay is about 3 clocks. // SysCtlDelay(SysCtlClockGet() / (1000 * 3)); // // Turn off the LED // GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0); ] ] //***************************************************************************** // // Send a string to the UART. // //***************************************************************************** void UARTSend(const uint8_t *pui8Buffer, uint32_t ui32Count) [ // // Loop while there are more characters to send. // while(ui32Count--) [ // // Write the next character to the UART. // UARTCharPutNonBlocking(UART1_BASE, *pui8Buffer++); ] ] //***************************************************************************** // // This example demonstrates how to send a string of data to the UART. // //***************************************************************************** int main(void) [ // // Enable lazy stacking for interrupt handlers. This allows floating-point // instructions to be used within interrupt handlers, but at the expense of // extra stack usage. // FPUEnable(); FPULazyStackingEnable(); // // Set the clocking to run directly from the crystal. // SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); // // Enable the GPIO port that is used for the on-board LED. // SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // // Enable the GPIO pins for the LED (PF2). // GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2); // // Enable the peripherals used by this example. // SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); // // Enable processor interrupts. // IntMasterEnable(); // // Set GPIO A0 and A1 as UART pins. // GPIOPinConfigure(GPIO_PB0_U1RX); GPIOPinConfigure(GPIO_PB1_U1TX); GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); // // Configure the UART for 115,200, 8-N-1 operation. // UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); // // Enable the UART interrupt. // IntEnable(INT_UART1); UARTIntEnable(UART1_BASE, UART_INT_RX | UART_INT_RT); // // Prompt for text to be entered. // UARTSend((uint8_t *)" 33[2JEnter text: ", 16); // // Loop forever echoing data through the UART. // while(1) [ UARTSend((uint8_t *)" 33[2JEnter text: ", 16); ] ] |
|
|
|
|
|
只有小组成员才能发言,加入小组>>
TMS320F28377D:新做了以377d为芯片的板子,上电后芯片复位引脚出现方波请问如何解决?
1888 浏览 0 评论
TPS55340通电后输入端保险丝烧断,芯片输入和GND之间短路
3641 浏览 4 评论
5027 浏览 0 评论
请问如何用DM368对RGB格式的图片数据进行编码生成JPEG格式图片?
1732 浏览 1 评论
9353 浏览 8 评论
CC3100BOOST使用CC3200lunchXL进行烧录
664浏览 2评论
707浏览 1评论
TMS320F28034: 利用C2prog通过SCI给TMS320F28034烧录程序,出现错误提示:Bootloading... failed (invalid echo)!
668浏览 1评论
1186浏览 1评论
求DLPC350 Programmer’s Guide User's Guide 中文版说明书
1189浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-20 00:32 , Processed in 0.708367 second(s), Total 66, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号