您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ uart0_init函数代码示例

51自学网 2021-06-03 09:03:45
  C++
这篇教程C++ uart0_init函数代码示例写得很实用,希望能帮到您。

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

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

示例1: PROCESS_THREAD

PROCESS_THREAD(sync_master, ev, data){  static int i=0;  static struct uip_udp_conn *udp;  PROCESS_BEGIN();      udp = udp_new(NULL, UIP_HTONS(10000), NULL);  uip_udp_bind(udp, UIP_HTONS(10000));  uart0_init(1000000);  while(1)  {    PROCESS_YIELD_UNTIL(ev == tcpip_event);    int i;    for (i = 0; i < 16; i++)      uart0_writeb(UDP_HDR->srcipaddr.u8[i]);    for (i = 0; i < uip_datalen(); i++)    {      uart0_writeb(((uint8_t*)uip_appdata)[i]);    }  }  PROCESS_END();}
开发者ID:cloud-hot,项目名称:Jennisense,代码行数:25,


示例2: init_devices

void init_devices (void){ cli();         //Clears the global interrupts port_init(); uart0_init(); sei();         //Enables the global interrupts}
开发者ID:Anandpatel1,项目名称:eyantra-firebird-resources,代码行数:7,


示例3: cmd_line_test

void cmd_line_test(void){    // Initialise modules    uart0_init(115200,8,UART0_NO_PARITY,1);    printf_init();    // Enable global interrupts    sei();        // Initialise command line parser and VT100 terminal helper	vt100_init(&main_put_char);    cmd_line_init(&main_put_char);    cmd_line_add      (&cmd_line_led,                  "led",&cmd_line_handler_led,    "display status of led");    cmd_line_add_child(&cmd_line_led,&cmd_line_led_on, "on", &cmd_line_handler_led_on, "switch led on"        );    cmd_line_add_child(&cmd_line_led,&cmd_line_led_off,"off",&cmd_line_handler_led_off,"switch led off"       );    PRINTF("/nCommand Line test/n/n");    for(;;)    {        // Pass all received data to command line parser        if(uart0_get_rx_byte(&data))        {            cmd_line_process(data);        }            }}
开发者ID:BackupTheBerlios,项目名称:piconomic-svn,代码行数:28,


示例4: main_init

/** Main initialisation. */static voidmain_init (void){#ifndef HOST    /* Disable watchdog (enabled in bootloader). */    MCUSR &= ~(1 << WDRF);    wdt_disable ();#endif    /* Serial port */    uart0_init ();    /* Enable interrupts */    sei ();    /* Main timer */    timer_init ();    timer_wait ();    /* TWI communications */    asserv_init ();    mimot_init ();    twi_master_init ();    /* IO modules. */    pwm_init ();    contact_init ();    codebar_init ();    usdist_init ();    /* AI modules. */    clamp_init ();    logistic_init ();    path_init ();    /* Initialization done. */    proto_send0 ('z');}
开发者ID:TLoebner,项目名称:apbteam,代码行数:32,


示例5: main

int main(){    int i;    unsigned char write_buffer[ARR_SIZE];    unsigned char read_buffer[ARR_SIZE];    uart0_init();   // 波特率115200,8N1(8个数据位,无校验位,1个停止位)    i2c_init();    printf("/r/n [*] Initialize array /r/n");    for (i=0; i < ARR_SIZE; ++i) {        write_buffer[i] = i;    }        printf("/r/n [*] Write array to eeprom /r/n");    i2c_write(0xa0, write_buffer, sizeof(write_buffer));    memset(read_buffer, 0, sizeof(read_buffer));    printf("/r/n [*] Read array from eeprom /r/n");    i2c_read(0xa0, read_buffer, sizeof(read_buffer));    for (i = 0; i < ARR_SIZE; ++i){        printf("read_buffer[%d] = 0x%x /r/n", i, read_buffer[i]);    }    printf("/r/n [*] Read finished /r/n");}
开发者ID:cutecheng,项目名称:rounder,代码行数:27,


示例6: main

 int main() {	int * hello;	int * hello2;	int * hello3;	volatile unsigned int ret_val = 1234; 	 	SystemInit();	__disable_irq();	uart0_init();	init_memory();	process_init();	__enable_irq();	  //SET Control to user level	__set_CONTROL(__get_CONTROL() | BIT(0));	 	hello = s_request_memory_block();	hello2 = s_request_memory_block();	s_release_memory_block(hello);	s_release_memory_block(hello2);	hello3 = s_request_memory_block();	 	*hello3 = 88; 	 	uart0_put_string("Hello World!/n/r");			ret_val = release_processor();	 	return 0;}
开发者ID:StachedCrusader,项目名称:se350,代码行数:31,


示例7: main

int main(){  SystemInit();  uart0_init();  uart0_put_string("Hello World!/n/r");  return 0;}
开发者ID:AdrianMachado,项目名称:ECE254,代码行数:7,


示例8: user_init

void ICACHE_FLASH_ATTR user_init(void){	uart0_init(BIT_RATE_74880);	// 0x40200000 is the base address for spi flash memory mapping, ESPFS_POS is the position	// where image is written in flash that is defined in Makefile.	espFsInit((void*)(0x40200000 + ESPFS_POS));	httpdInit(builtInUrls, 80);#ifdef SHOW_HEAP_USE	os_timer_disarm(&prHeapTimer);	os_timer_setfn(&prHeapTimer, prHeapTimerCb, NULL);	os_timer_arm(&prHeapTimer, 3000, 1);#endif	init_relay();	os_timer_disarm(&startup_timer);	os_timer_setfn(&startup_timer, (os_timer_func_t *)onesec, (void *)0);	os_timer_arm(&startup_timer, 1000, 1);	os_timer_disarm(&delayed_start_timer);	os_timer_setfn(&delayed_start_timer, (os_timer_func_t *)delayed_start, (void *)0);	os_timer_arm(&delayed_start_timer, 500, 1);	load_config();	os_printf("running/n");}
开发者ID:n0bel,项目名称:ESPrinkler,代码行数:29,


示例9: main

int main(){    unsigned char c;    uart0_init();  	cur_timer_func = idle_func;	init_timer_queue(&global_timer_queue);	enqueue_timer(&global_timer_queue,1000,uart_message1);	enqueue_timer(&global_timer_queue,300,uart_message2);	enqueue_timer(&global_timer_queue,400,uart_message3);  	putc('T');	putc('e');	putc('s');	putc('t');	putc(':');	putc('/n');	putc('/r');	putstr("str_test");	putint(987649);	    while(1)    {                c = getc();     		putc(c);    }    return 0;}
开发者ID:clscu,项目名称:study_exercise,代码行数:29,


示例10: debug_init

 void debug_init(void){ #if DEBUG_METHOD==uart  uart0_init(); #else  #error "Your DEBUG methode is not suported!" #endif }
开发者ID:Sergoi,项目名称:avr-crypto-lib,代码行数:7,


示例11: main

int main(){  SystemInit();							//Init system  uart0_init();							//Start UART	os_sys_init(init);				//Start OS Processes	return 0;}
开发者ID:raunaqsawhney,项目名称:operating-systems,代码行数:7,


示例12: main

int main(void) {    int i;    set_mcu_speed_xt2_mclk_8MHz_smclk_1MHz();    uart0_init(UART0_CONFIG_1MHZ_115200);    LEDS_INIT();    LEDS_ON();    delay(DELAY);    LEDS_OFF();    led_state = 0;    while (1)     {        for (i=0; i<99; i++)        {            printf("Salam Aleikoum/n");            uart0_getchar_polling();            led_change();        }    }}
开发者ID:hunt978,项目名称:vatdma,代码行数:25,


示例13: main

void main(void){    uart0_init();    led_init();    nand_init();    irq_init();    int i = 0;    for(i = 0;i < 10;i++){        uart0_puts("/nShell #");        uart0_gets(buf,MAX_LEN);        const cmd_t *ptr;        ptr = find_cmd(buf);        if(ptr != 0){            ptr->call_back();        }else{            uart0_puts("/nNot find Cmd");        }        /*if(!my_strcmp(buf,"ledon")){            uart0_puts(buf);            led_on();            continue;        }else if(!my_strcmp(buf,"ledoff")){            uart0_puts(buf);            led_off();            continue;        }else{            uart0_puts("/nNot command!!!");            continue;        }*/    }}
开发者ID:huaweili,项目名称:esd,代码行数:33,


示例14: start

void start(){	uint32_t temp;	uint8_t getstr[20];	GPJ2CON = 0x1111;	GPJ2DAT = 0x0a;	uart0_init(115200);	fimd_init();	xdev_out(uart0_putc);	xdev_in(uart0_getc);	xprintf("FA210 Tester v1/n");	while(1){		xputc('>');		xgets(getstr,15);	}}
开发者ID:yonganch,项目名称:fa-nos-simple,代码行数:26,


示例15: isr_reset

static void isr_reset(void){    // remove compiler warning    (void)g_pfnVectors;    /**     * The hyperload bootloader sets the MSP/PSP upon a true reset, which is when the     * LPC17xx (Cortex-M3) sets the values of the stack pointer.  But since we are     * booting after a bootloader, we have to manually setup the stack pointers ourselves.     */    do {        const uint32_t topOfStack = (uint32_t) &_vStackTop;        __set_PSP(topOfStack);        __set_MSP(topOfStack);    } while(0);    do {        // Copy data from FLASH to RAM        unsigned int LoadAddr, ExeAddr, SectionLen;        unsigned int *SectionTableAddr;        // Load base address of Global Section Table        SectionTableAddr = &__data_section_table;        // Copy the data sections from flash to SRAM.        while (SectionTableAddr < &__data_section_table_end)        {            LoadAddr = *SectionTableAddr++;            ExeAddr = *SectionTableAddr++;            SectionLen = *SectionTableAddr++;            data_init(LoadAddr, ExeAddr, SectionLen);        }        // At this point, SectionTableAddr = &__bss_section_table;        // Zero fill the bss segment        while (SectionTableAddr < &__bss_section_table_end)        {            ExeAddr = *SectionTableAddr++;            SectionLen = *SectionTableAddr++;            bss_init(ExeAddr, SectionLen);        }    } while (0) ;    #if defined (__cplusplus)        __libc_init_array();    // Call C++ library initialization    #endif    do {        low_level_init();   // Initialize minimal system, such as Clock & UART        high_level_init();  // Initialize high level board specific features        main();             // Finally call main()    } while(0);    // In case main() exits:    uart0_init(SYS_CFG_UART0_BPS);    u0_dbg_put("main() should never exit on this system/n");    while (1) {        ;    }}
开发者ID:liveusr,项目名称:selfdriving,代码行数:60,


示例16: main

int main (void){    uint32_t now, led_ms; // ms    unsigned char c;    DDRB  |= 1 << 7; // Arduino pin 13    uart0_init();    tmr_init();    sei();    printf("hello world/n");    led_ms = tmr_count_ms();    while (1) {        now = tmr_count_ms();          if ((now - led_ms) >= 1000) {            led_ms = now;            PORTB ^= 1 << 7; // Arduino pin 13            printf("%ld ms/n", now);        }        c = uart_getchar();        if (c) {            uart_putchar(c);        }    }    return 0;}
开发者ID:dsnider0909,项目名称:hello_arduino,代码行数:30,


示例17: init_devices

//Function To Initialize all The Devicesvoid init_devices(){ cli(); //Clears the global interrupts port_init();  //Initializes all the ports uart0_init(); //Initailize UART1 for serial communiaction sei();   //Enables the global interrupts}
开发者ID:eyantra,项目名称:CS684_Collaborative_cleaning_project_2010,代码行数:8,


示例18: main

int main () {	volatile uint8_t sec = 0;	SystemInit();	__disable_irq();	timer_init(0); /* initialize timer 0 */		/* 	  uart polling is used in this example only to help	  demonstrate timer interrupt programming.	  In your final project, polling is NOT ALLOWED in i-processes.	  Refer to the UART_irq example for interrupt driven UART.	*/	uart0_init();		__enable_irq();	while (1) {		/* g_timer_count gets updated every 1ms */		if (g_timer_count == 1000) { 			uart0_put_char('0'+ sec);			sec = (++sec)%10;			g_timer_count = 0; /* reset the counter */		}     	}}
开发者ID:ccqi,项目名称:SE350-Lab,代码行数:27,


示例19: hdlc_test

void hdlc_test(void){    u8_t data;    // Enable RS-485 PIO for loopback operation    BIT_SET_HI(PORT_RS485_TX_EN_O, BIT_RS485_TX_EN_O);    BIT_SET_HI(DDR_RS485_TX_EN_O, BIT_RS485_TX_EN_O);    BIT_SET_LO(PORT_RS485_RX_EN_O, BIT_RS485_RX_EN_O);    BIT_SET_HI(DDR_RS485_RX_EN_O, BIT_RS485_RX_EN_O);    // Initialise modules    uart0_init();    uart1_init();    printf_init();    hdlc_init(&hdlc_on_rx_frame);    // Enable global interrupts    sei();            // Send an HDLC packet    data = 0x55;    hdlc_tx_frame(&data,1);    // Process received data    for(;;)    {        if(uart1_get_rx_byte(&data))        {            PRINTF("%02X ", data);            // Feed received data to HDLC layer            hdlc_on_rx_byte(data);        }    }}
开发者ID:BackupTheBerlios,项目名称:piconomic-svn,代码行数:35,


示例20: main

int main( void ){    void (*theKernel)(int zero, int arch, unsigned int params);    /* 1. 帮内核设置串口:内核启动的开始部分会从串口打印一些log,但是内核一开始还没有初始化串口 */    uart0_init();    puts("/r/n---------welcome----------/r/n");    /* 2. 从NAND FLASH把内核读入内存 */    puts("Copy kernel from NAND./n/r");    nand_read(0xa0000+64, (unsigned char *)0x30008000, 0x400000);/*boot(512K),params(128K),kernel(4M),rootfs(...)*/    /* 3. 设置参数 */    puts("Set boot params/n/r");    setup_start_tag();    setup_memory_tags();    setup_commandline_tag("noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200");    setup_end_tag();    /* 4. 跳转执行 */    puts("Boot kernel/n/r");    theKernel = (void (*)(int, int, unsigned int))0x30008000;    theKernel(0, 362, 0x30000100);    puts("Error!/n/r");    return -1;}
开发者ID:Cainiaotuanzhang,项目名称:bootloader_s3c2440_my,代码行数:26,


示例21: main

int main(void) {  int  c;  uart0_init();  set_mcu_speed();  eint();  led_state = 1;  LED_DIR = 0xff;  LED_OUT = 0xff;  printf("Timer test program ready./n");  printf("10Hz/n");  timerA3_start(20);  delay(4000);  timerA3_stop();  timerA3_start(10);  while (1)    {      LPM3;      while ((c = uart0_getchar()))	{	  printf("%c",c);	}    }  return 0;}
开发者ID:ESS-Group,项目名称:WSim,代码行数:30,


示例22: main

int main(){		unsigned int adc;	float vol;	int n;		copy_vec();	irq_init();	button_init();	uart0_init();	timer_init();//	timer4_init();	lcd_init();	lcd_clean(0xffff);	adc_ts_init();	ts_init();	while(1);	while(1)	{		adc = read_adc(0);		vol = adc * 3.3 / 0x3ff;		n = (vol - (int)vol) * 1000;				printf("AIN0: adc = %u	voltage:%d.%03d/r/n", adc, (int)vol, n);		delayms(1000);	}		return 0;}
开发者ID:James-Tu,项目名称:misc_files,代码行数:31,


示例23: gps_init

void gps_init( void ) {  /* Enable uart                   */#ifdef SIMUL  uart0_init();#else  uart1_init();#endif}
开发者ID:alexjordan,项目名称:patmos-benchmarks,代码行数:8,


示例24: main_init

static inline void main_init( void ) {    mcu_init();    sys_time_init();    led_init();    uart0_init();    uart1_init();    mcu_int_enable();}
开发者ID:pigmin,项目名称:lisa-m-team4938,代码行数:8,


示例25: debug_char

 void debug_char(char c){	static char initialised = 0;	if (!initialised){		uart0_init();		initialised=1;	}	uart0_putc(c); }
开发者ID:Sergoi,项目名称:avr-crypto-lib,代码行数:8,


示例26: main

intmain (void){    uart0_init ();    while (1)        proto_accept (uart0_getc ());}
开发者ID:TLoebner,项目名称:apbteam,代码行数:8,


示例27: device_init

void device_init(void){	ds1302_init();	uart0_init();#ifdef CONFIG_PPIDE	ppide_init();	devide_init();#endif}
开发者ID:8l,项目名称:FUZIX,代码行数:9,


示例28: main

int main(void){    timeCount = 0;    hardwareInit();    uart0_init(BAUD_SETTING);/* Initialise timer to divide by 1025, giving 32ms time tick */    timer0Init(0,5);    rfm12_init();    wdtInit();    sei();    indx = 0;    for(;;)    {        wdt_reset();        uint8_t sendMessage = false;        uint16_t character = uart0_getc();/* Wait for a serial incoming message to be built. */        if (character != UART_NO_DATA)        {            inBuf[indx++] = (uint8_t)(character & 0xFF);/* Signal to transmit if a CR was received, or string too long. */             sendMessage = ((indx > MAX_MESSAGE) || (character == 0x0D));        }/* Send a transmission if message is ready to send, or something wasreceived and time waited is too long. */         if (sendMessage || (timeCount++ > TIMEOUT))        {/* Wait for the transmit buffer to be freed and message loaded. */            if ((indx > 0) && (rfm12_tx(indx, 0, inBuf) != RFM12_TX_OCCUPIED))                indx = 0;            timeCount = 0;        }        rfm12_tick();/* If an RF incoming message has been received, take it from the buffer onecharacter at a time and transmit via the serial port. */        if (rfm12_rx_status() == STATUS_COMPLETE)        {            uint8_t *bufferContents = rfm12_rx_buffer();            uint8_t messageLength = rfm12_rx_len();            uint8_t i;            for (i=0;i<messageLength;i++)            {	            uart0_putc(bufferContents[i]);            }/* Clear the "in use" status of the receive buffer to be available forrfm12lib. */            rfm12_rx_clear();        }    }}
开发者ID:ksarkies,项目名称:Remote-Power-Switch,代码行数:57,


示例29: main

intmain (void){    sei ();    uart0_init ();    proto_send0 ('z');    while (42)	proto_send1d ('r', random_u32 ());}
开发者ID:TLoebner,项目名称:apbteam,代码行数:9,


示例30: main

intmain (void){    spi_init (SPI_MASTER, SPI_MODE_0, SPI_MSB_FIRST, SPI_FOSC_DIV128);    uart0_init ();    sei ();    proto_send0 ('z');    while (1)	proto_accept (uart0_getc ());}
开发者ID:TLoebner,项目名称:apbteam,代码行数:10,



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


C++ uart0_sendStr函数代码示例
C++ ualarm函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。