当前位置: 首页>>代码示例>>C++>>正文


C++ UARTStdioInit函数代码示例

本文整理汇总了C++中UARTStdioInit函数的典型用法代码示例。如果您正苦于以下问题:C++ UARTStdioInit函数的具体用法?C++ UARTStdioInit怎么用?C++ UARTStdioInit使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UARTStdioInit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: portInit2

void portInit2()
{
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    SysCtlDelay(10); //delay by (3 * 10) 30 clock cycles
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    SysCtlDelay(10); //delay by (3 * 10) 30 clock cycles

    //IntMasterEnable(); //Temporarily put here

    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 9600,
    //                    (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
    //                     UART_CONFIG_PAR_NONE));


    // If interrupts are desired, then enable interrupts on this UART
    IntEnable(INT_UART0);
    UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
    UARTStdioInit(0);  //configures this UART0 as the uart to use for UARTprintf


    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    SysCtlDelay(10); //delay by (3 * 10) 30 clock cycles
    /* Outputs */
    GPIOPadConfigSet(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1), GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD);
    GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1));  //configure LEDs

    IntMasterEnable();



}
开发者ID:vtoanb,项目名称:msp430lioamaintain,代码行数:33,代码来源:hal_gw1.c

示例2: main

//*****************************************************************************
//
// This example application demonstrates the use of the timers to generate
// periodic interrupts.
//
//*****************************************************************************
int
main(void)
{
    //
    // Set the clocking to run directly from the crystal.
    //
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                       SYSCTL_XTAL_16MHZ);

    //
    // Initialize the UART and write status.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTStdioInit(0);
    UARTprintf("\033[2JTimers example\n");
    UARTprintf("T1: 0  T2: 0");

    //
    // Enable the peripherals used by this example.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);

    //
    // Enable processor interrupts.
    //
    ROM_IntMasterEnable();

    //
    // Configure the two 32-bit periodic timers.
    //
    ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
    ROM_TimerConfigure(TIMER1_BASE, TIMER_CFG_PERIODIC);
    ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, ROM_SysCtlClockGet());
    ROM_TimerLoadSet(TIMER1_BASE, TIMER_A, ROM_SysCtlClockGet() / 2);

    //
    // Setup the interrupts for the timer timeouts.
    //
    ROM_IntEnable(INT_TIMER0A);
    ROM_IntEnable(INT_TIMER1A);
    ROM_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    ROM_TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);

    //
    // Enable the timers.
    //
    ROM_TimerEnable(TIMER0_BASE, TIMER_A);
    ROM_TimerEnable(TIMER1_BASE, TIMER_A);

    //
    // Loop forever while the timers run.
    //
    while(1)
    {
    }
}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:66,代码来源:timers.c

示例3: main

/*
** Main Function.
*/
int main(void)
{
    unsigned char choice = 0;

    /* Enable the clocks for McSPI0 module.*/
    McSPI0ModuleClkConfig();

    /* Perform Pin-Muxing for SPI0 Instance.*/
    McSPIPinMuxSetup(0);

    /* Perform Pin-Muxing for CS0 of SPI0 Instance.*/
    McSPI0CSPinMuxSetup(MCSPI_CH_NUM);

    /* Initialize the UART utility functions.*/
    UARTStdioInit();

    /* Enable IRQ in CPSR.*/
    IntMasterIRQEnable();

    UARTPuts("Here the McSPI controller on the SOC communicates with ",-1);
    UARTPuts("the McSPI Flash.\r\n\r\n",-1);

    /* Initialize the EDMA3 instance.*/
    EDMA3Initialize();

    /* Request EDMA3CC for Tx and Rx channels for SPI0. */
    RequestEDMA3Channels();

    /* Set up the McSPI instance.*/
    McSPISetUp();

    /* Enable the SPI Flash for writing to it. */
    WriteEnable();

    UARTPuts("Do you want to erase a sector of the flash before writing to it ?.", -1);
    UARTPuts("\r\nInput y(Y)/n(N) to proceed.\r\n", -1);

    choice = UARTGetc();
    UARTPutc(choice);

    if(('y' == choice) || ('Y' == choice))
    {
        /* Erasing the specified sector of SPI Flash. */
        FlashSectorErase();
    }

    /* Enable the SPI Flash for writing to it. */
    WriteEnable();

    /* Write data of 1 page size into a page of Flash.*/
    FlashPageProgram();

    /* Read data of 1 page size from a page of flash.*/
    ReadFromFlash();

    /* Verify the data written to and read from Flash are same or not.*/
    VerifyData();

    while(1);
}
开发者ID:OS-Project,项目名称:Divers,代码行数:63,代码来源:mcspiFlash_edma.c

