5.1.4.2.1. Functional Requirements

Requirement: Enabling the USART peripheral REQ_INT3_173102818189 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must enable the USART peripheral by setting the USART_CR1_UE bit in the appropriate register.

Requirement: Configuring TX and RX pins REQ_INT3_173102818190 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must configure the TX and RX pins as alternate functions on the microcontroller for data transmission and reception.

Requirement: Setting the baud rate REQ_INT3_173102818191 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must set the baud rate using the USART_BRR register based on the baud rate calculation formula.

Requirement: Enabling or disabling oversampling REQ_INT3_173102818192 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium

The system must enable oversampling in either 8x or 16x mode by configuring the USART_CR1_OVER8 bit.

Requirement: Enabling data transmission REQ_INT3_173102818193 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must enable data transmission through the TX pin by setting the USART_CR1_TE bit in the CR1 register.

Requirement: Enabling data reception REQ_INT3_173102818194 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must enable data reception through the RX pin by setting the USART_CR1_RE bit in the CR1 register.

Requirement: Configuring parity REQ_INT3_173102818195 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium

The system must configure parity for error detection using the USART_CR1_PS and USART_CR1_PE bits in the CR1 register.

Requirement: Setting data word length (8-bit or 9-bit) REQ_INT3_173102818196 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium

The system must set the data word length to either 8 or 9 bits using the USART_CR1_M bit in the CR1 register.

Requirement: Setting the mode of operation (asynchronous or synchronous) REQ_INT3_173102818197 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium

The system must configure the mode of operation (asynchronous or synchronous) using the appropriate bits in the USART_CR1 and USART_CR2 registers.

Requirement: Enabling DMA for data transfer REQ_INT3_173102818198 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium

The system must enable Direct Memory Access (DMA) for data transfer by configuring the USART_CR3_DMAT and USART_CR3_DMAR bits in the CR3 register.

Requirement: Transmitting data in half-duplex mode REQ_INT3_173102818199 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium

The system must configure USART to operate in half-duplex mode by enabling the USART_CR1_HDSEL bit, allowing the same pin for both transmission and reception.

Requirement: Checking if data is ready for reception REQ_INT3_1731028182098 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must check the RXNE (Read Data Register Not Empty) bit in the USART_SR register to verify if data is ready for reception before reading the USART_DR register.

Requirement: Checking if data register is empty for transmission REQ_INT3_173102818201 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must check the TXE (Transmit Data Register Empty) bit in the USART_SR register to ensure the data register is empty before transmitting data.

Requirement: Waiting for transmission completion REQ_INT3_173102818202 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must wait for the transmission to complete by checking the TC (Transmission Complete) bit in the USART_SR register before sending new data.

Requirement: Disabling USART before configuration REQ_INT3_173102818203 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must disable the USART by clearing the USART_CR1_UE bit before configuring the registers to ensure correct configuration.

Requirement: Re-enabling USART after configuration REQ_INT3_173102818204 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must re-enable the USART peripheral by setting the USART_CR1_UE bit after configuration is complete to start communication.

Requirement: Ensuring proper TX and RX pin mapping REQ_INT3_173102818205 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: High

The system must ensure proper pin mapping for TX and RX pins according to the microcontroller’s specifications, ensuring correct communication.

Requirement: Selecting oversampling mode (8x or 16x) REQ_INT3_173102818206 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium

The system must allow for the selection of the oversampling mode, either 8x or 16x, by configuring the USART_CR1_OVER8 bit.

Requirement: Configuring data word length (8 or 9 bits) REQ_INT3_173102818207 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium

The system must allow the selection of data word length to either 8 or 9 bits by configuring the USART_CR1_M bit.

Requirement: Handling framing errors REQ_INT3_173102818208 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium

The system must handle framing errors by checking the USART_SR_FE bit and generating an error condition if a framing error occurs.

Requirement: Usability REQ_INT3_17310281820880 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium
date-released: 2024-12-02

The system must provide a user-friendly interface for configuration and management of USART communication parameters, including baud rate and pin mappings.

Requirement: Maintainability REQ_INT3_17310281820881 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Medium
date-released: 2024-12-02

The system must support easy maintenance, with well-documented configuration parameters and clear error logs for debugging USART communication.