# 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`](https://sdk.twelite.info/en/hw-api-ref/perifuraru/uart/fprintf-raiburari/tsfile) structure for output [`vfPrintf()`](https://sdk.twelite.info/en/hw-api-ref/perifuraru/uart/fprintf-raiburari/vfprintf), [`vPutChar()`](https://sdk.twelite.info/en/hw-api-ref/perifuraru/uart/fprintf-raiburari/vputchar).
{% endhint %}

## Argument

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

## Returns

None

## Sample code

refer to [`tsSerialPortSetup`](https://sdk.twelite.info/en/hw-api-ref/perifuraru/uart/serial-raiburari/tsserialportsetup).
