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

nRF51822 using app_uart.c with PCA10001

hi, I am having problem trying to get the app_uart.c to replace the simple_uart on the blinky example with PCA10001. My uart param as follows:




void uart_event_handler(app_uart_evt_t* p_event)
{
}

  app_uart_comm_params_t para_uart =
  {
      .rx_pin_no    = RX_PIN_NUMBER,
      .tx_pin_no    = TX_PIN_NUMBER,
      .rts_pin_no   = RTS_PIN_NUMBER,
      .cts_pin_no   = CTS_PIN_NUMBER,
      .flow_control = APP_UART_FLOW_CONTROL_ENABLED, // required by segger USB-UART bridge
      .use_parity   = false,
      .baud_rate    = UART_BAUDRATE_BAUDRATE_Baud38400 
  };


int main(void)
{
  uint8_t output_state = 0;

  uint32_t error = 0;
  APP_UART_INIT( ¶_uart, 64, 64, uart_event_handler, APP_IRQ_PRIORITY_LOW, error);

  while(true)
  {
    app_uart_put('a');
    nrf_gpio_port_write(LED_PORT, 1 << (output_state + LED_OFFSET));
    output_state = (output_state + 1) & BLINKY_STATE_MASK;
    nrf_delay_ms(100);
  }
}

not really sure what went wrong. I am using Keil

Related