完善资料让更多小伙伴认识你,还能领取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); ] |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
553 浏览 0 评论
1616 浏览 0 评论
2049 浏览 0 评论
为啥BQ7693003DBTR芯片在和BQ769X0盒子通讯时收不到信号?
1516 浏览 0 评论
DSP 28027F 开发板 XDS100v2调试探针诊断日志显示了 Error -150 (SC_ERR_FTDI_FAIL)如何解决
1343 浏览 0 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
1759浏览 29评论
2787浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
1726浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
1637浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
1647浏览 13评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 06:17 , Processed in 0.782386 second(s), Total 59, Slave 47 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2712