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

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

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

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

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

示例1: usart_setup

static void usart_setup(void){	/* Initialize output ring buffer. */	ring_init(&output_ring, output_ring_buffer, BUFFER_SIZE);	/* Enable the USART2 interrupt. */	nvic_enable_irq(NVIC_USART2_IRQ);	/* Setup GPIO pin GPIO_USART2_TX on GPIO port A for transmit. */	gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,		      GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART2_TX);	/* Setup GPIO pin GPIO_USART2_RX on GPIO port A for receive. */	gpio_set_mode(GPIOA, GPIO_MODE_INPUT,		      GPIO_CNF_INPUT_FLOAT, GPIO_USART2_RX);	/* Setup UART parameters. */	usart_set_baudrate(USART2, 230400);	usart_set_databits(USART2, 8);	usart_set_stopbits(USART2, USART_STOPBITS_1);	usart_set_parity(USART2, USART_PARITY_NONE);	usart_set_flow_control(USART2, USART_FLOWCONTROL_NONE);	usart_set_mode(USART2, USART_MODE_TX_RX);	/* Enable USART2 Receive interrupt. */	USART_CR1(USART2) |= USART_CR1_RXNEIE;	/* Finally enable the USART. */	usart_enable(USART2);}
开发者ID:insane-adding-machines,项目名称:unicore-mx-examples,代码行数:30,


示例2: usart_setup

void usart_setup(void) {  /* Enable clocks for GPIO port B (for GPIO_USART1_TX) and USART1. */  rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);  rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN);  rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_USART1EN);  gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,                GPIO_CNF_OUTPUT_PUSHPULL, GPIO5);  gpio_clear(GPIOB, GPIO5);  AFIO_MAPR |= AFIO_MAPR_USART1_REMAP;  gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,                GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_RE_TX);  gpio_set_mode(GPIOB, GPIO_MODE_INPUT,                GPIO_CNF_INPUT_FLOAT, GPIO_USART1_RE_RX);  /* Setup UART parameters. */  usart_set_baudrate(USART1, 115200);  usart_set_databits(USART1, 8);  usart_set_stopbits(USART1, USART_STOPBITS_1);  usart_set_mode(USART1, USART_MODE_TX_RX);  usart_set_parity(USART1, USART_PARITY_NONE);  usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);  /* Finally enable the USART. */  usart_enable(USART1);}
开发者ID:arpit15,项目名称:SubjuGator,代码行数:28,


示例3: dbg_serial_init

