STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches
Drivers

Register-level drivers. More...

Collaboration diagram for Drivers:

Topics

 GPIO
 Pin configuration and digital I/O.
 RCC
 Peripheral clock gating, oscillators, PLL, SYSCLK switch and reset cause.
 Flash
 Flash wait states, prefetch and caches.
 PWR
 Regulator voltage scaling and over-drive.
 UART
 Blocking asynchronous USART/UART transfer.
 NVIC
 Interrupt enable, pending and priority control.
 SysTick
 The system tick timer.
 EXTI
 GPIO-to-line routing, edge triggers, interrupt mask and pending bits.
 IWDG
 Independent watchdog start, refresh and debug freeze.
 WWDG
 Window watchdog start, refresh, early wakeup and debug freeze.
 Fault
 Configurable fault enables and the fault record.

Macros

#define DRIVER_MUST_CHECK   __attribute__((warn_unused_result))
 Make ignoring a function's result a compile error (with -Werror).

Typedefs

typedef enum DriverStatus_e DriverStatus_e
 Outcome of a driver call: a category for control flow, not a diagnosis.

Enumerations

enum  DriverStatus_e {
  DRIVER_STATUS_UNINITIALIZED = 0 , DRIVER_STATUS_OK = 1 , DRIVER_STATUS_ERR_INVALID_PARAM = 2 , DRIVER_STATUS_ERR_NOT_INITIALIZED = 3 ,
  DRIVER_STATUS_ERR_TIMEOUT = 4 , DRIVER_STATUS_ERR_HW_FAULT = 5 , DRIVER_STATUS_ERR_BUSY = 6 , DRIVER_STATUS_ERR_UNSUPPORTED = 7
}
 Outcome of a driver call: a category for control flow, not a diagnosis. More...

Detailed Description

Register-level drivers.

Each takes its register block as a parameter and returns a DriverStatus_e where it can fail.

Macro Definition Documentation

◆ DRIVER_MUST_CHECK

#define DRIVER_MUST_CHECK   __attribute__((warn_unused_result))

Make ignoring a function's result a compile error (with -Werror).

Definition at line 22 of file driver_status.h.

Typedef Documentation

◆ DriverStatus_e

Outcome of a driver call: a category for control flow, not a diagnosis.

Success is deliberately not 0, so a status variable a code path forgot to assign never reads as success. Add a per-module detail code beside it only when a driver needs one; never add peripheral-specific values here.

Enumeration Type Documentation

◆ DriverStatus_e

Outcome of a driver call: a category for control flow, not a diagnosis.

Success is deliberately not 0, so a status variable a code path forgot to assign never reads as success. Add a per-module detail code beside it only when a driver needs one; never add peripheral-specific values here.

Enumerator
DRIVER_STATUS_UNINITIALIZED 0 

Never returned.

The variable was read before any call assigned it.

DRIVER_STATUS_OK 1 

Succeeded.

DRIVER_STATUS_ERR_INVALID_PARAM 2 

A parameter is outside its valid domain.

Nothing was written.

DRIVER_STATUS_ERR_NOT_INITIALIZED 3 

The peripheral or clock source was used before it was enabled or ready.

DRIVER_STATUS_ERR_TIMEOUT 4 

A bounded wait for a hardware flag ran out.

DRIVER_STATUS_ERR_HW_FAULT 5 

The hardware answered with a fault, such as a UART framing error or a rejected write.

DRIVER_STATUS_ERR_BUSY 6 

The hardware is in a state that makes the request unsafe, such as a running PLL.

DRIVER_STATUS_ERR_UNSUPPORTED 7 

Valid on the hardware, but not implemented by this driver.

Definition at line 31 of file driver_status.h.