示例4: UIInit

//*****************************************************************************
//
//! Initializes the user interface.
//!
//! This function initializes the user interface modules (ethernet),
//! preparing them to operate.
//!
//! \return None.
//
//*****************************************************************************
void
UIInit(void)
{
	//
	// Initialize the UART.
	//
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	GPIOPinConfigure(GPIO_PA0_U0RX);
	GPIOPinConfigure(GPIO_PA1_U0TX);
	ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
	UARTStdioInit(0);
	UARTprintf("\033[2JEK-LM3S9B92 Plane-Power control board\n");
    
    //
    // Initialize the Ethernet user interface. Use DHCP
    //
    UIEthernetInit( true );

    //
    // Configure SysTick to provide a periodic user interface interrupt.
    //
    SysTickPeriodSet( ROM_SysCtlClockGet() / UI_INT_RATE );
    SysTickIntEnable();
    SysTickEnable();
}
开发者ID:drewm1980,项目名称:planepower,代码行数:35,代码来源:ui_common.c

示例5: main

//*****************************************************************************
//
// Print "Hello world!" to the UART on the Stellaris evaluation board.
//
//*****************************************************************************
int
main(void)
{
    //
    // Set the clocking to run directly from the crystal.
    //
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                       SYSCTL_XTAL_16MHZ);

    //
    // Initialize the UART.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTStdioInit(0);

    //
    // Hello!
    //
    UARTprintf("\033[2JHello World!\n");

    //
    // Finished.
    //
    while(1)
    {
    }
}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:35,代码来源:hello.c

示例6: InitConsole

//*****************************************************************************
//
// This function sets up UART0 to be used for a console to display information
// as the example is running.
//
//*****************************************************************************
void
InitConsole(void)
{
    //
    // Enable GPIO port A which is used for UART0 pins.
    // TODO: change this to whichever GPIO port you are using.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    //
    // Configure the pin muxing for UART0 functions on port A0 and A1.
    // This step is not necessary if your part does not support pin muxing.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);

    //
    // Select the alternate (UART) function for these pins.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Initialize the UART for console I/O.
    //
    UARTStdioInit(0);
}
开发者ID:taylor123454321,项目名称:c_control,代码行数:34,代码来源:pwm.c

示例7: init

void init()
{
    ROM_FPUEnable();
    ROM_FPULazyStackingEnable();

    ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    GPIO_PORTB_DIR_R = 0x00;
    GPIO_PORTB_DEN_R = 0xff;

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_GREEN|LED_BLUE);

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTStdioInit(0);

    ROM_SysTickPeriodSet(ROM_SysCtlClockGet() / 1000000);
    ROM_SysTickEnable();
    ROM_SysTickIntEnable();

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
    ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_32_BIT_PER);

    reset();
}
开发者ID:kred,项目名称:stellaris-logic-analyzer,代码行数:29,代码来源:main.c

示例8: LogInit

//*****************************************************************************
//
// Initializes the logging interface.
//
//*****************************************************************************
void
LogInit(void)
{
    //
    // Enable the peripherals used to perform logging.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    //
    // Configure the UART pins appropriately.
    //
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_1 | GPIO_PIN_0);

    //
    // Initialize the UART as a console for text I/O.
    //
    UARTStdioInit(0);

    //
    // Print hello message to user via the serial port.
    //
    UARTprintf("\n\nQuickstart Keypad Example Program\n");
    UARTprintf("Type \'help\' for help.\n");

    //
    // Write a log message to indicate that the application has started.
    //
    LogWrite("Application started");
}
开发者ID:VENGEL,项目名称:StellarisWare,代码行数:35,代码来源:log.c

示例9: uart_setup

