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

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

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

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

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

示例1: uartDataTaskInit

/*******************************************************************************   Functions******************************************************************************/void uartDataTaskInit(void){	// Initialization of communication	uartInit();	uartSetBaudRate(115200);	stdout = &mystdout;}
开发者ID:Romcik077,项目名称:SpeedyLoop,代码行数:10,


示例2: sysInitHardware

// ----------- Initialise built in devices ------void sysInitHardware(void){	SWITCH_init(&_button_);	setErrorLog(&uart1SendByte);	rprintfInit(&uart1SendByte);	uartInit(_C_uart1,115200);	segled_init(&_led_display_);}
开发者ID:romick,项目名称:tetry-robot,代码行数:8,


示例3: main

//----- Begin Code ------------------------------------------------------------int main(void){	// initialize our libraries	// initialize the UART (serial port)	uartInit();	uartSetBaudRate(115200);	// make all rprintf statements use uart for output	rprintfInit(uartSendByte);	// initialize the timer system	timerInit();	// initialize vt100 terminal	vt100Init();	timerPause(100);	// print welcome message	vt100ClearScreen();	vt100SetCursorPos(1,0);	rprintfProgStrM("/r/nWelcome to the MMC Test Suite!/r/n");	timerPause(1000);	mmcTest();	return 0;}
开发者ID:lanwan,项目名称:avrlib2,代码行数:27,


示例4: cliInit

void cliInit(){  #if defined CFG_INTERFACE && defined CFG_PRINTF_UART    // Check if UART is already initialised    uart_pcb_t *pcb = uartGetPCB();    if (!pcb->initialised)    {      uartInit(CFG_UART_BAUDRATE);    }  #endif  #if CFG_INTERFACE_ENABLEIRQ != 0    // Set IRQ pin as output    LPC_GPIO->DIR[CFG_INTERFACE_IRQPORT] |= (1 << CFG_INTERFACE_IRQPIN);    LPC_GPIO->SET[CFG_INTERFACE_IRQPORT] = (1 << CFG_INTERFACE_IRQPIN);  #endif  // init the msg ptr  msg_ptr = msg;  // Show the menu  cliMenu();  // Set the IRQ pin low by default  #if CFG_INTERFACE_ENABLEIRQ  != 0    LPC_GPIO->CLR[CFG_INTERFACE_IRQPORT] = (1 << CFG_INTERFACE_IRQPIN);  #endif}
开发者ID:ismamont,项目名称:LPC11U_LPC13U_CodeBase,代码行数:28,


示例5: main

//----- Begin Code ------------------------------------------------------------int main(void){	// initialize our libraries	// initialize the UART (serial port)	uartInit();	// set the baud rate of the UART for our debug/reporting output	uartSetBaudRate(9600);	// initialize the timer system	timerInit();	// initialize rprintf system	// - use uartSendByte as the output for all rprintf statements	//   this will cause all rprintf library functions to direct their	//   output to the uart	// - rprintf can be made to output to any device which takes characters.	//   You must write a function which takes an unsigned char as an argument	//   and then pass this to rprintfInit like this: rprintfInit(YOUR_FUNCTION);	rprintfInit(uartSendByte);	// initialize vt100 library	vt100Init();		// clear the terminal screen	vt100ClearScreen();		// run the test	rprintfTest();	return 0;}
开发者ID:BackupTheBerlios,项目名称:rundfunker,代码行数:31,


示例6: main

int main (void){	sysclk_init();	wdt_disable(WDT);	initLeds();//	rumblecationInit();	uartInit();		volatile int i;		while(1) {		//uart_write(UART0, 's');		//i++;		/*if(transmitBufRead != transmitBufWrite) {			uart_write(UART0, transmitBuf[transmitBufRead]);			transmitBufRead++;		}*/		if(uart_is_rx_ready(UART0)) {			uint8_t in;			uart_read(UART0, &in);			uart_write(UART0, in);		}	}}
开发者ID:lab11,项目名称:ving,代码行数:26,


示例7: main

int main(){    AD1PCFGL = 0xFFFF;    TRISB &= ~(1<<8);        SPI_Init();    uartInit();    insight_init();#ifdef ENC28J60_H    enc28j60Initialize(mac);#endif#ifdef ENC624J600_H    enc624j600Initialize(mac);#endif    sram_23lc1024_init();    arpInit();    arpAnnounce(mac, ip, gateway);    ipv4Init();    udpInit();    tcpInit();    //tcpListen(1234, 32, handleConnection);    icmpInit();    ntpInit();    //ntpRequest(ntpServer);    RtosTaskInit();    RtosTaskCreate(&ethTask, "Eth", EthernetTask, 5, ethTaskStk, sizeof(ethTaskStk));    RtosTaskCreate(&ledTask, "LED", LedTask, 1, ledTaskStk, sizeof(ledTaskStk));    RtosTaskRun();    while(1);    return 0;}
开发者ID:hebron,项目名称:enc28j60_dspic33,代码行数:34,


示例8: main

intmain(void){	struct ds1307_t rtc_tm;	static const char infostring[] PROGMEM = "Demo - DS1307 RTC/r/n";	char buffer[BUFFER_SIZE];	uartInit(BAUDRATE);	i2cInit(I2C_STD_MODE);	sei();	ds1307Init();	ds1307SetTime(SYS_HOUR, SYS_MINS, SYS_SECS);	ds1307SetDate(SYS_DAY, SYS_MONTH, SYS_YEAR);	uartPutString_P(infostring);	while (1) {		/* Read Current Time from DS1307 and output to UART */		ds1307GetTime(&rtc_tm);		sprintf(buffer, "RTC: [%02d:%02d:%02d] - [%02d.%02d.%02d]/r/n",		    rtc_tm.hours, rtc_tm.minutes, rtc_tm.seconds, rtc_tm.day,		    rtc_tm.month, rtc_tm.year);		uartPutString(buffer);		_delay_ms(1000);	}	/* never reached */	return (0);}
开发者ID:h5b,项目名称:arduino_uno_328p,代码行数:31,


示例9: main

//----- Begin Code ------------------------------------------------------------int main(void){	// initialize our libraries	// initialize the UART (serial port)	uartInit();	uartSetBaudRate(9600);	// make all rprintf statements use uart for output	rprintfInit(uartSendByte);	// turn on and initialize A/D converter	a2dInit();	// initialize the timer system	timerInit();	// initialize vt100 terminal	vt100Init();	// configure port B for led output and pushbutton input	outb(DDRB, 0x0F);	// all LEDs on	outb(PORTB, 0x00);	// wait for hardware to power up	timerPause(100);	// all LEDs off	outb(PORTB, 0x0F);	// start command line	goCmdline();	return 0;}
开发者ID:46nori,项目名称:avr-liberty,代码行数:30,


示例10: main

int main(void){		uint16_t byteCount = 0;	char buffer0[32];		HAL_Init();	SYS_TimerInit();	PHY_Init();	NWK_Init();	//SYS_INIT()	timer3Init();	uartInit();	sei();	while (1){				SYS_TaskHandler();				byteCount = uartAvailable();				if(byteCount > 0){			HAL_UartBytesReceived(byteCount);			sprintf(buffer0, "Bytes to send: %i/n", byteCount);			uartPuts(buffer0);		}		APP_TaskHandler();	}}
开发者ID:keeepcool,项目名称:Backup,代码行数:28,


示例11: main

//----- Begin Code ------------------------------------------------------------int main(void){	// initialize our libraries	// initialize the UART (serial port)	uartInit();	// set the baud rate of UART 0 for our debug/reporting output	uartSetBaudRate(0,9600);	// set uart0SendByte as the output for all rprintf statements	rprintfInit(uart0SendByte);	// initialize the timer system	timerInit();	// initialize vt100 library	vt100Init();		// print a little intro message so we know things are working	vt100ClearScreen();	rprintf("/r/nWelcome to GPS Test!/r/n");		// run example gps processing loop	// (pick the one appropriate for your GPS packet format)//	gpsTsipTest();	gpsNmeaTest();		return 0;}
开发者ID:BackupTheBerlios,项目名称:rundfunker,代码行数:26,


示例12: sysInit

void sysInit(void){		PMOD_DDR |= _BV(PMOD0) | _BV(PMOD1) | _BV(PMOD2) | _BV(PORTD4);		//Set PMOD as outputs	WIZ_DDR &= ~(_BV(INT_W5500));							//Int is an input	WIZ_PORT |= _BV(INT_W5500);								//Enable pull up	WIZ_DDR |= _BV(SS_W5500);								//Set SS as output 	AUX_DDR &= ~(_BV(BTN0) | _BV(ISENSE) | _BV(VSENSE));	//Button set as input Isense and Vsense inputs(will be used for ADC)	AUX_DDR |= _BV(WP_EEP);									//WP pin for eeprom as output	LED_DDR |= _BV(LED_R) | _BV(LED_G) | _BV(LED_B);	AUX_PORT |= _BV(BTN0);									//Enable pull up on btn		PMOD_PORT |= _BV(PMOD0) | _BV(PMOD1) | _BV(PMOD2);		//Full auto			uartInit();	i2c_init();	sei();		DDRB |= _BV(PORTB2) | _BV(PORTB1) | _BV(PORTB0);	SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR0);  // SPI enable, Master, f/16		uartPutsP("/n/n[Base Station]/n");	uartPutsP(">Pins init/n");	timer0Init();	uartPutsP(">Timer 0 init/n");	timer1Init();	uartPutsP(">Timer 1 init/n");}
开发者ID:keeepcool,项目名称:Backup,代码行数:29,


示例13: main

int main() {	GPIO2DIR = BIT11; //LED to show if powered/reset/in ISP mode	GPIO2DATA = BIT11; // LED on	uartInit();	char rxc;	// while(1){		// while((U0LSR & BIT0) == 0){}; //wait for new char to be recieved		// char rxc = U0RBR;		// if(rxc == 'A') {			// GPIO2DATA = 0; //off			// for(volatile int i=0; i<1000000; i++){}; //delay			// GPIO2DATA = BIT11; //on		// } else {			// U0THR = rxc;		// }	// }	while(1){		while((U0LSR & BIT0) == 0){}; //wait for new char to be recieved		rxc = U0RBR;		GPIO2DATA ^= BIT11;		U0THR = rxc;		}			return 0;}
开发者ID:alexFickle,项目名称:sdp,代码行数:25,


示例14: gpsInit

/** * @brief GPS Init */void gpsInit(uchar uartId){	// Capture NMEA Sentence OFF	gpsCaptureNMEASentence = 0;	// Initialize Structs	structNmeaGPRMC.isValid = 'N';	structNmeaGPRMC.wasRead = 'Y';	// Configure GPS Pins	ioDigitalOutput(GPS_TX);	ioDigitalInput(GPS_RX);	ioDigitalWrite(GPS_ON_OFF,OFF);	ioDigitalOutput(GPS_ON_OFF);	ioDigitalInput(GPS_WAKE);	// UART init Clock 4MHz	uartInit(uartId);	// UART Read Interrupt	uartReadInterrupt(ON);	// Start GPS	ioDigitalWrite(GPS_ON_OFF,ON);	delayMs(200);	ioDigitalWrite(GPS_ON_OFF,OFF);	// Wait for GPS WakeUp	while(ioDigitalRead(GPS_ON_OFF));}
开发者ID:ctk4xm,项目名称:ctk4xm,代码行数:34,


示例15: main

int main (void){   cpuInit();   uartInit(BAUDRATE);   #ifdef CLKOUT   IOCON_PIO0_1 &= ~(0x3f);   IOCON_PIO0_1 |= IOCON_PIO0_1_FUNC_CLKOUT;      SCB_CLKOUTCLKSEL |= 0x3; // select system osci      SCB_CLKOUTCLKUEN = SCB_CLKOUTCLKUEN_UPDATE;   SCB_CLKOUTCLKUEN = SCB_CLKOUTCLKUEN_DISABLE;   SCB_CLKOUTCLKUEN = SCB_CLKOUTCLKUEN_UPDATE;   while( !(SCB_CLKOUTCLKUEN & SCB_CLKOUTCLKUEN_UPDATE));   SCB_CLKOUTCLKDIV = SCB_CLKOUTCLKDIV_DIV1;   #endif            //initPWM(16, 0, (1<<0), 256, 0);   printf("Starting in main/n");   cmdInit();   while (1)   {      cmdPoll();   }}
开发者ID:JoeSc,项目名称:Kitchen-Lighting,代码行数:28,


示例16: initialize_io_uart

void initialize_io_uart(void) {    /* On reset (i.e., before calling mcgInit), the processor clocking     * starts in FEI (FLL Engaged Internal) mode.  In FEI mode and with     * default settings (DRST_DRS = 00, DMX32 = 0), the MCGFLLCLK, the     * MCGOUTCLK (MCG (Multipurpose Clock Generator) clock), and the Bus     * (peripheral) clock are all set to 640 * IRC.  IRC is the Internal     * Reference Clock which runs at 32 KHz. [See K70 Sub-Family     * Reference Manual, Rev. 2, Section 25.4.1.1, Table 25-22 on     * page 657 and MCG Control 4 Register (MCG_C4) Section 25.3.4 on     * page 641] */    /* After calling mcgInit, MCGOUTCLK is set to 120 MHz and the Bus     * (peripheral) clock is set to 60 MHz.*/    /* Table 5-2 on page 221 indicates that the clock used by UART0 and     * UART1 is the System clock (i.e., MCGOUTCLK) and that the clock     * used by UART2-5 is the Bus clock. */    const int busClock = 60000000;    const int KHzInHz = 1000;    const int busBaud = 115200;    uartInit(UART2_BASE_PTR, busClock/KHzInHz, busBaud);    intSerialIOInit();}
开发者ID:skarger,项目名称:sos,代码行数:25,


示例17: setup

void setup() {  uartInit();  uartSetBaudRate(0, 9600);  rprintfInit(uart0SendByte);  //rprintf("$Id$");  // this goes to the switch common  sbi(DDRD, PD4); // output on PD4  cbi(PORTD, PD4); // take it low  // rocker  cbi(DDRD, PD5); // input on PD5  sbi(PORTD, PD5); // tri-state the input  // rocker  cbi(DDRD, PD6);  sbi(PORTD, PD6); // tri-state the input  // rocker press  cbi(DDRD, PD7);  sbi(PORTD, PD7);  sbi(DDRB, PB3); // output for the LED  sbi(PORTB, PB3); }
开发者ID:bleeckerj,项目名称:AVRExperiments,代码行数:26,


示例18: cmdInit

void cmdInit(){  #if defined CFG_INTERFACE && defined CFG_INTERFACE_UART    // Check if UART is already initialised    uart_pcb_t *pcb = uartGetPCB();    if (!pcb->initialised)    {      uartInit(CFG_UART_BAUDRATE);    }  #endif  #if CFG_INTERFACE_ENABLEIRQ != 0    // Set IRQ pin as output    gpioSetDir(CFG_INTERFACE_IRQPORT, CFG_INTERFACE_IRQPIN, gpioDirection_Output);    gpioSetValue(CFG_INTERFACE_IRQPORT, CFG_INTERFACE_IRQPIN, 1);  #endif  // init the msg ptr  msg_ptr = msg;  // Show the menu  cmdMenu();  // Set the IRQ pin low by default  #if CFG_INTERFACE_ENABLEIRQ  != 0    gpioSetValue(CFG_INTERFACE_IRQPORT, CFG_INTERFACE_IRQPIN, 0);  #endif}
开发者ID:AhmedBadran,项目名称:lpc1343codebase,代码行数:28,


示例19: oscInit

// functionsvoid oscInit(void){	// initialize uart (if not already done)	uartInit();	// set the default communication rate	uartSetBaudRate(38400);}
开发者ID:BackupTheBerlios,项目名称:rundfunker,代码行数:8,


示例20: MB_init

MB_ErrorTypeDef MB_init(uint8_t devAddr, uint32_t baudRate, uint32_t cpuFrequency){MB_ErrorTypeDef error = MB_ERROR_OK;  if ((devAddr < MB_ADDR_MIN) || (devAddr > MB_ADDR_MAX) || (baudRate == 0)) {    error = MB_ERROR_ILLVAL;  }  else {    mbDevAddr = devAddr;    uart.baudRate = baudRate;    uart.cpuFrequency = cpuFrequency;    uart.byte_received_cb = MB_byte_received_cb;    uart.byte_sent_cb = MB_byte_sent_cb;    uartInit(&uart);    printf("UART initialized at %u bod/n", (unsigned int)uart.baudRate);    if (cpuFrequency > MODBUS_BIG_BAUDRATE)                                                     //For baud rates more than 19200 fixed intervals used (1750us, 750us)    {      tChar = TCHAR;    }    else                                                                                        //else calculate these intervals    {      tChar = (uint16_t)(11 * cpuFrequency / baudRate);                                         //1 char (11bit per char)    }    mbState = MB_STATE_DISABLED;    rxState = RX_STATE_IDLE;    txState = TX_STATE_IDLE;  }  return error;}
开发者ID:Lexatagan,项目名称:modbus,代码行数:31,


示例21: bootstrap

static void bootstrap(){	const int moduleClock = 12000000;	const int KHzInHz = 1000;	const int baud = 115200;	mcgInit();	sdramInit();	svcInit_SetSVCPriority(15);	setSysTickPriority(14);	setPendSVPriority(14);	uartInit(UART2_BASE_PTR, moduleClock/KHzInHz, baud);	lcdcInit();	lcdcConsoleInit(&console);	adc_init();	vfs_init();	ledInitAll();	pushbuttonInitAll();	TSI_Init();	TSI_Calibrate();	init_memory();	//uinit();	intSerialIOInit();	flexTimerInit();	sysTickInit();}
开发者ID:siddhugit,项目名称:Operating-System,代码行数:25,


示例22: setup

void setup() {  uartInit();  uartSetBaudRate(0, 9600);  rprintfInit(uart0SendByte);  rprintf("Hello../r/n");  //vt100Init();  cbi(DDRC, DDC3); // input   cbi(DDRA, DDA0); // input  cbi(DDRA, DDA1); // input  cbi(DDRA, DDA2); // input  cbi(DDRA, DDA3); // input  cbi(DDRA, DDA4);    sbi(DDRA, DDA5); // output connected by select to PA4  cbi(PORTA, PA5);    sbi(PORTA, PA0); // pull-ups enabled  sbi(PORTA, PA1);  sbi(PORTA, PA2);  sbi(PORTA, PA3);  sbi(PORTA, PA4);  cbi(PORTA, PA5);    cbi(DDRD, DDD6); // input  //cbi(PORTB, PB3);  // We want PCINT30 enabled so we know when the charger is connected  //  PCICR |= (1<<PCIE3); // enable pin change interrupt 3 for PCINT31..24. //  PCMSK3 |= 0xFF;//(1<<PCINT30); // enable PCINT30  // arb switch  PCICR |= (0<<PCIE3) | (0<<PCIE2) | (0<<PCIE1) | (1<<PCIE0);  //  PCMSK3 |= (1<<PCINT30);  //  PCMSK3 |= (1<<PCINT26);  //  PCMSK2 |= (1<<PCINT19);  PCMSK0 |= (1<<PCINT0) | (1<<PCINT1) | (1<<PCINT2) | (1<<PCINT3) | (1<<PCINT4) | (1<<PCINT5);  // set up the power pulse LED    TCCR0A |= (1<<WGM00) | (1<<COM0A1); // mode 1, phase-correct PWM  TCCR0B |= (1<<CS02); // clk/256 from prescaler  //TCCR0B |= (0<<CS02) | (1<<CS01) | (1<<CS00); // clk/64  TCNT0 = 0x00;  sbi(TIMSK0, TOIE0);  sbi(DDRB, PB3);  sbi(PORTB, PB3);/*  cbi(DDRD, PD6); // configure PD6 as input  sbi(PORTD, PD6); // turn on pull-up resistor*/  sei();}
开发者ID:bleeckerj,项目名称:AVRExperiments,代码行数:59,


示例23: halInit

/** * @brief   HAL initialization. * @details This function invokes the low level initialization code then *          initializes all the drivers enabled in the HAL. Finally the *          board-specific initialization is performed by invoking *          @p boardInit() (usually defined in @p board.c). * * @init */void halInit(void) {  hal_lld_init();#if HAL_USE_TM || defined(__DOXYGEN__)  tmInit();#endif#if HAL_USE_PAL || defined(__DOXYGEN__)  palInit(&pal_default_config);#endif#if HAL_USE_ADC || defined(__DOXYGEN__)  adcInit();#endif#if HAL_USE_CAN || defined(__DOXYGEN__)  canInit();#endif#if HAL_USE_EXT || defined(__DOXYGEN__)  extInit();#endif#if HAL_USE_GPT || defined(__DOXYGEN__)  gptInit();#endif#if HAL_USE_I2C || defined(__DOXYGEN__)  i2cInit();#endif#if HAL_USE_ICU || defined(__DOXYGEN__)  icuInit();#endif#if HAL_USE_MAC || defined(__DOXYGEN__)  macInit();#endif#if HAL_USE_PWM || defined(__DOXYGEN__)  pwmInit();#endif#if HAL_USE_SERIAL || defined(__DOXYGEN__)  sdInit();#endif#if HAL_USE_SDC || defined(__DOXYGEN__)  //KL All in Kl_sdc sdcInit();#endif#if HAL_USE_SPI || defined(__DOXYGEN__)  spiInit();#endif#if HAL_USE_UART || defined(__DOXYGEN__)  uartInit();#endif#if HAL_USE_USB || defined(__DOXYGEN__)  usbInit();#endif#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)  mmcInit();#endif#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__)  sduInit();#endif#if HAL_USE_RTC || defined(__DOXYGEN__)  rtcInit();#endif}
开发者ID:Kreyl,项目名称:WitcherGlove,代码行数:68,


示例24: init

/** * @fn      void init( void ); * @brief   Configuration des périphériques */void init(void){//    gpioInit();    uartInit();    timerInit();    pwmInit();    spiChannel = ads7885Pic32Open( CHN_SPI, 40 );}
开发者ID:ChakChel,项目名称:Ix,代码行数:12,


示例25: initUart

void initUart(void){	uartInit();	 // make all rprintf statements use uart for output	rprintfInit(uartSendByte);	 // initialize the timer system	uartSetBaudRate(2400);}
开发者ID:PradheepShrinivasan,项目名称:SmartHome,代码行数:8,


示例26: resetUart

static void resetUart(void){    uartInit(baud.dword, parity, stopbit, databit);    irptr    = 0;    iwptr    = 0;    urptr    = 0;    uwptr    = 0;}
开发者ID:AkashGutha,项目名称:avr,代码行数:9,


示例27: main

int main(void){  /* USER CODE BEGIN 1 */  /* USER CODE END 1 */  /* MCU Configuration----------------------------------------------------------*/  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */  HAL_Init();  /* Configure the system clock */  SystemClock_Config();  /* Initialize all configured peripherals */  MX_GPIO_Init();  MX_DMA_Init();  MX_ADC1_Init();  MX_I2C1_Init();  MX_RTC_Init();  MX_SPI2_Init();  MX_TIM1_Init();  MX_TIM2_Init();  MX_TIM3_Init();  MX_TIM4_Init();  MX_USART3_UART_Init();  /* USER CODE BEGIN 2 */	encoderInit();	pwmInit();//	adcInit();	uartInit();	timInterruptInit();	gyroInit(GYROHIGH);	calibrateGyro();//	rotaryRight(800);//	HAL_Delay(500);//	rotaryLeft(800);	drive(VEL);  /* USER CODE END 2 */  /* Infinite loop */  /* USER CODE BEGIN WHILE */  while (1)  {  /* USER CODE END WHILE */  /* USER CODE BEGIN 3 */  }  /* USER CODE END 3 */}
开发者ID:marek848,项目名称:Minotaur2_New,代码行数:56,


示例28: serialInit

void serialInit(void){	// Initialize the serial port for USB serial bridge	uartInit(115200, 115200);//	TURN_OFF_SYSTEM_MESSAGES();	TURN_ON_SYSTEM_MESSAGES();	system_os_task(taskHandler, USER_TASK_PRIO_0, taskQueue, taskQueueLen);//	DISPLAY_MENU();	DISPLAY_MENU_W_SPI();}
开发者ID:MackPI,项目名称:UProgrammer-Firmware,代码行数:10,


示例29: appInitHardware

// Now create any global variables such as motors, servos, sensors etc// This routine is called once only and allows you to do set up the hardware// Dont use any 'clock' functions here - use 'delay' functions insteadvoid appInitHardware(void){	a2dSetPrescaler(ADC_PRESCALE_DIV128);	cyrf6936_Initialise_hard();	// Initialise SPI bus as master. (RF modules connected to hardware SPI)    spiBusInit(&bus, TRUE);	spiDeviceSelect(&cyrf_0, TRUE);	spiDeviceSelect(&cyrf_0, FALSE);	spiDeviceSelect(&cyrf_1, TRUE);	spiDeviceSelect(&cyrf_1, FALSE);	// set I/O pins for RF module(s).	pin_make_input(D4, FALSE);		// set PACTL pin to input. (module on connector J1)	pin_make_input(D5, FALSE);		// set PACTLn pin to input. (module on connector J1)	pin_make_input(D6, FALSE);		// set PACTL pin to input. (module on connector J2)	pin_make_input(D7, FALSE);		// set PACTLn pin to input. (module on connector J2)#ifdef RF_MODULE_ARTAFLEX	//	pin_make_output(D4, FALSE);			// set RXPA pin to output. (module on connector J1)	pin_make_output(D5, FALSE);			// set TXPA pin to output. (module on connector J1)	pin_make_output(D6, FALSE);			// set RXPA pin to output. (module on connector J2)	pin_make_output(D7, FALSE);			// set TXPA pin to output. (module on connector J2)#endif	pin_make_input(E7, TRUE);		// set UNIGEN RF module IRQ pin to input. (module on connector J1)	pin_make_input(E6, TRUE);		// set UNIGEN RF module IRQ pin to input. (module on connector J2)	pin_make_output(G3, FALSE);			// set UNIGEN RF module RST pin to output. (both modules)	//pin_low(G3);					// don't reset yet.	// set I/O pins for status LEDs	pin_make_output(C0, TRUE);			// set LED pin for output	pin_make_output(C1, TRUE);			// set LED pin for output	pin_make_output(C2, FALSE);			// set LED pin for output	//pin_high(C0);					// LED off	//pin_high(C1);					// LED off	//pin_low(C2);					// LED on	// Set UART1 to 19200 baud    uartInit(UART1, 38400);    // Tell rprintf to output to UART1    rprintfInit(&uart1SendByte);    // Initialise the servo controller using Hardware PWM    servoPWMInit(&bank1);    // Initialise WatchDog Timer    wdt_enable( WDTO_500MS );}
开发者ID:byrnedawg,项目名称:Polska,代码行数:58,


示例30: main

//----- Begin Code ------------------------------------------------------------int main(void){	u16 a=0;	u08 i=0;	// initialize our libraries	// initialize the UART (serial port)	uartInit();	// make all rprintf statements use uart for output	rprintfInit(uartSendByte);	// initialize the timer system	timerInit();	// turn on and initialize A/D converter	a2dInit();	// print a little intro message so we know things are working	vt100ClearScreen();	vt100SetCursorPos(1,1);	rprintf("Welcome to the a2d test!/r/n");		// configure a2d port (PORTA) as input	// so we can receive analog signals	DDRA = 0x00;	// make sure pull-up resistors are turned off	PORTA = 0x00;	// set the a2d prescaler (clock division ratio)	// - a lower prescale setting will make the a2d converter go faster	// - a higher setting will make it go slower but the measurements	//   will be more accurate	// - other allowed prescale values can be found in a2d.h	a2dSetPrescaler(ADC_PRESCALE_DIV32);	// set the a2d reference	// - the reference is the voltage against which a2d measurements are made	// - other allowed reference values can be found in a2d.h	a2dSetReference(ADC_REFERENCE_AVCC);	// use a2dConvert8bit(channel#) to get an 8bit a2d reading	// use a2dConvert10bit(channel#) to get a 10bit a2d reading	while(1)	{		// sample all a2d channels and print them to the terminal		vt100SetCursorPos(2,1);		for(i=0; i<8; i++)		{			rprintf("Channel %d: %d   /r/n", i, a2dConvert8bit(i));		}		// print the sample number so far		rprintf("Sample # : %d   /r/n", a++);	}		return 0;}
开发者ID:46nori,项目名称:avr-liberty,代码行数:56,



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


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