void dbg_serial_init(void){    dbg_fifo_flush( &usart_rx_buf );    dbg_fifo_flush( &usart_tx_buf );    rcc_periph_clock_enable(RCC_AFIO);    rcc_periph_clock_enable(DBG_USART_PERIPH);    rcc_periph_clock_enable(DBG_USART_TX_PERIPH);#if (DBG_USART_RX_PERIPH != DBG_USART_TX_PERIPH)    rcc_periph_clock_enable(DBG_USART_RX_PERIPH);#endif    /* Enable the DBG_USART interrupt. */    nvic_enable_irq(DBG_USART_VECTOR);    /* Setup GPIO pins for USART transmit. */    gpio_set_mode(DBG_USART_TX_PORT, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, DBG_USART_TX_PIN);    /* Setup GPIO pins for USART receive. */    gpio_set_mode(DBG_USART_RX_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_PULL_UPDOWN, DBG_USART_RX_PIN);    gpio_set(DBG_USART_RX_PORT, DBG_USART_RX_PIN);    /* Setup USART parameters. */    usart_set_baudrate    (DBG_USART, 57600);    usart_set_databits    (DBG_USART, 8);    usart_set_stopbits    (DBG_USART, USART_STOPBITS_1);    usart_set_mode        (DBG_USART, USART_MODE_TX_RX);    usart_set_parity      (DBG_USART, USART_PARITY_NONE);    usart_set_flow_control(DBG_USART, USART_FLOWCONTROL_NONE);    /* Enable USART Receive interrupt. */    usart_enable_rx_interrupt(DBG_USART);    /* Finally enable the USART. */    usart_enable(DBG_USART);}
开发者ID:nucleron,项目名称:yaplc,代码行数:34,


示例4: usart_init

void usart_init( int baudrate ){	gpio_set_mode(GPIOA, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, GPIO_USART1_RX);	gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);#ifdef BUFFERED	buffer_reset (&u1rx);	buffer_reset (&u1tx);	nvic_enable_irq(NVIC_USART1_IRQ);	usart_enable_rx_interrupt(USART1);	usart_disable_tx_interrupt(USART1);#endif	// usart peripheral confguration	usart_set_baudrate(USART1, baudrate);	usart_set_databits(USART1, 8);	usart_set_parity(USART1, USART_PARITY_NONE);	usart_set_mode(USART1, USART_MODE_TX_RX);	usart_set_stopbits(USART1, USART_STOPBITS_1);	usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);	usart_enable(USART1);}
开发者ID:alex-sever-h,项目名称:robot,代码行数:28,


示例5: usart_setup

void usart_setup(void){    /* Setup clock */    /* Enable GPIOA clock for USART. */    rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPAEN);        /* Enable clocks for USART2. */    rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USART2EN);        /* Setup GPIO pins for USART2 transmit. */    gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO2);        /* Setup USART2 TX pin as alternate function. */    gpio_set_af(GPIOA, GPIO_AF7, GPIO2);        /* Setup USART2 parameters. */    usart_set_baudrate(USART2, 115200);    usart_set_databits(USART2, 8);    usart_set_stopbits(USART2, USART_STOPBITS_1);    usart_set_mode(USART2, USART_MODE_TX);    usart_set_parity(USART2, USART_PARITY_NONE);    usart_set_flow_control(USART2, USART_FLOWCONTROL_NONE);        /* Finally enable the USART. */    usart_enable(USART2);}
开发者ID:Flauer82,项目名称:pcbwriter,代码行数:26,


示例6: usart_setup

static void usart_setup(void){	/* Enable the USART1 interrupt. */	nvic_enable_irq(NVIC_USART3_IRQ);	/* Setup GPIO pins for USART3 transmit. */	gpio_mode_setup(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO10);	/* Setup GPIO pins for USART3 receive. */	gpio_mode_setup(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO11);	gpio_set_output_options(GPIOB, GPIO_OTYPE_OD, GPIO_OSPEED_25MHZ, GPIO11);	/* Setup USART3 TX and RX pin as alternate function. */	gpio_set_af(GPIOB, GPIO_AF7, GPIO10);	gpio_set_af(GPIOB, GPIO_AF7, GPIO11);	/* Setup USART3 parameters. */	usart_set_baudrate(USART3, 115200);	usart_set_databits(USART3, 8);	usart_set_stopbits(USART3, USART_STOPBITS_1);	usart_set_mode(USART3, USART_MODE_TX_RX);	usart_set_parity(USART3, USART_PARITY_NONE);	usart_set_flow_control(USART3, USART_FLOWCONTROL_NONE);	/* Enable USART1 Receive interrupt. */	usart_enable_rx_interrupt(USART3);	/* Finally enable the USART. */	usart_enable(USART3);}
开发者ID:insane-adding-machines,项目名称:unicore-mx-examples,代码行数:30,


示例7: usart_init_spi

/** * /brief Initialize USART in SPI master mode. * * This function initializes the USART module in SPI master mode using the * usart_spi_options_t configuration structure and CPU frequency. * * /param usart The USART module. * /param opt The RS232 configuration option. */void usart_init_spi(USART_t *usart, const usart_spi_options_t *opt){	usart->UBRR = 0;	usart_enable_module_clock(usart);	usart_set_mode(usart, USART_CMODE_MSPI_gc);	if (opt->spimode == 1 || opt->spimode == 3) {		usart->UCSRnC |= USART_UCPHA_bm;	} else {		usart->UCSRnC &= ~USART_UCPHA_bm;	}	if (opt->spimode == 2 || opt->spimode == 3) {		usart->UCSRnC |= USART_UCPOL_bm;	} else {		usart->UCSRnC &= ~USART_UCPOL_bm;	}			if (opt->data_order) {		usart->UCSRnC |= USART_DORD_bm;	} else {		usart->UCSRnC &= ~USART_DORD_bm;	}			usart_spi_set_baudrate(usart, opt->baudrate,			sysclk_get_source_clock_hz());	usart_tx_enable(usart);	usart_rx_enable(usart);}
开发者ID:thegeek82000,项目名称:asf,代码行数:39,


