完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
|
相关推荐
4 个讨论
|
|
这个函数是在utilsuartstdio.c中实现的。
//***************************************************************************** // //! Configures the UART console. //! //! param ui32PortNum is the number of UART port to use for the serial console //! (0-2) //! param ui32Baud is the bit rate that the UART is to be configured to use. //! param ui32SrcClock is the frequency of the source clock for the UART //! module. //! //! This function will configure the specified serial port to be used as a //! serial console. The serial parameters are set to the baud rate //! specified by the e ui32Baud parameter and use 8 bit, no parity, and 1 stop //! bit. //! //! This function must be called prior to using any of the other UART console //! functions: UARTprintf() or UARTgets(). This function assumes that the //! caller has previously configured the relevant UART pins for operation as a //! UART rather than as GPIOs. //! //! return None. // //***************************************************************************** void UARTStdioConfig(uint32_t ui32PortNum, uint32_t ui32Baud, uint32_t ui32SrcClock) [ // // Check the arguments. // ASSERT((ui32PortNum == 0) || (ui32PortNum == 1) || (ui32PortNum == 2)); #ifdef UART_BUFFERED // // In buffered mode, we only allow a single instance to be opened. // ASSERT(g_ui32Base == 0); #endif // // Check to make sure the UART peripheral is present. // if(!MAP_SysCtlPeripheralPresent(g_ui32UARTPeriph[ui32PortNum])) [ return; ] // // Select the base address of the UART. // g_ui32Base = g_ui32UARTBase[ui32PortNum]; // // Enable the UART peripheral for use. // MAP_SysCtlPeripheralEnable(g_ui32UARTPeriph[ui32PortNum]); // // Configure the UART for 115200, n, 8, 1 // MAP_UARTConfigSetExpClk(g_ui32Base, ui32SrcClock, ui32Baud, (UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE | UART_CONFIG_WLEN_8)); #ifdef UART_BUFFERED // // Set the UART to interrupt whenever the TX FIFO is almost empty or // when any character is received. // MAP_UARTFIFOLevelSet(g_ui32Base, UART_FIFO_TX1_8, UART_FIFO_RX1_8); // // Flush both the buffers. // UARTFlushRx(); UARTFlushTx(true); // // Remember which interrupt we are dealing with. // g_ui32PortNum = ui32PortNum; // // We are configured for buffered output so enable the master interrupt // for this UART and the receive interrupts. We don't actually enable the // transmit interrupt in the UART itself until some data has been placed // in the transmit buffer. // MAP_UARTIntDisable(g_ui32Base, 0xFFFFFFFF); MAP_UARTIntEnable(g_ui32Base, UART_INT_RX | UART_INT_RT); MAP_IntEnable(g_ui32UARTInt[ui32PortNum]); #endif // // Enable the UART operation. // MAP_UARTEnable(g_ui32Base); ] |
|
|
|
|
|
只有小组成员才能发言,加入小组>>
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-19 22:44 , Processed in 0.405845 second(s), Total 43, Slave 38 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号