这篇教程C++ stdio_serial_init函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中stdio_serial_init函数的典型用法代码示例。如果您正苦于以下问题:C++ stdio_serial_init函数的具体用法?C++ stdio_serial_init怎么用?C++ stdio_serial_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了stdio_serial_init函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: configure_consolestatic void configure_console(void) { sysclk_enable_peripheral_clock(PRINTF_USART_ID); //const usart_serial_options_t uart_serial_options = { .baudrate = CONF_UART_BAUDRATE, .paritytype = CONF_UART_PARITY, }; const usart_serial_options_t uart_serial_options = { .baudrate = USART_BAUDRATE, .charlength = USART_CHAR_LENGTH, .paritytype = USART_PARITY, .stopbits = false //US_MR_CHMODE_NORMAL }; usart_serial_init(PRINTF_USART, &uart_serial_options); stdio_serial_init(PRINTF_USART, &uart_serial_options); usart_enable_tx(PRINTF_USART); usart_enable_rx(PRINTF_USART);}int main(void) { sysclk_init(); board_init(); configure_console(); printf("CPH BaseStation v%d/r/n", 1); printf("create_uart_cli_task/r/n"); create_uart_cli_task(CONSOLE_UART, mainUART_CLI_TASK_STACK_SIZE, mainUART_CLI_TASK_PRIORITY);// printf("create_dialer_task/r/n");// create_dialer_task(mainDIALER_TASK_STACK_SIZE, mainDIALER_TASK_PRIORITY); printf("create_comm_task/r/n"); create_comm_task(mainCOMM_TASK_STACK_SIZE, mainCOMM_TASK_PRIORITY); printf("create_apptask_task/r/n"); create_app_task(mainAPPTASK_TASK_STACK_SIZE, mainAPPTASK_TASK_PRIORITY); printf("create_led_task/r/n"); create_led_task(); printf("starting task scheduler/r/n"); /* Start the scheduler. */ vTaskStartScheduler(); for (;;) { } /* Will only get here if there was insufficient memory to create the idle task. */ return 0;}
开发者ID:johncobb,项目名称:sam3x8e_lwip,代码行数:53,
示例2: main/** * /brief Run spinner widget unit tests */int main (void){ const usart_serial_options_t usart_serial_options = { .baudrate = CONF_TEST_BAUDRATE, .charlength = CONF_TEST_CHARLENGTH, .paritytype = CONF_TEST_PARITY, .stopbits = CONF_TEST_STOPBITS, }; sysclk_init(); board_init(); gfx_mono_init(); stdio_serial_init(CONF_TEST_USART, &usart_serial_options); // Define all the test cases DEFINE_TEST_CASE(single_spinner_spincollection_test, NULL, run_single_spinner_spincollection_test, NULL, "Single spinners in spincollection test"); DEFINE_TEST_CASE(two_spinners_spincollection_test, NULL, run_two_spinners_spincollection_test, NULL, "Two spinners in spincollection test"); DEFINE_TEST_CASE(three_spinners_spincollection_test, NULL, run_three_spinners_spincollection_test, NULL, "Three spinners in spincollection test"); DEFINE_TEST_CASE(cancel_spinner_spincollection_test, NULL, run_cancel_spinner_spincollection_test, NULL, "Cancel spinner choice test"); DEFINE_TEST_CASE(event_back_spincollection_test, NULL, run_event_back_spincollection_test, NULL, "Event back spincollection test"); // Put test case addresses in an array DEFINE_TEST_ARRAY(spinctrl_tests) = { &single_spinner_spincollection_test, &two_spinners_spincollection_test, &three_spinners_spincollection_test, &event_back_spincollection_test, &cancel_spinner_spincollection_test, }; // Define the test suite DEFINE_TEST_SUITE(spinctrl_suite, spinctrl_tests, "Spinner widget with test suite"); // Set up the test data pointer and run all tests in the suite test_suite_run(&spinctrl_suite); while (1) { /* Intentionally left empty. */ }}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:56,
示例3: configure_console/** * /brief Configure UART for debug message output. */static void configure_console(void){ const usart_serial_options_t uart_serial_options = { .baudrate = CONF_UART_BAUDRATE, .charlength = CONF_UART_CHAR_LENGTH, .paritytype = CONF_UART_PARITY, .stopbits = CONF_UART_STOP_BITS, }; /* Configure console UART. */ stdio_serial_init(CONF_UART, &uart_serial_options);}
开发者ID:InSoonPark,项目名称:asf,代码行数:15,
示例4: configure_sensor_platform/** Initializes the sensor platform - as this calls the board and sysclock * init functions internally, it will also wait for any pending serial * transfer(s) to complete before calling sensor_platform_init() and will * re-initialize the USART afterwards to ensure no corrupt or lost data. */static void configure_sensor_platform(void){#if XMEGA usart_clear_tx_complete(CONF_TEST_USART); while (!usart_tx_is_complete(CONF_TEST_USART));#elif UC3 while (!(usart_tx_empty(CONF_TEST_USART)));#endif sensor_platform_init(); stdio_serial_init(CONF_TEST_USART, &usart_serial_options); }
开发者ID:kerichsen,项目名称:asf,代码行数:18,
示例5: configure_consolevoid configure_console(void){ struct usart_config usart_conf; usart_get_config_defaults(&usart_conf); usart_conf.mux_setting = EDBG_CDC_SERCOM_MUX_SETTING; usart_conf.pinmux_pad0 = EDBG_CDC_SERCOM_PINMUX_PAD0; usart_conf.pinmux_pad1 = EDBG_CDC_SERCOM_PINMUX_PAD1; usart_conf.pinmux_pad2 = EDBG_CDC_SERCOM_PINMUX_PAD2; usart_conf.pinmux_pad3 = EDBG_CDC_SERCOM_PINMUX_PAD3; usart_conf.baudrate = 115200; stdio_serial_init(&cdc_uart_module, EDBG_CDC_MODULE, &usart_conf); usart_enable(&cdc_uart_module);}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:13,
示例6: configure_console/** * /brief Configure UART console. */static void configure_console(void){ const usart_serial_options_t uart_serial_options = { .baudrate = CONF_UART_BAUDRATE, .charlength = CONF_UART_CHAR_LENGTH, .paritytype = CONF_UART_PARITY, .stopbits = CONF_UART_STOP_BITS, }; /* Configure UART console. */ sysclk_enable_peripheral_clock(CONSOLE_UART_ID); stdio_serial_init(CONF_UART, &uart_serial_options);}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:16,
示例7: configure_console/*** /brief Configure serial console.*/static void configure_console(void){ struct usart_config config_usart; usart_get_config_defaults(&config_usart); config_usart.baudrate = 115200; config_usart.mux_setting = EDBG_CDC_SERCOM_MUX_SETTING; config_usart.pinmux_pad0 = EDBG_CDC_SERCOM_PINMUX_PAD0; config_usart.pinmux_pad1 = EDBG_CDC_SERCOM_PINMUX_PAD1; config_usart.pinmux_pad2 = EDBG_CDC_SERCOM_PINMUX_PAD2; config_usart.pinmux_pad3 = EDBG_CDC_SERCOM_PINMUX_PAD3; stdio_serial_init(&usart_instance, EDBG_CDC_MODULE, &config_usart); usart_enable(&usart_instance);}
开发者ID:thegeek82000,项目名称:asf,代码行数:16,
示例8: dbg_usart_init/** * Initialize USART serial as debug communication port */void dbg_usart_init(void){ /* USART pins init */ _dbg_usart_pins_init(); /* Configure USART */ const usart_serial_options_t options = { .baudrate = DBG_USART_BAUDRATE, .charlength = DBG_USART_CHR_LENGTH, .paritytype = DBG_USART_PARITY, .stopbits = DBG_USART_STOP_BITS }; stdio_serial_init(DBG_USART_BASE, &options);}
开发者ID:marekr,项目名称:asf,代码行数:16,
示例9: configure_console/* Funktionen konfiguerar kommunikationskanal via UART */void configure_console(void) { const usart_serial_options_t uart_serial_options = { .baudrate = CONF_UART_BAUDRATE, .paritytype = CONF_UART_PARITY }; /* Konfigurera konsol UART. */ sysclk_enable_peripheral_clock(CONSOLE_UART_ID); stdio_serial_init(CONF_UART, &uart_serial_options); ioport_set_pin_mode(PIO_PA8_IDX, IOPORT_MODE_PULLUP); /* Specifiera att stdout inte ska buffras */ #if defined(__GNUC__) setbuf(stdout, NULL); #endif}
开发者ID:kajm,项目名称:PingPongProjekt,代码行数:14,
示例10: init_stdio/*! /brief Initializes STDIO. */static void init_stdio(void){ // USART options. static usart_serial_options_t USART_SERIAL_OPTIONS = { .baudrate = USART_SERIAL_EXAMPLE_BAUDRATE, .charlength = USART_SERIAL_CHAR_LENGTH, .paritytype = USART_SERIAL_PARITY, .stopbits = USART_SERIAL_STOP_BIT }; // Initialize Serial Interface using Stdio Library stdio_serial_init(USART_SERIAL_EXAMPLE,&USART_SERIAL_OPTIONS);}
开发者ID:Mazetti,项目名称:asf,代码行数:16,
示例11: main/** * /brief Run CRC driver unit tests */int main (void){ const usart_serial_options_t usart_serial_options = { .baudrate = CONF_TEST_BAUDRATE, .charlength = CONF_TEST_CHARLENGTH, .paritytype = CONF_TEST_PARITY, .stopbits = CONF_TEST_STOPBITS, }; sysclk_init(); board_init(); sleepmgr_init(); stdio_serial_init(CONF_TEST_USART, &usart_serial_options); DEFINE_TEST_CASE(crc_32bit_io_test, NULL, run_32bit_io_test, NULL, "32bit CRC on simulated IO data test"); DEFINE_TEST_CASE(crc_16bit_io_test, NULL, run_16bit_io_test, NULL, "16bit CRC on simulated IO data test"); DEFINE_TEST_CASE(crc_32bit_dma_test, NULL, run_32bit_dma_test, NULL, "32bit CRC DMA data test"); DEFINE_TEST_CASE(crc_16bit_dma_test, NULL, run_16bit_dma_test, NULL, "16bit CRC DMA data test"); DEFINE_TEST_CASE(crc_32bit_flash_range_test, NULL, run_flash_test, NULL, "32bit CRC flash range test"); // Put test case addresses in an array DEFINE_TEST_ARRAY(crc_tests) = { &crc_32bit_io_test, &crc_16bit_io_test, &crc_32bit_dma_test, &crc_16bit_dma_test, &crc_32bit_flash_range_test, }; // Define the test suite DEFINE_TEST_SUITE(crc_suite, crc_tests, "XMEGA CRC driver test suite"); test_suite_run(&crc_suite); while (1) { // Intentionally left blank }}
开发者ID:InSoonPark,项目名称:asf,代码行数:53,
示例12: main/** * /brief Run MEM2MEM driver unit tests. */int main(void){ uint32_t i; const usart_serial_options_t uart_serial_options = { .baudrate = CONF_TEST_BAUDRATE, .paritytype = CONF_TEST_PARITY }; /* Initialize the system. */ sysclk_init(); board_init(); /* Configure console UART. */ sysclk_enable_peripheral_clock(CONSOLE_UART_ID); stdio_serial_init(CONF_TEST_UART, &uart_serial_options); /* Initialize src buffer */ for (i = 0; i < MEM_SIZE8/2; i ++) { src_mem8[i] = (i % 10) + '0'; } for (;i < MEM_SIZE8; i ++) { src_mem8[i] = (i % ('z'-'a')) + 'a'; } /* Define all the test cases */ DEFINE_TEST_CASE(low_level_test, NULL, run_low_level_transfer_test, NULL, "Low Level APIs data transfer test"); DEFINE_TEST_CASE(transfer_wait_test, NULL, run_transfer_wait_test, NULL, "M2M APIs data transfer wait test"); DEFINE_TEST_CASE(transfer_job_test, NULL, run_transfer_job_test, NULL, "M2M APIs data transfer job test"); /* Put test case addresses in an array */ DEFINE_TEST_ARRAY(mem2mem_tests) = { &low_level_test, &transfer_wait_test, &transfer_job_test }; /* Define the test suite */ DEFINE_TEST_SUITE(mem2mem_suite, mem2mem_tests, "SAM MEM2MEM driver test suite"); /* Run all tests in the test suite */ test_suite_run(&mem2mem_suite); while (1) { /* Busy-wait forever */ }}
开发者ID:thegeek82000,项目名称:asf,代码行数:53,
示例13: configure_console/** * /brief Configure the Console UART */static void configure_console(void){ const usart_serial_options_t uart_serial_options = { .baudrate = CONF_UART_BAUDRATE, .paritytype = CONF_UART_PARITY }; /* Configure console UART. */ sysclk_enable_peripheral_clock(CONSOLE_UART_ID); stdio_serial_init(CONF_UART, &uart_serial_options);#if defined(__GNUC__) setbuf(stdout, NULL);#endif}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:17,
示例14: main/** * /brief Run ADC unit tests * * Initializes the clock system, board and serial output, then sets up the * ADC unit test suite and runs it. */int main(void){ const usart_serial_options_t usart_serial_options = { .baudrate = CONF_TEST_BAUDRATE, .charlength = CONF_TEST_CHARLENGTH, .paritytype = CONF_TEST_PARITY, .stopbits = CONF_TEST_STOPBITS, }; board_init(); sysclk_init(); sleepmgr_init(); stdio_serial_init(CONF_TEST_USART, &usart_serial_options); // Define single ended conversion test cases DEFINE_TEST_CASE(single_ended_12bit_conversion_test, NULL, run_single_ended_12bit_conversion_test, NULL, "Single ended conversion with 12-bit result"); DEFINE_TEST_CASE(single_ended_8bit_conversion_test, NULL, run_single_ended_8bit_conversion_test, NULL, "Single ended conversion with 8-bit result"); // Define differential conversion test cases DEFINE_TEST_CASE(differential_conversion_test, NULL, run_differential_12bit_conversion_test, NULL, "Differential conversion with 12-bit result"); DEFINE_TEST_CASE(differential_conversion_with_gain_test, NULL, run_differential_12bit_with_gain_conversion_test, NULL, "Differential conversion with 12-bit result and gain"); // Put test case addresses in an array DEFINE_TEST_ARRAY(adc_tests) = { &single_ended_12bit_conversion_test, &single_ended_8bit_conversion_test, &differential_conversion_test, &differential_conversion_with_gain_test, }; // Define the test suite DEFINE_TEST_SUITE(adc_suite, adc_tests, "XMEGA ADC driver test suite"); // Run all tests in the suite test_suite_run(&adc_suite); while (1) { // Intentionally left empty. }}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:56,
示例15: main/** * /brief Run DataFlash component unit tests * * Initializes the clock system, board, serial output and DataFlash, then sets * up the DataFlash unit test suite and runs it. */int main(void){ const usart_serial_options_t usart_serial_options = { .baudrate = CONF_TEST_BAUDRATE, .charlength = CONF_TEST_CHARLENGTH, .paritytype = CONF_TEST_PARITY, .stopbits = CONF_TEST_STOPBITS, }; // Initialize the board and all the peripheral required sysclk_init(); board_init(); stdio_serial_init(CONF_TEST_USART, &usart_serial_options); at45dbx_init(); // Define all the test cases DEFINE_TEST_CASE(memory_check_test, NULL, run_memory_check_test, NULL, "Memory check"); DEFINE_TEST_CASE(byte_access_test, NULL, run_byte_access_test, NULL, "Read/write byte access"); DEFINE_TEST_CASE(sector_access_test, NULL, run_sector_access_test, NULL, "Read/write sector access"); DEFINE_TEST_CASE(multiple_sector_access_test, NULL, run_multiple_sector_access_test, NULL, "Read/write multiple sector access"); DEFINE_TEST_CASE(memory_range_check_test, NULL, run_memory_range_check_test, NULL, "Memory range address check"); // Put test case addresses in an array. DEFINE_TEST_ARRAY(memory_tests) = { &memory_check_test, &byte_access_test, §or_access_test, &multiple_sector_access_test, &memory_range_check_test }; // Define the test suite. DEFINE_TEST_SUITE(memory_suite, memory_tests, "AT45dbx component unit test suite"); // Run all tests in the test suite. test_suite_run(&memory_suite); while (1) { // Intentionally left empty. };}
开发者ID:InSoonPark,项目名称:asf,代码行数:55,
示例16: configure_console/** * Configure UART console. */static void configure_console(void){ struct usart_config usart_conf; usart_get_config_defaults(&usart_conf); usart_conf.mux_setting = CONF_STDIO_MUX_SETTING; usart_conf.pinmux_pad0 = CONF_STDIO_PINMUX_PAD0; usart_conf.pinmux_pad1 = CONF_STDIO_PINMUX_PAD1; usart_conf.pinmux_pad2 = CONF_STDIO_PINMUX_PAD2; usart_conf.pinmux_pad3 = CONF_STDIO_PINMUX_PAD3; usart_conf.baudrate = CONF_STDIO_BAUDRATE; stdio_serial_init(&cdc_uart_module, CONF_STDIO_USART_MODULE, &usart_conf);}
开发者ID:diman2,项目名称:tetris_samd10,代码行数:18,
示例17: configure_console/** * /brief Configure serial console. */static void configure_console(void){ const usart_serial_options_t uart_serial_options = { .baudrate = CONF_UART_BAUDRATE,#ifdef CONF_UART_CHAR_LENGTH .charlength = CONF_UART_CHAR_LENGTH,#endif .paritytype = CONF_UART_PARITY,#ifdef CONF_UART_STOP_BITS .stopbits = CONF_UART_STOP_BITS,#endif }; stdio_serial_init(CONF_UART, &uart_serial_options);}
开发者ID:thegeek82000,项目名称:asf,代码行数:18,
示例18: configure_consolestatic void configure_console(void){ struct usart_config usart_conf; usart_get_config_defaults(&usart_conf); usart_conf.mux_setting = HOST_SERCOM_MUX_SETTING; usart_conf.pinmux_pad0 = HOST_SERCOM_PINMUX_PAD0; usart_conf.pinmux_pad1 = HOST_SERCOM_PINMUX_PAD1; usart_conf.pinmux_pad2 = HOST_SERCOM_PINMUX_PAD2; usart_conf.pinmux_pad3 = HOST_SERCOM_PINMUX_PAD3; usart_conf.baudrate = USART_HOST_BAUDRATE; stdio_serial_init(&cdc_uart_module, USART_HOST, &usart_conf); usart_enable(&cdc_uart_module);}
开发者ID:justinjonas,项目名称:micro_project,代码行数:15,
示例19: configure_consolestatic void configure_console(void){ const usart_serial_options_t uart_serial_options = {.baudrate = CONF_UART_BAUDRATE, .paritytype = CONF_UART_PARITY }; sysclk_enable_peripheral_clock(CONSOLE_UART_ID); stdio_serial_init(CONF_UART, &uart_serial_options); /* Stdout shall not be buffered */ #if defined(__GNUC__) setbuf(stdout, NULL); #else /* Redan i fallet IAR's Normal DLIB default konfiguration: * s C++ stdstr函数代码示例 C++ stdio_init函数代码示例
|