完善资料让更多小伙伴认识你,还能领取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); ] |
|
|
|
|
|
只有小组成员才能发言,加入小组>>
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
683 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
599 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1054 浏览 1 评论
739 浏览 0 评论
普中科技F28335开发板每次上电复位后数码管都会显示,如何熄灭它?
524 浏览 1 评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
161浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
125浏览 14评论
在使用3254进行录音的时候出现一个奇怪的现象,右声道有吱吱声,请教一下,是否是什么寄存器设置存在问题?
126浏览 13评论
TLV320芯片内部自带数字滤波功能,请问linein进来的模拟信号是否是先经过ADC的超采样?
122浏览 12评论
TPA6304-Q1: TPA6304 两片公用一组I2C的话,其中一片配置不成功怎么办
168浏览 10评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 17:41 , Processed in 0.878171 second(s), Total 66, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号