示例8: run_loopback_syncmode_test

/** * /brief Test physical loop-back with some characters in sunc mode. * * This function sends a character over USART on loop back to verify that init * and sending/receiving works. A jumper is connected on the USART. * * /param test Current test case. */static void run_loopback_syncmode_test(const struct test_case *test){	uint8_t out_c = 'c';	uint8_t in_c  = 0;        port_pin_t sck_pin;                sysclk_enable_module(POWER_RED_REG0, PRUSART0_bm);                usart_set_mode(&CONF_UNIT_USART, USART_CMODE_SYNCHRONOUS_gc);	sck_pin = IOPORT_CREATE_PIN(PORTE, 2);	ioport_configure_port_pin(ioport_pin_to_port(sck_pin),				ioport_pin_to_mask(sck_pin),				IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH );                usart_spi_set_baudrate(&CONF_UNIT_USART, CONF_UNIT_BAUDRATE,			sysclk_get_source_clock_hz());	usart_tx_enable(&CONF_UNIT_USART);	usart_rx_enable(&CONF_UNIT_USART);	usart_putchar(&CONF_UNIT_USART, out_c);	in_c = usart_getchar(&CONF_UNIT_USART);	test_assert_true(test, in_c == out_c,	   "Read character through sync mode is not correct: %d != %d", in_c, out_c);			}
开发者ID:marekr,项目名称:asf,代码行数:34,


示例9: uart7_cinit