static void uart_setup(void)
{
  ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
  ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
  ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
  ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
  UARTStdioInit(0);
}
开发者ID:Drooids,项目名称:nrf,代码行数:8,代码来源:main.c

示例10: SerialBegin

 // Serial
 virtual void SerialBegin(int serialDevice, int baudrate) {
     if (serialDevice == 0) {
         MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
         MAP_GPIOPinConfigure(GPIO_PA0_U0RX);
         MAP_GPIOPinConfigure(GPIO_PA1_U0TX);
         MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
         UARTStdioInit(0);
         UARTEnable(UART0_BASE);
     }
 }
开发者ID:bergie,项目名称:microflo,代码行数:11,代码来源:stellaris.hpp

示例11: UartInit

void UartInit(void)
{
    /* Enable GPIO port A which is used for UART0 pins. */
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    /* Make the UART pins be peripheral controlled. */
	GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    /* Initialize the UART for console I/O. */
    UARTStdioInit(0);
}
开发者ID:dhanawadeamit,项目名称:stellaris-guru,代码行数:12,代码来源:main.c

示例12: halUartInit

/** Initialize UART0 to use for stdio
 * @pre UART0 pins were configured
 */
void halUartInit()
{
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    PERIPHERAL_ENABLE_DELAY();
#ifdef TIVA
    //UARTStdioConfig(uint32_t ui32PortNum, uint32_t ui32Baud, uint32_t ui32SrcClock)
    UARTStdioConfig(0, 115200, SysCtlClockGet());
#else
    UARTStdioInit(0);  //configures this UART0 as the uart to use for UARTprintf
#endif
    IntEnable(INT_UART0);       // If interrupts are desired, then enable interrupts on this UART
    UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
}
开发者ID:vtoanb,项目名称:msp430lioamaintain,代码行数:16,代码来源:hal_ek-lm4f120XL.c

示例13: cmd_init

void cmd_init(void)
{
    //
    // Enable and Initialize the UART.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTStdioInit(0);

    cmd_printf("\nSplitAlarm - UART Loaded\n");
    cmd_printf("> ");
}
开发者ID:jamesmunns,项目名称:splitalarm,代码行数:14,代码来源:cmd.c

示例14: main

int main(void)
{
    unsigned int triggerValue = 0;

    /* Setup the MMU and do necessary MMU configurations. */
    MMUConfigAndEnable();

    /* Enable all levels of CACHE. */
    CacheEnable(CACHE_ALL);

    /* Set up the UART2 peripheral */
    UARTStdioInit();

    /* Enable the WDT clocks */
    WatchdogTimer1ModuleClkConfig();

    /* Reset the Watchdog Timer */
    WatchdogTimerReset(SOC_WDT_1_REGS);

    /* Disable the Watchdog timer */
    WatchdogTimerDisable(SOC_WDT_1_REGS);
                                               
    /* Perform the initial settings for the Watchdog Timer */
    WatchdogTimerSetUp();

    /* Send the message to UART console */
    UARTPuts("Program Reset!", -1);
    UARTPuts("Input any key at least once in every 4 seconds to avoid a further reset.\n\r", -1);

    /* Enable the Watchdog Timer */
    WatchdogTimerEnable(SOC_WDT_1_REGS);

    while(1)
    {
        /* Wait for an input through UART. If no input is given, 
        ** the WDT will timeout and reset will occur.
        */
        if(UARTGetc())
        {

            triggerValue += 1;

            /* Write into the trigger register. This will load the value from the 
            ** load register into the counter register and hence timer will start 
            ** from the initial count.
            */
            WatchdogTimerTriggerSet(SOC_WDT_1_REGS, triggerValue);
        }
    }
}
开发者ID:OS-Project,项目名称:Divers,代码行数:50,代码来源:wdtReset.c

示例15: init

//
//Initialization method
//
void init(void) {
	//Necessary inits for chip
	LockoutProtection();
	InitializeMCU();
	
	//Various driver inits
	//initUART
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);				
	GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);	
	UARTStdioInit(0);	

	//motors
	InitializeMotors(false, false);
}
开发者ID:achapp,项目名称:Rasware2009,代码行数:17,代码来源:regionV2012.c


注:本文中的UARTStdioInit函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。