> For the complete documentation index, see [llms.txt](https://sdk.twelite.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sdk.twelite.info/en/hw-api-ref/perifuraru/uart/serial-raiburari/serial_vinit.md).

# 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).