void uart7_cinit(uint32_t whichUsart){	/* board is expected to do pin and clock setup */	/* do usart setup */	//USART_CR1(usart) |= (1 << 15);	/* because libopencm3 doesn't know the OVER8 bit */	usart_set_baudrate(whichUsart, 57600);	usart_set_databits(whichUsart, 8);	usart_set_stopbits(whichUsart, USART_STOPBITS_1);	usart_set_mode(whichUsart, USART_MODE_TX_RX);	usart_set_parity(whichUsart, USART_PARITY_NONE);	usart_set_flow_control(whichUsart, USART_FLOWCONTROL_NONE);	/* and enable */	usart_enable(whichUsart);#if 0	usart_send_blocking(whichUsart, 'B');	usart_send_blocking(whichUsart, 'B');	usart_send_blocking(whichUsart, 'B');	usart_send_blocking(whichUsart, 'B');	while (true) {		int c;		c = usart_recv_blocking(whichUsart);		usart_send_blocking(whichUsart, c);	}#endif}
开发者ID:liangzelang,项目名称:Bootloader_PX4_SD,代码行数:33,


示例10: mew_bluetooth_init

void mew_bluetooth_init(void) {    gpio_mode_setup(MEW_BLUETOOTH_POWER_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, MEW_BLUETOOTH_POWER_PIN);    gpio_set_output_options(MEW_BLUETOOTH_POWER_PORT, GPIO_OTYPE_PP, GPIO_OSPEED_100MHZ, MEW_BLUETOOTH_POWER_PIN);    gpio_clear(MEW_BLUETOOTH_POWER_PORT, MEW_BLUETOOTH_POWER_PIN);        gpio_mode_setup(MEW_BLUETOOTH_RESET_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, MEW_BLUETOOTH_RESET_PIN);    gpio_set_output_options(MEW_BLUETOOTH_RESET_PORT, GPIO_OTYPE_PP, GPIO_OSPEED_100MHZ, MEW_BLUETOOTH_RESET_PIN);    gpio_set(MEW_BLUETOOTH_RESET_PORT, MEW_BLUETOOTH_RESET_PIN);        gpio_mode_setup(MEW_BLUETOOTH_PORT, GPIO_MODE_AF, GPIO_PUPD_NONE, MEW_BLUETOOTH_PIN);    gpio_set_af(MEW_BLUETOOTH_PORT, MEW_BLUETOOTH_PORT_AF, MEW_BLUETOOTH_PIN);        usart_disable(MEW_BLUETOOTH_USART);    usart_set_baudrate(MEW_BLUETOOTH_USART, MEW_BLUETOOTH_SPEED);    usart_set_databits(MEW_BLUETOOTH_USART, 8);    usart_set_stopbits(MEW_BLUETOOTH_USART, USART_STOPBITS_1);    usart_set_mode(MEW_BLUETOOTH_USART, USART_MODE_TX_RX);    usart_set_parity(MEW_BLUETOOTH_USART, USART_PARITY_NONE);    usart_set_flow_control(MEW_BLUETOOTH_USART, USART_FLOWCONTROL_NONE);    usart_enable_rx_interrupt(MEW_BLUETOOTH_USART);    usart_disable_tx_interrupt(MEW_BLUETOOTH_USART);    usart_enable_tx_dma(MEW_BLUETOOTH_USART);    usart_enable(MEW_BLUETOOTH_USART);        nvic_enable_irq(MEW_BLUETOOTH_IRQ);    nvic_enable_irq(MEW_BLUETOOTH_DMA_NVIC_TX);        memset(_mew_bt_buffer, 0, MEW_BT_RECEIVE_BUFFER_SIZE);}
开发者ID:konachan700,项目名称:Mew,代码行数:29,


示例11: usart_setup

void usart_setup(void){/* Enable clocks for GPIO port A (for GPIO_USART1_TX) and USART1. */	rcc_periph_clock_enable(RCC_GPIOA);	rcc_periph_clock_enable(RCC_USART1);	rcc_periph_clock_enable(RCC_AFIO);/* Enable the USART1 interrupt. */	nvic_enable_irq(NVIC_USART1_IRQ);/* Setup GPIO pin GPIO_USART1_RE_TX on GPIO port A for transmit. */	gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,		      GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);/* Setup GPIO pin GPIO_USART1_RE_RX on GPIO port A for receive. */	gpio_set_mode(GPIOA, GPIO_MODE_INPUT,		      GPIO_CNF_INPUT_FLOAT, GPIO_USART1_RX);/* Setup UART parameters. */	usart_set_baudrate(USART1, 115200);	usart_set_databits(USART1, 8);	usart_set_stopbits(USART1, USART_STOPBITS_1);	usart_set_parity(USART1, USART_PARITY_NONE);	usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);	usart_set_mode(USART1, USART_MODE_TX_RX);/* Enable USART1 receive interrupts. */	usart_enable_rx_interrupt(USART1);	usart_disable_tx_interrupt(USART1);/* Finally enable the USART. */	usart_enable(USART1);}
开发者ID:JamesLinus,项目名称:ARM-Ports,代码行数:27,


示例12: usart_setup

static void usart_setup(void){	/* Enable the USART1 interrupt. */	nvic_enable_irq(NVIC_USART1_IRQ);	/* Setup GPIO pin GPIO_USART1_RE_TX on GPIO port B for transmit. */	gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,		      GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);	/* Setup GPIO pin GPIO_USART1_RE_RX on GPIO port B for receive. */	gpio_set_mode(GPIOA, GPIO_MODE_INPUT,		      GPIO_CNF_INPUT_FLOAT, GPIO_USART1_RX);	/* Setup UART parameters. */	usart_set_baudrate(USART1, 230400);	usart_set_databits(USART1, 8);	usart_set_stopbits(USART1, USART_STOPBITS_1);	usart_set_parity(USART1, USART_PARITY_NONE);	usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);	usart_set_mode(USART1, USART_MODE_TX_RX);	/* Enable USART1 Receive interrupt. */	USART_CR1(USART1) |= USART_CR1_RXNEIE;	/* Finally enable the USART. */	usart_enable(USART1);}
开发者ID:SnoreCopter,项目名称:libopencm3-examples,代码行数:27,


示例13: bluetooth_init

