Sound Byte Libs 1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
driver.hpp
Go to the documentation of this file.
1/**
2 * @file driver.hpp
3 * @brief GPIO driver interface - canonical types for MCU driver implementations
4 * @ingroup hal
5 *
6 * This header provides everything a GPIO driver needs:
7 * - GpioHandle: Pin reference with port, pin, and polarity
8 * - PinMode: Pin configuration modes
9 *
10 * Drivers implement the following static interface:
11 * static void set_mode(const sbl::GpioHandle& handle, sbl::gpio::PinMode mode);
12 * static void write(const sbl::GpioHandle& handle, bool value);
13 * static bool read(const sbl::GpioHandle& handle);
14 * static void toggle(const sbl::GpioHandle& handle);
15 *
16 * Usage in driver:
17 * #include <sbl/hal/gpio/driver.hpp>
18 * using sbl::gpio::PinMode;
19 */
20
21#ifndef SBL_HAL_GPIO_DRIVER_HPP_
22#define SBL_HAL_GPIO_DRIVER_HPP_
23
24#include "handle.hpp"
25#include "types.hpp"
26
27namespace sbl {
28
29// Convenience namespace alias for drivers
30// Maps sbl::core::hal::gpio -> sbl::gpio for cleaner code
31namespace gpio {
34} // namespace gpio
35
36} // namespace sbl
37
38#endif // SBL_HAL_GPIO_DRIVER_HPP_
PinMode
GPIO pin modes.
Definition types.hpp:24
PinLevel
Digital logic levels.
Definition types.hpp:38
Root namespace for all Sound Byte Libs functionality.
Definition aliases.hpp:24
Common types for SBL hardware abstraction.
UART handle type for hardware abstraction.