# SERIAL\_vInit()

## Explanation

Initialise the UART (serial port).

This function initializes one UART port and makes it accessible by the SERIAL library.

{% hint style="info" %}
It is necessary to statically allocate a memory area for the FIFO buffer used internally by the SERIAL library during initialization.
{% endhint %}

{% hint style="info" %}
At the same time, we initialize the [`tsFILE`](/en/hw-api-ref/perifuraru/uart/fprintf-raiburari/tsfile.md) structure for output [`vfPrintf()`](/en/hw-api-ref/perifuraru/uart/fprintf-raiburari/vfprintf.md), [`vPutChar()`](/en/hw-api-ref/perifuraru/uart/fprintf-raiburari/vputchar.md).
{% endhint %}

## Argument

| Type                                                                                        | Name    | Remark                              |
| ------------------------------------------------------------------------------------------- | ------- | ----------------------------------- |
| [tsSerialPortSetup](/en/hw-api-ref/perifuraru/uart/serial-raiburari/tsserialportsetup.md)\* | psSetup | Structure for configuring the UART. |

## Returns

None

## Sample code

refer to [`tsSerialPortSetup`](/en/hw-api-ref/perifuraru/uart/serial-raiburari/tsserialportsetup.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sdk.twelite.info/en/hw-api-ref/perifuraru/uart/serial-raiburari/serial_vinit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
