This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART configuration - STOP BITS

Hello,

I am trying to configure a UART to use in the nrf9160. I am using zephyr's uart.h

This is a snipet of the code I have right now.

  int err=0;
  struct uart_config uart_settings;
  uart_dev = device_get_binding(UART_NAME);
  if(uart_dev == NULL){
    printk("error:could not get %s binding\n",UART_NAME);
    return;
  }
  uart_settings.baudrate = 57600;
  uart_settings.parity = UART_CFG_PARITY_NONE;
  uart_settings.stop_bits = UART_CFG_STOP_BITS_1;
  uart_settings.data_bits = UART_CFG_DATA_BITS_8;
  uart_settings.flow_ctrl = UART_CFG_FLOW_CTRL_NONE;
  err = uart_configure(uart_dev, &uart_settings);
  if(err == 0){
    printk("configured uart\n");
  }
  else{
    printk("error could not configure uart\n");
  }

Code as it is executes successfully, but my issue is that if I set my stop bits to 2, which is what I actually wan to do, I get an error from the uart_configure() func.

Is it possible to somehow set stop bits to 2?

Parents Reply Children
Related