Sound Byte Libs
1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
src
sbl
hal
gpio
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
27
namespace
sbl
{
28
29
// Convenience namespace alias for drivers
30
// Maps sbl::core::hal::gpio -> sbl::gpio for cleaner code
31
namespace
gpio {
32
using
PinMode
=
sbl::core::hal::gpio::PinMode
;
33
using
PinLevel
=
sbl::core::hal::gpio::PinLevel
;
34
}
// namespace gpio
35
36
}
// namespace sbl
37
38
#endif
// SBL_HAL_GPIO_DRIVER_HPP_
sbl::core::hal::gpio::PinMode
PinMode
GPIO pin modes.
Definition
types.hpp:24
sbl::core::hal::gpio::PinLevel
PinLevel
Digital logic levels.
Definition
types.hpp:38
sbl
Root namespace for all Sound Byte Libs functionality.
Definition
aliases.hpp:24
types.hpp
Common types for SBL hardware abstraction.
handle.hpp
UART handle type for hardware abstraction.
Generated by
1.9.8