gustavonihei commented on a change in pull request #2838: URL: https://github.com/apache/incubator-nuttx/pull/2838#discussion_r577561186
########## File path: arch/risc-v/src/esp32c3/esp32c3_lowputc.h ########## @@ -0,0 +1,207 @@ +/**************************************************************************** + * arch/risc-v/src/esp32c3/esp32c3_lowputc.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> +#include <nuttx/arch.h> +#include <nuttx/irq.h> + +#include <sys/types.h> +#include <stdint.h> +#include <stdbool.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> +#include <debug.h> + +#include "hardware/esp32c3_uart.h" +#include "chip.h" + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +enum uart_sclk +{ + APB_CLK = 1, /* 80 MHz */ + CLK_8, /* 8 MHz */ + XTAL_CLK +}; + +enum uart_parity +{ + UART_PARITY_DISABLE, + UART_PARITY_ODD, + UART_PARITY_EVEN +}; + +enum uart_data_length +{ + UART_DATA_5_BITS, + UART_DATA_6_BITS, + UART_DATA_7_BITS, + UART_DATA_8_BITS +}; + +enum uart_stop_length +{ + UART_STOP_BITS_1 = 0x1, /* stop bit: 1 bit */ + UART_STOP_BITS_2 = 0x3, /* stop bit: 2bits */ +}; + +/* Default FIFOs size */ + +#define UART_TX_FIFO_SIZE 128 +#define UART_RX_FIFO_SIZE 128 + +/* Struct used to store uart driver information and to + * manipulate uart driver + */ + +struct esp32c3_uart_s +{ + uint32_t base; /* Base address of UART registers */ + uint8_t periph; /* UART peripheral ID */ + int cpuint; /* CPU interrupt assigned to this UART */ + uint8_t id; /* UART ID */ + uint8_t irq; /* IRQ associated with this UART */ + uint32_t baud; /* Configured baud rate */ + uint8_t bits; + uint8_t parity; /* 0=no parity, 1=odd parity, 2=even parity */ Review comment: ```suggestion uint8_t bits; uint8_t parity; /* 0=no parity, 1=odd parity, 2=even parity */ ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org