void bluetooth_init(void){	rcc_periph_clock_enable(RCC_B_WAKE_SW_PORT);	rcc_periph_clock_enable(RCC_B_WAKE_HW_PORT);	rcc_periph_clock_enable(RCC_B_CMD_PORT);	gpio_mode_setup(B_WAKE_SW_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, B_WAKE_SW_PIN);	gpio_mode_setup(B_WAKE_HW_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, B_WAKE_HW_PIN);	gpio_mode_setup(B_CMD_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, B_CMD_PIN);	//uart	rcc_periph_clock_enable(RCC_B_USART);	gpio_mode_setup(B_USART_PORT, GPIO_MODE_AF, GPIO_PUPD_NONE, B_USART_TX_PIN|B_USART_RX_PIN);	gpio_set_af(B_USART_PORT, GPIO_AF1, B_USART_TX_PIN|B_USART_RX_PIN);	usart_set_baudrate(B_USART, 115200);//9600 );	usart_set_databits(B_USART, 8);	usart_set_stopbits(B_USART, USART_CR2_STOP_1_0BIT);	usart_set_mode(B_USART, USART_MODE_TX_RX);	usart_set_parity(B_USART, USART_PARITY_NONE);	usart_set_flow_control(B_USART, USART_FLOWCONTROL_NONE);	usart_enable(B_USART);}
开发者ID:mattbrejza,项目名称:lora-tracker,代码行数:25,


示例14: comm_init

/** * Initializes the clocks, the UART peripheral, and the RX and TX buffer * structures. */static void comm_init(void){	os_char_buffer_init(&bsp_rx_buffer,	                    rx_buffer_mem,	                    BSP_RX_BUFFER_SIZE,	                    NULL);	os_char_buffer_init(&bsp_tx_buffer,	                    tx_buffer_mem,	                    BSP_TX_BUFFER_SIZE,	                    enable_usart1_tx_interrupt);	rcc_periph_clock_enable(RCC_GPIOA);	rcc_periph_clock_enable(RCC_USART1);	gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO9 | GPIO10);	gpio_set_af(GPIOA, GPIO_AF1, GPIO9 | GPIO10);	usart_set_baudrate(USART1, 115200);	usart_set_databits(USART1, 8);	usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);	usart_set_mode(USART1, USART_MODE_TX_RX);	usart_set_parity(USART1, USART_PARITY_NONE);	usart_set_stopbits(USART1, USART_CR2_STOP_1_0BIT);	usart_enable_rx_interrupt(USART1);	usart_enable(USART1);	nvic_set_priority(NVIC_USART1_IRQ, 0);	nvic_enable_irq(NVIC_USART1_IRQ);}
开发者ID:mour,项目名称:ratfist-stm32,代码行数:37,


示例15: UART_Initialize

