5.1.6.1.2. Functional requirements

Requirement: label REQ_INT3_1732272300 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

Each pin needs to be configured individually to operate in input, output, alternate function, or analog mode, depending on the application requirements.

Requirement: label REQ_INT3_1732147094 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall provide functionality to enable the clock for a specific GPIO port by setting the corresponding bit in the RCC->AHB1ENR register.

Requirement: label REQ_INT3_1732226959 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

System must support enabling clocks for all available GPIO ports

Requirement: label REQ_INT3_1732314479 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

System must ensure the clock enable process is completed before proceeding with any GPIO configuration

Requirement: label REQ_INT3_1732314507 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall allow each GPIO pin to be configured in one of four modes by updating the MODER register

Requirement: label REQ_INT3_1732314540 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The pin mode configuration must validate the mode value and the pin number before applying changes.

Requirement: label REQ_INT3_1732314562 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall allow configuration of the GPIO output type using the OTYPER register.

Requirement: label REQ_INT3_1732314594 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall support Push-pull Mode (0).

Requirement: label REQ_INT3_1732314613 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall allow independent configuration of each pin on the port.

Requirement: label REQ_INT3_1732314650 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall allow the user to define the output speed for each GPIO pin by updating the OSPEEDR register.

Requirement: label REQ_INT3_1732314669 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

System shall ensure the speed settings match the timing requirements.

Requirement: label REQ_INT3_1732314705 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system must support the configuration of internal pull-up by modifying the PUPDR register,

Requirement: label REQ_INT3_1732314739 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system must support the configuration of internal pull-down resistors by modifying the PUPDR register,

Requirement: label REQ_INT3_1732314752 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The function shall allow independent resistor configuration for each pin.

Requirement: label REQ_INT3_1732314780 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

For pins configured in alternate function mode, the system shall allow the alternate function to be set by updating the AFRL (for pins 0–7)

Requirement: label REQ_INT3_1732314800 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

System shall provide a way to assign an alternate function to a pin using its function number.

Requirement: label REQ_INT3_1732314824 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall allow direct control of the GPIO pin output state by modifying the Output Data Register (ODR) to directly set pin value

Requirement: label REQ_INT3_1732314854 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall allow direct control of the GPIO pin output state by modifying the Output Data Register (ODR) to directly reset pin value

Requirement: label REQ_INT3_1732227467 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall use Bit Set/Reset Register (BSRR) to atomically set state of GPIO pins.

Requirement: label REQ_INT3_1732315259 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall use Bit Set/Reset Register (BSRR) to atomically reset state of GPIO pins.

Requirement: label REQ_INT3_1732315280 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

A method for toggling the pin state shall also be provided.

Requirement: label REQ_INT3_1732315297 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall encapsulate each configuration step (e.g., enabling the clock, setting the pin mode, configuring pull-up/pull-down) into separate reusable functions.

Requirement: label REQ_INT3_1732315323 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

Each function shall validate input parameters.

Requirement: label REQ_INT3_1732315350 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

Each function shall return an appropriate status code for error handling.

Requirement: label REQ_INT3_1732315372 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The system shall include a delay function that pauses execution for a specified number of milliseconds.

Requirement: label REQ_INT3_1732315389 ../../../../../_images/arrow-right-circle.svg
status: Draft
style: red_bar
category: Functional
priority: Low

The delay function shall be implemented using a simple loop mechanism or a timer for better accuracy.