这篇教程C++ GPIOPinTypeUART函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GPIOPinTypeUART函数的典型用法代码示例。如果您正苦于以下问题:C++ GPIOPinTypeUART函数的具体用法?C++ GPIOPinTypeUART怎么用?C++ GPIOPinTypeUART使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GPIOPinTypeUART函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: SetupUartTask/** * /fn SetupUartTask * /brief Setup UART tasks. * * Task has priority 15 and receives 1kB of stack. * * /return Always 0. In case of error the system halts. */int SetupUartTask(void) { Task_Params taskTransferParams; Task_Handle taskTransfer; Error_Block eb; /* Enable and configure the peripherals used by the UART7 */ SysCtlPeripheralEnable(GPIO_PORTC_BASE); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7); GPIOPinConfigure(GPIO_PC4_U7RX); GPIOPinConfigure(GPIO_PC5_U7TX); GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5); /* Enable and configure the peripherals used by the UART6 */ SysCtlPeripheralEnable(GPIO_PORTP_BASE); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART6); GPIOPinConfigure(GPIO_PP0_U6RX); GPIOPinConfigure(GPIO_PP1_U6TX); GPIOPinTypeUART(GPIO_PORTP_BASE, GPIO_PIN_0 | GPIO_PIN_1); UART_init(); InitializeLedUserSwitch(); Error_init(&eb); Task_Params_init(&taskTransferParams); taskTransferParams.stackSize = 1024; taskTransferParams.priority = 15; taskTransfer = Task_create((Task_FuncPtr) TransferFunction, &taskTransferParams, &eb); if (taskTransfer == NULL) { System_abort("UART task create failed"); } return (0);}
开发者ID:Komisa72,项目名称:ese_wheaterstation_2016,代码行数:43,
示例2: ConfigureUART//*****************************************************************************//// Configure the UART and its pins. This must be called before UARTprintf().////*****************************************************************************voidConfigureUART(void){ // // Enable the GPIO Peripheral used by the UART. // SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // // Enable UART0 // SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); // // Configure GPIO Pins for UART mode. // GPIOPinConfigure(GPIO_PB0_U1RX); GPIOPinConfigure(GPIO_PB1_U1TX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); // // Use the internal 16MHz oscillator as the UART clock source. // UARTClockSourceSet(UART1_BASE, UART_CLOCK_PIOSC); UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC); // // Initialize the UART for console I/O. // UARTStdioConfig(0, 115200, 16000000);}
开发者ID:rheostat2718,项目名称:mpu9150_driver,代码行数:38,
示例3: bsp_gpio_initstatic voidbsp_gpio_init(void){ int32_t i; SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); for (i = 0; i < ARRAY_SIZE(the_inout_iomap); i++) { if (the_inout_iomap[i].mode == IO_INPUT) { GPIODirModeSet(the_inout_iomap[i].gpiobase, the_inout_iomap[i].pinno, GPIO_DIR_MODE_IN); } else { GPIODirModeSet(the_inout_iomap[i].gpiobase, the_inout_iomap[i].pinno, GPIO_DIR_MODE_OUT); GPIOPadConfigSet(the_inout_iomap[i].gpiobase, the_inout_iomap[i].pinno, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD); } } sys_gpio_bspInstall(bsp_gpio_cfg, bsp_gpio_read, bsp_gpio_write); /* 设置uart0、1模式 */ GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_2 | GPIO_PIN_3); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);}
开发者ID:liuning587,项目名称:rtos_811,代码行数:32,
示例4: Init/************************************************************************************//**** /brief Initializes the microcontroller. ** /return none.******************************************************************************************/static void Init(void){ /* set the clocking to run at 50MHz from the PLL */ SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);#if (BOOT_COM_UART_ENABLE > 0) #if (BOOT_COM_UART_CHANNEL_INDEX == 0) /* enable and configure UART0 related peripherals and pins */ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); #endif#elif (BOOT_FILE_LOGGING_ENABLE > 0) /* log info strings to UART during firmware updates from local file storage */ /* enable and configure UART0 related peripherals and pins */ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); /* enable the UART0 peripheral */ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); /* configure the UART0 baudrate and communication parameters */ UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 57600, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));#endif#if (BOOT_COM_USB_ENABLE > 0) /* enable the GPIO peripheral used for USB, and configure the USB pins */ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL); GPIOPinTypeUSBAnalog(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); GPIOPinTypeUSBAnalog(GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7);#endif /* enable the GPIO port to which the SELECT button is connected */ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM); /* configure the SELECT button pin as an input with pull-up */ GPIODirModeSet(GPIO_PORTM_BASE, GPIO_PIN_4, GPIO_DIR_MODE_IN); GPIOPadConfigSet(GPIO_PORTM_BASE, GPIO_PIN_4, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);} /*** end of Init ***/
开发者ID:x893,项目名称:OpenBLT,代码行数:40,
示例5: commUartInitvoid commUartInit ( void ){ /*********** UART 0 ***************/ SysCtlPeripheralEnable ( SYSCTL_PERIPH_UART0 ); // // Set GPIO A0 and A1 as UART pins. // GPIOPinConfigure ( GPIO_PA0_U0RX ); GPIOPinConfigure ( GPIO_PA1_U0TX ); GPIOPinTypeUART ( GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1 ); UARTConfigSetExpClk ( UART0_BASE, SysCtlClockGet(), SPEED_UART_STD, ( UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE ) ); UARTFIFOEnable ( UART0_BASE ); UARTFIFOLevelSet ( UART0_BASE , UART_FIFO_TX4_8 , UART_FIFO_RX4_8 ); UARTIntEnable ( UART0_BASE, UART_INT_RX | UART_INT_RT ); /*********** UART 1 ***************/ SysCtlPeripheralEnable ( SYSCTL_PERIPH_UART1 ); // // Set GPIO D2 and D3 as UART pins. // GPIOPinConfigure ( GPIO_PD2_U1RX ); GPIOPinConfigure ( GPIO_PD3_U1TX ); GPIOPinTypeUART ( GPIO_PORTD_BASE, GPIO_PIN_2 | GPIO_PIN_3 ); UARTConfigSetExpClk ( UART1_BASE, SysCtlClockGet(), SPEED_UART_STD, ( UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE) ); UARTFIFOEnable ( UART1_BASE ); UARTFIFOLevelSet ( UART1_BASE , UART_FIFO_TX4_8 , UART_FIFO_RX4_8 ); UARTIntEnable ( UART1_BASE, UART_INT_RX | UART_INT_RT ); /*********** UART 2 ***************/ SysCtlPeripheralEnable ( SYSCTL_PERIPH_UART2 ); // // Set GPIO G0 and G1 as UART pins. // GPIOPinConfigure ( GPIO_PG0_U2RX ); GPIOPinConfigure ( GPIO_PG1_U2TX ); GPIOPinTypeUART ( GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1 ); UARTConfigSetExpClk ( UART2_BASE, SysCtlClockGet(), SPEED_UART_RS485, ( UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE ) ); UARTFIFOEnable ( UART2_BASE ); UARTFIFOLevelSet ( UART2_BASE , UART_FIFO_TX4_8 , UART_FIFO_RX4_8 ); UARTIntEnable ( UART2_BASE, UART_INT_RX | UART_INT_RT ); }
开发者ID:yanlunyao,项目名称:stm32_lwip_ucos_udp_test,代码行数:57,
示例6: cfgUARTvoid cfgUART(){ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); //UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); // 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); // // Enable UART0 so that we can configure the clock. // SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); // // Use the internal 16MHz oscillator as the UART clock source. // UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC); // // 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. // UARTStdioConfig(0, 115200, 16000000); IntMasterEnable(); //enable processor interrupts IntEnable(INT_UART0); //enable the UART interrupt UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT); //only enable RX and TX interrupts}
开发者ID:EDAyele,项目名称:tiva_arm_template,代码行数:51,
示例7: mainint main(void){ char cThisChar; SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL |SYSCTL_XTAL_16MHZ| SYSCTL_OSC_MAIN ); //Para el SW1 /*SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); GPIODirModeSet(GPIO_PORTF_BASE, 0xFF, GPIO_DIR_MODE_IN); GPIOPinIntEnable(GPIO_PORTB_BASE, 0xFF); IntEnable(INT_GPIOF);*/ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinConfigure(GPIO_PB0_U1RX); GPIOPinConfigure(GPIO_PB1_U1TX); GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 9600, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 9600, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); UARTFIFOLevelSet(UART1_BASE,UART_FIFO_TX7_8,UART_FIFO_RX7_8); UARTIntClear(UART1_BASE, UART_INT_TX | UART_INT_RX); UARTIntEnable(UART1_BASE, UART_INT_RX); UARTFIFOEnable(UART1_BASE); IntMasterEnable(); UARTEnable(UART1_BASE); IntEnable(INT_UART1); for(n=0; n<sizeof(buferA); n++){ UARTCharPut(UART1_BASE, buferA[n]);} for(m=0; m<sizeof(buferC); m++){ UARTCharPut(UART1_BASE, buferC[m]);} while(1){;}}
开发者ID:joseomar,项目名称:Proyectos_CCS-TI,代码行数:51,
示例8: EK_LM4F120XL_initUART/* * ======== EK_LM4F120XL_initUART ======== */Void EK_LM4F120XL_initUART(){ /* Enable and configure the peripherals used by the uart0. */ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); /* Enable and configure the peripherals used by the uart1. */ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); GPIOPinConfigure(GPIO_PB0_U1RX); GPIOPinConfigure(GPIO_PB1_U1TX); GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); /* Enable and configure the peripherals used by the uart2. */ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART2); HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY; HWREG(GPIO_PORTD_BASE + GPIO_O_CR) = 0x80; GPIOPinConfigure(GPIO_PD6_U2RX); GPIOPinConfigure(GPIO_PD7_U2TX); GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_6 | GPIO_PIN_7); /* Enable and configure the peripherals used by the uart3 and uart4. */ //UART 3 SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3); GPIOPinConfigure(GPIO_PC6_U3RX); GPIOPinConfigure(GPIO_PC7_U3TX); //UART 4 SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4); GPIOPinConfigure(GPIO_PC4_U4RX); GPIOPinConfigure(GPIO_PC5_U4TX); GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7); /* Enable and configure the peripherals used by the uart5. */ //UART 5 SysCtlPeripheralEnable(SYSCTL_PERIPH_UART5); GPIOPinConfigure(GPIO_PE4_U5RX); GPIOPinConfigure(GPIO_PE5_U5TX); //UART 7 SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7); GPIOPinConfigure(GPIO_PE0_U7RX); GPIOPinConfigure(GPIO_PE1_U7TX); GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5); /* Initialize the UART driver */ UART_init();}
开发者ID:kawfey,项目名称:motherboard,代码行数:51,
示例9: mainint main(void){ //FRESULT rc; SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_PLL |SYSCTL_XTAL_16MHZ| SYSCTL_OSC_MAIN ); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinConfigure(GPIO_PB0_U1RX); GPIOPinConfigure(GPIO_PB1_U1TX); GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 9600, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 9600, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); //rc = f_mount(0, &Fatfs); //rc = f_open(&Fil, "HELLO.TXT", FA_WRITE | FA_CREATE_ALWAYS); UARTFIFOLevelSet(UART1_BASE,UART_FIFO_TX7_8,UART_FIFO_RX7_8); //fijo los umbrales para la ocurrencia de la interrupcion //UARTTxIntModeSet(UART1_BASE, UART_TXINT_MODE_FIFO); // Habilito la interrupcion //IntRegister(UART1_BASE, UARTinterrupcion); //UARTIntRegister(UART1_BASE, UARTinterrupcion); //registra un manejador de interrupciones para la interrupcion de la UART UARTIntClear(UART1_BASE, UART_INT_TX | UART_INT_RX); //limpia los flags de interrupcion UARTIntEnable(UART1_BASE, UART_INT_RX); UARTFIFOEnable(UART1_BASE); IntMasterEnable(); UARTEnable(UART1_BASE); //habilita transmision y recepcion IntEnable(INT_UART1); //habilita las fuentes de interrupcion de la UART while(1){;}}
开发者ID:joseomar,项目名称:Proyectos_CCS-TI,代码行数:48,
示例10: platform_uart_setupu32 platform_uart_setup( unsigned id, u32 baud, int databits, int parity, int stopbits ){ u32 config; GPIOPinTypeUART(uart_gpio_base [ id ], uart_gpio_pins[ id ]); switch( databits ) { case 5: config = UART_CONFIG_WLEN_5; break; case 6: config = UART_CONFIG_WLEN_6; break; case 7: config = UART_CONFIG_WLEN_7; break; default: config = UART_CONFIG_WLEN_8; break; } config |= ( stopbits == PLATFORM_UART_STOPBITS_1 ) ? UART_CONFIG_STOP_ONE : UART_CONFIG_STOP_TWO; if( parity == PLATFORM_UART_PARITY_EVEN ) config |= UART_CONFIG_PAR_EVEN; else if( parity == PLATFORM_UART_PARITY_ODD ) config |= UART_CONFIG_PAR_ODD; else config |= UART_CONFIG_PAR_NONE; return UARTConfigSetExpClk(uart_base[ id ], SysCtlClockGet(), baud, config);}
开发者ID:BackupTheBerlios,项目名称:elua-svn,代码行数:31,
示例11: initUartPins/** * @brief Función para inicializar los PINS de la UART. * * @return - * * Inicializa los PINs para poder usar la UART.*/static void initUartPins(int nPort){ switch(nPort) { case 0: SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); break; case 1: SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_2 | GPIO_PIN_3); break; default: break; }}
开发者ID:ikerexxe,项目名称:BroadCar,代码行数:23,
示例12: uarts_initstatic void uarts_init(){ unsigned i; for( i = 0; i < NUM_UART; i ++ ) SysCtlPeripheralEnable(uart_sysctl[ i ]); // Special case for UART 0 // Configure the UART for 115,200, 8-N-1 operation. GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), CON_UART_SPEED, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); #if defined( BUF_ENABLE_UART ) && defined( CON_BUF_SIZE ) // Enable buffering on the console UART buf_set( BUF_ID_UART, CON_UART_ID, CON_BUF_SIZE, BUF_DSIZE_U8 ); // Set interrupt handler and interrupt flag on UART IntEnable(INT_UART0); UARTIntEnable( uart_base[ CON_UART_ID ], UART_INT_RX | UART_INT_RT );#endif}
开发者ID:BackupTheBerlios,项目名称:elua-svn,代码行数:25,
示例13: UpdateUARTInit//*****************************************************************************//// Initializes the UART update interface.////*****************************************************************************voidUpdateUARTInit(void){ // // Set the flash programming speed based on the processor speed. // FlashUsecSet(50); // // Enable the peripherals used by the UART. // SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); // // Configure the UART Tx and Rx pins for use by the UART. // GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); // // Configure and enable the UART for 115,200, 8-N-1 operation. // UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); UARTEnable(UART0_BASE); // // Enable the UART receive interrupts. // UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT); IntEnable(INT_UART0);}
开发者ID:yangjunjiao,项目名称:Luminary-Micro-Library,代码行数:38,
示例14: mainint main(void) { SysCtlClockSet( SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC); UARTStdioConfig(0, 115200, 16000000); ADCSequenceDisable(ADC0_BASE, 1); ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0); ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 1, 3, ADC_CTL_TS | ADC_CTL_IE | ADC_CTL_END); ADCSequenceEnable(ADC0_BASE, 1); UARTprintf("This is ADC examlpe"); while (1) { UARTprintf("Temperature is: %d /210 C/n", ADC_getVal()); SysCtlDelay(40000000 / 3); }}
开发者ID:datho1801,项目名称:TivaC_TUT,代码行数:30,
示例15: LogInit//*****************************************************************************//// Initializes the logging interface.////*****************************************************************************voidLogInit(void){ // // Enable the peripherals used to perform logging. // SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); // // Configure the UART pins appropriately. // GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_2 | GPIO_PIN_3); // // 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)); UARTEnable(UART1_BASE); // // Enable the UART interrupt. // UARTIntEnable(UART1_BASE, UART_INT_TX); IntEnable(INT_UART1); // // Write a log message to indicate that the application has started. // LogWrite("Application started");}
开发者ID:VENGEL,项目名称:StellarisWare,代码行数:38,
示例16: PSO_UART0Config/****************************************************************************** * UART-0 Configuration VCP (Virtual Com Port) * ---------------------------------------------------------------------------- * UART 0 -> Port A -> Pins PA0(Tx) & PA1(Rx) * 9600-8N1 * ******************************************************************************/void PSO_UART0Config(){ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); /* Enable UART Module 0 */ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); /* Enable GPIO Port A for UART-0 use */ GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE); /* UART-0 interrupt configuration */ UARTDisable(UART0_BASE); UARTFIFOEnable(UART0_BASE); IntEnable(INT_UART0); UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX1_8, UART_FIFO_RX7_8); UARTIntEnable(UART0_BASE, UART_INT_RX); // | UART_INT_RT UARTEnable(UART0_BASE); UARTFIFOEnable(UART0_BASE);}
开发者ID:monkaco,项目名称:PSO,代码行数:32,
示例17: UART3_Initvoid UART3_Init(){ //Enable the UART0 and GPIOC peripherals (the UART2 pins are on GPIO Port C) SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); GPIOPinConfigure(GPIO_PC6_U3RX); GPIOPinConfigure(GPIO_PC7_U3TX); GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_6 | GPIO_PIN_7); //Initialize the parameters for the UART: baud_rate, 8-1-N UARTConfigSetExpClk(UART3_BASE, SysCtlClockGet(), BAUD_RATE, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); //The receiver timeout interrupt is IntMasterEnable(); //enable processor interrupts IntEnable(INT_UART3); //enable the UART3 interrupt /* * receiver interrupts (RX) - generated when a single character has been received (when FIFO is disabled) * or when the specified FIFO level has been reached (when FIFO is enabled) * receiver timeout interrupts (RT) - generated when a character has been received, * and a second character has not been received within a 32-bit period. */ UARTIntEnable(UART3_BASE, UART_INT_RX | UART_INT_RT);}
开发者ID:PaulinaSadowska,项目名称:INZ_UART3_bluetooth_demo,代码行数:25,
示例18: LogInit//*****************************************************************************//// Initializes the logging interface.////*****************************************************************************voidLogInit(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,
示例19: ConfigureXBeeUARTvoid ConfigureXBeeUART(void) { // // Enable the GPIO Peripheral used by the UART. // SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); // // Enable UART2 // SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3); // // Configure GPIO Pins for UART mode. // GPIOPinConfigure(GPIO_PC6_U3RX); GPIOPinConfigure(GPIO_PC7_U3TX); GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_6 | GPIO_PIN_7); // // Use the internal 16MHz oscillator as the UART clock source. // UARTClockSourceSet(UART3_BASE, UART_CLOCK_PIOSC); UARTConfigSetExpClk(UART3_BASE, 16000000, SERIAL_SPEED, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); UARTEnable(UART3_BASE);}
开发者ID:Teider,项目名称:QuIES,代码行数:29,
示例20: mainint main(void){ /*Set the clocking to directly run from the crystal at 8MHz*/ SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); 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); /* Sets the configuration of a UART. */ UARTConfigSetExpClk(UART0_BASE, 8000000, 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); while(1) { if(UARTCharsAvail(UART0_BASE)) { /* Unsigned Char */ UARTCharPut(UART0_BASE,(unsigned char)(UARTCharGet(UART0_BASE)+1)); } }}
开发者ID:dhanawadeamit,项目名称:stellaris-guru,代码行数:27,
示例21: uartInitRs485void uartInitRs485(void){ unsigned long cfg = 0; SysCtlPeripheralEnable ( SYSCTL_PERIPH_UART2 ); // // Set GPIO A0 and A1 as UART pins. // GPIOPinConfigure ( GPIO_PG0_U2RX ); GPIOPinConfigure ( GPIO_PG1_U2TX ); GPIOPinTypeUART ( GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1 ); //GPIOPadConfigSet ( GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU ); cfg = UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE ; if (SysParam[SP_CHECKBIT] == 0x02) { cfg &= ~ UART_CONFIG_PAR_MASK; cfg |= UART_CONFIG_PAR_EVEN; } UARTConfigSetExpClk ( UART2_BASE, SysCtlClockGet(), BaudRateTable[SysParam[SP_BAUDRATE]], cfg); UARTFIFOEnable ( UART2_BASE ); UARTFIFOLevelSet ( UART2_BASE , UART_FIFO_TX4_8 , UART_FIFO_RX1_8 ); UARTIntEnable ( UART2_BASE, UART_INT_RX | UART_INT_RT );}
开发者ID:yanlunyao,项目名称:stm32_lwip_ucos_udp_test,代码行数:29,
示例22: portInit2void 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,
示例23: zigbee_initint zigbee_init(unsigned long baud){ int result; charZigbee.TxQueueLength = 10; charZigbee.RxQueueLength = 20; charZigbee.QueueWait = 0; charZigbee.PortBase = UART2_BASE; result = prepare_device(&charZigbee); if(result){ printf("Zigbee queue creation fail/n"); return result; } SysCtlPeripheralEnable(SYSCTL_PERIPH_UART2); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG); GPIOPinTypeUART(GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTConfigSetExpClk(UART2_BASE, SysCtlClockGet(), baud, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); IntRegister(INT_UART2, zigbee_isr); UARTIntDisable(UART2_BASE, 0xFFFFFFFF); IntPrioritySet(INT_UART2,configKERNEL_INTERRUPT_PRIORITY); IntEnable(INT_UART2); UARTEnable(UART2_BASE); UARTFIFODisable(UART2_BASE); UARTIntEnable(UART2_BASE, UART_INT_TX | UART_INT_RX); return result;}
开发者ID:Duiesel,项目名称:thebirdfree-personal,代码行数:34,
示例24: dev_lm3s_uart_0_load/*--------------------------------------------| Name: dev_lm3s_uart_0_load| Description: | Parameters: none| Return Type: none| Comments: inspired from embOS demo code "Start_LM3S9B96"| See: ----------------------------------------------*/static int dev_lm3s_uart_0_load(void){#ifdef DEV_LM3S_UART_STATIC_MALLOC board_inf_uart_0.uart_nb = DEV_LM3S_UART_NO; board_inf_uart_0.base_address = UART0_BASE; p_board_inf_uart_list[DEV_LM3S_UART_NO] = &board_inf_uart_0;#endif // // Enable the peripherals used by this example. // The UART itself needs to be enabled, as well as the GPIO port // containing the pins that will be used. // SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // // Configure the GPIO pin muxing for the UART function. // This is only necessary if your part supports GPIO pin function muxing. // Study the data sheet to see which functions are allocated per pin. // TODO: change this to select the port/pin you are using // GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); // // Since GPIO A0 and A1 are used for the UART function, they must be // configured for use as a peripheral function (instead of GPIO). // TODO: change this to match the port/pin you are using // GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); // if(dev_lm3s_uart_x_load(DEV_LM3S_UART_NO)<0) return -1; return 0;}
开发者ID:lepton-distribution,项目名称:lepton,代码行数:43,
示例25: mainint main(void) { SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_SYSDIV_5| SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0); ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS); ADCSequenceStepConfigure(ADC0_BASE,1,3,ADC_CTL_TS|ADC_CTL_IE|ADC_CTL_END); ADCSequenceEnable(ADC0_BASE, 1); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); ledPinConfig(); while (1) { Test2(); //print_temc(); SysCtlDelay(SysCtlClockGet()/3); }}
开发者ID:CS308-2016,项目名称:BinC,代码行数:27,
示例26: InitConsole//*****************************************************************************//// This function sets up UART0 to be used for a console to display information// as the example is running.////*****************************************************************************voidInitConsole(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,
示例27: mainint main(void){ My_Init(); Init_Timer(); Init_I2C(); Init_Sensors(); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1); ///////////////////////////////// SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); //enable GPIO port for LED GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2); //enable pin for LED PF2 UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); IntMasterEnable(); //enable processor interrupts IntEnable(INT_UART0); //enable the UART interrupt UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT); //only enable RX and TX interrupts///////////////////////////////// Kalman_Sim_initialize(); while(1) { Read_Accelerometer(); Calculate_Acc(); Read_Compass(); Compass_Heading(); Calculate_Compass(); Read_Gyro(); Calculate_Gyro(); fgyro[0] = sen_data.gyro_x; fgyro[1] = sen_data.gyro_y; fgyro[2] = sen_data.gyro_z; facc[0] = sen_data.accel_x; facc[1] = sen_data.accel_y; facc[2] = sen_data.accel_z; fmag[0] = sen_data.magnetom_x; fmag[1] = sen_data.magnetom_y; fmag[2] = sen_data.magnetom_z; Kalman_Sim_step(); data[0]=Out1[0]; data[1]=Out1[1]; data[2]=Out1[2]; Timer_CyRun(); }}
开发者ID:nemo1992,项目名称:9DOF,代码行数:59,
示例28: UART_Initvoid UART_Init(void){ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTStdioConfig(0,BAUD_RATE,50000000);}
开发者ID:jsnowboard,项目名称:EE-445L,代码行数:8,
示例29: setup_LCD//Setup LCD, Peripheral Enablevoid setup_LCD(){ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); GPIOPinConfigure(GPIO_PB1_U1TX); GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_1);}
开发者ID:phuongtg,项目名称:micro2-1,代码行数:9,
示例30: initializeUART/** * usage: this method sets up the environment to make sure the UART interface can be used * @method initializeUART * @author: patrik.szabo * @param *none* * @return *none* */void initializeUART() { SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UART_init();}
开发者ID:pszabo1,项目名称:altitude-click-tiva-board,代码行数:15,
注:本文中的GPIOPinTypeUART函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GPIOSetDir函数代码示例 C++ GPIOPinTypeSSI函数代码示例 |