void UART_Initialize(){    /* Enable clocks for GPIO port containing _USART and USART */    rcc_periph_clock_enable(get_rcc_from_port(UART_CFG.uart));    rcc_periph_clock_enable(get_rcc_from_pin(UART_CFG.rx));    rcc_periph_clock_enable(get_rcc_from_pin(UART_CFG.tx));    /* Enable DMA clock */    rcc_periph_clock_enable(get_rcc_from_port(USART_DMA.dma));    /* Setup GPIO pin GPIO_USARTX_TX on USART GPIO port for transmit.       Set normal function to input as this is mode reverted to in half-duplex receive */    GPIO_setup_input(UART_CFG.rx, ITYPE_FLOAT);    GPIO_setup_output_af(UART_CFG.tx, OTYPE_PUSHPULL, UART_CFG.uart);    /* Setup UART parameters. */    UART_SetDataRate(0);    UART_SetFormat(8, UART_PARITY_NONE, UART_STOPBITS_1);    UART_SetDuplex(UART_DUPLEX_FULL);    usart_set_flow_control(UART_CFG.uart, USART_FLOWCONTROL_NONE);    usart_set_mode(UART_CFG.uart, USART_MODE_TX_RX);    /* Finally enable the USART. */    usart_enable(UART_CFG.uart);    nvic_set_priority(get_nvic_dma_irq(USART_DMA), 3);    nvic_enable_irq(get_nvic_dma_irq(USART_DMA));#if HAS_AUDIO_UART    /* Enable clocks for GPIO port C (for GPIO_UART5_TX) and UART5. */    rcc_periph_clock_enable(get_rcc_from_port(AUDIO_UART_CFG.uart));    rcc_periph_clock_enable(get_rcc_from_pin(AUDIO_UART_CFG.tx));    /* Setup GPIO pins to use UART5 */    GPIO_setup_output_af(AUDIO_UART_CFG.tx, OTYPE_PUSHPULL, AUDIO_UART_CFG.uart);    /* Setup UART5 parameters. */    usart_set_baudrate(AUDIO_UART_CFG.uart, 9600);    usart_set_databits(AUDIO_UART_CFG.uart, 8);    usart_set_stopbits(AUDIO_UART_CFG.uart, USART_STOPBITS_1);    usart_set_parity(AUDIO_UART_CFG.uart, USART_PARITY_NONE);    usart_set_mode(AUDIO_UART_CFG.uart, USART_MODE_TX);    /* Finally enable the AUDIO_UART_CFG.uart. */    usart_enable(AUDIO_UART_CFG.uart);#endif}
开发者ID:goebish,项目名称:deviation,代码行数:47,


示例16: UART_setspeed

/** * Set UART speed * @param lc - UART parameters or NULL for value from cdcacm.c (started - B115200,8,N,1) */void UART_setspeed(uint32_t UART) {    usart_set_baudrate(UART, 9600);    usart_set_databits(UART, 8);    usart_set_stopbits(UART, USART_STOPBITS_1);    usart_set_parity(UART, USART_PARITY_NONE);    usart_set_flow_control(UART, USART_FLOWCONTROL_NONE);    usart_set_mode(UART, USART_MODE_TX_RX);}
开发者ID:alkyl1978,项目名称:stm32samples,代码行数:12,


示例17: usart_setup

/* Debug output over USART1. */void usart_setup(void) {	usart_set_baudrate(USART1, 460800);	usart_set_databits(USART1, 8);	usart_set_stopbits(USART1, USART_STOPBITS_1);	usart_set_mode(USART1, USART_MODE_TX_RX);	usart_set_parity(USART1, USART_PARITY_NONE);	usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);	usart_enable(USART1);}
开发者ID:iqyx,项目名称:kiwi-basic,代码行数:10,


示例18: UART_Stop

void UART_Stop(){    UART_StopReceive();    nvic_disable_irq(get_nvic_dma_irq(USART_DMA));    usart_set_mode(UART_CFG.uart, 0);    usart_disable(UART_CFG.uart);    rcc_periph_clock_disable(get_rcc_from_port(UART_CFG.uart));    GPIO_setup_input(UART_CFG.tx, ITYPE_FLOAT);}
开发者ID:goebish,项目名称:deviation,代码行数:9,


示例19: uart_setup

/* Configure USART2 as a 38400, 8N1 serial port that has an interrupt * driven receive function (transmit is blocking) */void uart_setup(int baud){    /* Setup GPIO pins for USART2 transmit. */    gpio_mode_setup(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO6);    gpio_mode_setup(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO7);    gpio_set_output_options(GPIOC, GPIO_OTYPE_OD, GPIO_OSPEED_25MHZ, GPIO7);    gpio_set_af(GPIOC, GPIO_AF8, GPIO6);    gpio_set_af(GPIOC, GPIO_AF8, GPIO7);    /* Setup USART6 parameters. */    usart_set_baudrate(USART6, baud);    usart_set_databits(USART6, 8);    usart_set_stopbits(USART6, USART_STOPBITS_1);    usart_set_mode(USART6, USART_MODE_TX_RX);    usart_set_parity(USART6, USART_PARITY_NONE);    usart_set_flow_control(USART6, USART_FLOWCONTROL_NONE);    /* Allow for receive interrupts */    buf_ndx = 0;    read_ndx = 0;    nvic_enable_irq(NVIC_USART6_IRQ);    /* Finally enable the USART. */    usart_enable(USART6);    usart_enable_rx_interrupt(USART6);    /* Setup USART2 parameters. */    usart_set_baudrate(USART2, 38400);    usart_set_databits(USART2, 8);    usart_set_stopbits(USART2, USART_STOPBITS_1);    usart_set_mode(USART2, USART_MODE_TX_RX);    usart_set_parity(USART2, USART_PARITY_NONE);    usart_set_flow_control(USART2, USART_FLOWCONTROL_NONE);    /* Allow for receive interrupts */    buf_ndx = 0;    read_ndx = 0;    nvic_enable_irq(NVIC_USART2_IRQ);    /* Finally enable the USART. */    usart_enable(USART2);    usart_enable_rx_interrupt(USART2);}
开发者ID:ChuckM,项目名称:bb-lcd,代码行数:47,


示例20: usart_init_rs232

/** * /brief Initialize USART in RS232 mode. * * This function initializes the USART module in RS232 mode using the * usart_rs232_options_t configuration structure and CPU frequency. * * /param usart The USART module. * /param opt The RS232 configuration option. */void usart_init_rs232(USART_t *usart, const usart_rs232_options_t *opt){    usart_enable_module_clock(usart);    usart_set_mode(usart, USART_CMODE_ASYNCHRONOUS_gc);    usart_format_set(usart, opt->charlength, opt->paritytype,                     opt->stopbits);    usart_set_baudrate(usart, opt->baudrate, sysclk_get_per_hz());    usart_tx_enable(usart);    usart_rx_enable(usart);}
开发者ID:aparnapande92,项目名称:VioletRadioIB,代码行数:19,


示例21: USART_L_init

void USART_L_init(void){	usart_set_mode(&Wireless_L_USART,USART_CMODE_ASYNCHRONOUS_gc);	usart_format_set(&Wireless_L_USART,USART_CHSIZE_8BIT_gc,USART_PMODE_DISABLED_gc,false);	usart_set_rx_interrupt_level(&Wireless_L_USART,USART_INT_LVL_MED);	//usart_set_tx_interrupt_level(&Wireless_L_USART,USART_INT_LVL_MED);	usart_set_baudrate(&Wireless_L_USART,USART_BUADRATE,F_CPU);	usart_tx_enable(&Wireless_L_USART);	usart_rx_enable(&Wireless_L_USART);}
开发者ID:kn2cssl,项目名称:WirelessCode_BlackBoard_Bidirection,代码行数:10,


示例22: usart_init

/** * Initalize the Output (TX) mode only (log) */static void usart_init(void){	usart_set_baudrate(USART6, 921600);	usart_set_databits(USART6, 8);	usart_set_flow_control(USART6, USART_FLOWCONTROL_NONE);	usart_set_mode(USART6, USART_MODE_TX);	usart_set_parity(USART6, USART_PARITY_NONE);	usart_set_stopbits(USART6, USART_STOPBITS_1);	usart_enable(USART6);}
开发者ID:insane-adding-machines,项目名称:unicore-mx-examples,代码行数:14,


示例23: usart_console_setup

void usart_console_setup(void){	usart_set_baudrate(USART_CONSOLE, 115200);	usart_set_databits(USART_CONSOLE, 8);	usart_set_stopbits(USART_CONSOLE, USART_STOPBITS_1);	usart_set_mode(USART_CONSOLE, USART_MODE_TX);	usart_set_parity(USART_CONSOLE, USART_PARITY_NONE);	usart_set_flow_control(USART_CONSOLE, USART_FLOWCONTROL_NONE);	usart_enable(USART_CONSOLE);}
开发者ID:karlp,项目名称:karlnet,代码行数:11,


示例24: usart_setup

void usart_setup(int baud){    usart_set_baudrate(USART2, baud);    usart_set_databits(USART2, 8);    usart_set_stopbits(USART2, USART_CR2_STOP_1_0BIT);    usart_set_mode(USART2, USART_MODE_TX_RX);    usart_set_parity(USART2, USART_PARITY_NONE);    usart_set_flow_control(USART2, USART_FLOWCONTROL_NONE);    usart_enable(USART2);}
开发者ID:joostrijneveld,项目名称:STM32-getting-started,代码行数:11,


示例25: usart_setup

static void usart_setup(void){	/* Setup USART2 parameters. */	usart_set_baudrate(USART1, 38400);	usart_set_databits(USART1, 8);	usart_set_parity(USART1, USART_PARITY_NONE);	usart_set_stopbits(USART1, USART_CR2_STOP_1_0BIT);	usart_set_mode(USART1, USART_MODE_TX);	usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);	/* Finally enable the USART. */	usart_enable(USART1);}
开发者ID:BuFran,项目名称:libopencm3-examples,代码行数:13,


示例26: usart_peripheral_setup

void usart_peripheral_setup(void) {    gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO9);    gpio_set_af(GPIOA, GPIO_AF7, GPIO9);    usart_set_baudrate(USART1, 38400);    usart_set_databits(USART1, 8);    usart_set_stopbits(USART1, USART_STOPBITS_1);    usart_set_mode(USART1, USART_MODE_TX);    usart_set_parity(USART1, USART_PARITY_NONE);    usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);    usart_enable(USART1);}
开发者ID:adamgreig,项目名称:wombat,代码行数:13,


示例27: usart_init_rs232

/** * /brief Initialize USART in RS232 mode. * * This function initializes the USART module in RS232 mode using the * usart_rs232_options_t configuration structure and CPU frequency. * * /param usart The USART module. * /param opt The RS232 configuration option. * * /retval true if the initialization was successfull * /retval false if the initialization failed (error in baud rate calculation) */bool usart_init_rs232(USART_t *usart, const usart_rs232_options_t *opt){	bool result;	sysclk_enable_peripheral_clock(usart);	usart_set_mode(usart, USART_CMODE_ASYNCHRONOUS_gc);	usart_format_set(usart, opt->charlength, opt->paritytype,			opt->stopbits);	result = usart_set_baudrate(usart, opt->baudrate, sysclk_get_per_hz());	usart_tx_enable(usart);	usart_rx_enable(usart);		return result;}
开发者ID:nfrancke,项目名称:turtle5k_drive_system,代码行数:25,


示例28: usart_setup

static void usart_setup(void){	/* Setup USART2 parameters. */	usart_set_baudrate(USART2, 115200);	usart_set_databits(USART2, 8);	usart_set_stopbits(USART2, USART_STOPBITS_1);	usart_set_mode(USART2, USART_MODE_TX_RX);	usart_set_parity(USART2, USART_PARITY_NONE);	usart_set_flow_control(USART2, USART_FLOWCONTROL_NONE);	/* Finally enable the USART. */	usart_enable(USART2);}
开发者ID:insane-adding-machines,项目名称:unicore-mx-examples,代码行数:13,


示例29: usart_init

void usart_init(uint32_t arg_usart, uint32_t baudrate){	usart_set_baudrate(arg_usart, baudrate);	usart_set_databits(arg_usart, 8);	usart_set_flow_control(arg_usart, USART_FLOWCONTROL_NONE);	usart_set_mode(arg_usart, USART_MODE_TX | USART_MODE_RX);	usart_set_parity(arg_usart, USART_PARITY_NONE);	usart_set_stopbits(arg_usart, USART_STOPBITS_1);	usart_enable_rx_interrupt(arg_usart);	usart_enable(arg_usart);	usart = arg_usart;}
开发者ID:libusbhost,项目名称:libusbhost,代码行数:13,


示例30: usart_setup

static void usart_setup(void) {    /* Setup GPIO pin GPIO_USART1_RE_TX on GPIO port A for transmit. */    gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);    /* Setup UART parameters. */    usart_set_baudrate(USART1, 57600);    usart_set_databits(USART1, 8);    usart_set_stopbits(USART1, USART_STOPBITS_1);    usart_set_parity(USART1, USART_PARITY_NONE);    usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE);    usart_set_mode(USART1, USART_MODE_TX);    /* Finally enable the USART. */    usart_enable(USART1);}
开发者ID:GBert,项目名称:misc,代码行数:14,



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


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