The Pigweed namespace. More...
The Pigweed namespace.
have no equivalent here.
For template parameter and variable naming, C indicates the container type to which the function is applied, Pred indicates the predicate object type to be used by the function and T indicates the applicable element type.
Namespaces | |
| namespace | analog |
| Analog-to-digital converter (ADC) library. | |
| namespace | async |
| (Deprecated) Async library | |
| namespace | base64 |
| Base64 encoding, decoding, and validating library. | |
| namespace | bloat |
| Binary size reports library. | |
| namespace | bluetooth_sapphire |
| Dual-mode Bluetooth host stack. | |
| namespace | chrono |
| Portable std::chrono library for embedded. | |
| namespace | clock_tree |
| Clock tree management library. | |
| namespace | crypto |
| Cryptography library. | |
| namespace | digital_io |
| GPIO library. | |
| namespace | display |
| Graphic display and framebuffer library. | |
| namespace | dump |
| Hexdump utilities. | |
| namespace | elf |
| Basic ELF reader library. | |
| namespace | i2c |
| Cross-platform I2C library. | |
| namespace | interrupt |
| Interrupt context interface. | |
| namespace | kvs |
| Lightweight key-value store library. | |
| namespace | malloc |
| Replacement interface for standard libc dynamic memory operations. | |
| namespace | perf_test |
| Micro-benchmarks library. | |
| namespace | persistent_ram |
| Persistent RAM utilities and containers. | |
| namespace | sync |
| namespace | sys_io |
| Unoptimized I/O library. | |
| namespace | system |
| Opinionated system framework. | |
| namespace | thread |
| Thread creation and execution library. | |
| namespace | uart |
| Core UART interfaces. | |
| namespace | utf |
| Provides basic helpers for reading and writing UTF-8-encoded strings. | |
| namespace | uuid |
| 128-bit universally unique identifier library | |
| namespace | work_queue |
| Work queue library for threads and interrupts. | |
Typedefs | |
| template<typename T > | |
| using | AlignedAtomic = std::atomic< NaturallyAligned< T > > |
| using | ByteSpan = span< std::byte > |
| using | ConstByteSpan = span< const std::byte > |
| template<typename T , size_t kCapacity = containers::internal::kGenericSized> | |
| using | InlineAsyncDeque = BasicInlineAsyncDeque< T, uint16_t, kCapacity > |
| template<typename ValueType , size_t kCapacity = containers::internal::kGenericSized> | |
| using | InlineAsyncQueue = BasicInlineAsyncQueue< ValueType, uint16_t, kCapacity > |
| template<typename ValueType , typename SizeType , size_t kCapacity = containers::internal::kGenericSized> | |
| using | BasicInlineDeque = containers::internal::BasicInlineDequeImpl< ValueType, containers::internal::CountAndCapacity< SizeType >, kCapacity > |
| template<typename T , size_t kCapacity = containers::internal::kGenericSized> | |
| using | InlineDeque = BasicInlineDeque< T, uint16_t, kCapacity > |
| template<typename T , size_t kCapacity = containers::internal::kGenericSized> | |
| using | InlineQueue = BasicInlineQueue< T, uint16_t, kCapacity > |
| template<size_t kMaxSizeBytes = containers::internal::kGenericSized> | |
| using | InlineVarLenEntryQueue = BasicInlineVarLenEntryQueue< std::byte, kMaxSizeBytes > |
Variable-length entry queue that uses std::byte for the byte type. | |
| template<typename T > | |
| using | IntrusiveList = containers::future::IntrusiveList< T > |
| template<typename FunctionType > | |
| using | Function = fit::function_impl< function_internal::config::kInlineCallableSize, !function_internal::config::kEnableDynamicAllocation, FunctionType, PW_FUNCTION_DEFAULT_ALLOCATOR_TYPE > |
| template<typename FunctionType , std::size_t inline_target_size = function_internal::config::kInlineCallableSize> | |
| using | InlineFunction = fit::inline_function< FunctionType, inline_target_size > |
| template<typename FunctionType , std::size_t inline_target_size = function_internal::config::kInlineCallableSize, typename Allocator = PW_FUNCTION_DEFAULT_ALLOCATOR_TYPE> | |
| using | DynamicFunction = fit::function_impl< inline_target_size, false, FunctionType, Allocator > |
| using | Closure = Function< void()> |
void-returning pw::Function that takes no arguments. | |
| template<typename FunctionType > | |
| using | Callback = fit::callback_impl< function_internal::config::kInlineCallableSize, !function_internal::config::kEnableDynamicAllocation, FunctionType, PW_FUNCTION_DEFAULT_ALLOCATOR_TYPE > |
| template<typename FunctionType , std::size_t inline_target_size = function_internal::config::kInlineCallableSize> | |
| using | InlineCallback = fit::inline_callback< FunctionType, inline_target_size > |
Version of pw::Callback that exclusively uses inline storage. | |
| template<typename FunctionType , std::size_t inline_target_size = function_internal::config::kInlineCallableSize, typename Allocator = PW_FUNCTION_DEFAULT_ALLOCATOR_TYPE> | |
| using | DynamicCallback = fit::callback_impl< inline_target_size, false, FunctionType, Allocator > |
Version of pw::Callback that supports dynamic allocation. | |
| using | FlatMultiBuf = BasicMultiBuf<> |
| Basic MultiBuf interface with mutable data. | |
| using | FlatConstMultiBuf = BasicMultiBuf< multibuf::Property::kConst > |
| Basic MultiBuf interface with read-only data. | |
| using | MultiBuf = BasicMultiBuf< multibuf::Property::kLayerable > |
| using | ConstMultiBuf = BasicMultiBuf< multibuf::Property::kConst, multibuf::Property::kLayerable > |
| using | TrackedFlatMultiBuf = BasicMultiBuf< multibuf::Property::kObservable > |
| using | TrackedFlatConstMultiBuf = BasicMultiBuf< multibuf::Property::kConst, multibuf::Property::kObservable > |
| using | TrackedMultiBuf = BasicMultiBuf< multibuf::Property::kLayerable, multibuf::Property::kObservable > |
| using | TrackedConstMultiBuf = BasicMultiBuf< multibuf::Property::kConst, multibuf::Property::kLayerable, multibuf::Property::kObservable > |
| template<size_t kCapacity = string_impl::kGeneric> | |
| using | InlineString = InlineBasicString< char, kCapacity > |
pw::InlineString is an alias of pw::InlineBasicString<char> and is equivalent to std::string. | |
| template<size_t kCapacity = string_impl::kGeneric> | |
| using | InlineByteString = InlineBasicString< std::byte, kCapacity > |
pw::InlineByteString is an alias of pw::InlineBasicString<std::byte>. InlineByteString may be used as a simple, efficient byte container. | |
| using | DefaultThreadContext = ThreadContext< thread::backend::kDefaultStackSizeBytes > |
| Alias for ThreadContext with the backend's default stack size. | |
| using | ThreadPriority = thread::internal::Priority< thread::backend::PriorityType, thread::backend::kLowestPriority, thread::backend::kHighestPriority, thread::backend::kDefaultPriority > |
| using | Thread = ::pw::thread::Thread |
Functions | |
| constexpr size_t | countl_zero (size_t x) noexcept |
| constexpr size_t | bit_width (size_t x) noexcept |
| constexpr size_t | bit_ceil (size_t x) noexcept |
| class pw::Deallocator | DoGetInfo (InfoType info_type, const void *ptr) override |
| template<> | |
| StatusWithSize | ToString (const async2::ReadyType &, span< char > buffer) |
| template<> | |
| StatusWithSize | ToString (const async2::PendingType &, span< char > buffer) |
| template<typename T > | |
| StatusWithSize | ToString (const async2::Poll< T > &poll, span< char > buffer) |
| template<> | |
| StatusWithSize | ToString (const async2::Poll<> &poll, span< char > buffer) |
| bool | IsAlignedAs (const void *ptr, size_t alignment) |
| Returns whether the given pointer meets the given alignment requirement. | |
| template<typename T > | |
| bool | IsAlignedAs (const void *ptr) |
| constexpr size_t | AlignDown (uintptr_t value, size_t alignment) |
| Returns the value rounded down to the nearest multiple of alignment. | |
| template<typename T > | |
| constexpr T * | AlignDown (T *value, size_t alignment) |
| Returns the value rounded down to the nearest multiple of alignment. | |
| constexpr size_t | AlignUp (uintptr_t value, size_t alignment) |
| Returns the value rounded up to the nearest multiple of alignment. | |
| template<typename T > | |
| constexpr T * | AlignUp (T *value, size_t alignment) |
| Returns the value rounded up to the nearest multiple of alignment. | |
| constexpr size_t | Padding (size_t length, size_t alignment) |
| Returns the number of padding bytes required to align the provided length. | |
| ByteSpan | GetAlignedSubspan (ByteSpan bytes, size_t alignment) |
| constexpr ByteBuilder::iterator | operator+ (int n, ByteBuilder::iterator it) |
| template<typename T > | |
| span< const std::byte, sizeof(T)> | ObjectAsBytes (const T &obj) |
| template<typename T > | |
| span< std::byte, sizeof(T)> | ObjectAsWritableBytes (T &obj) |
| PW_CONSTEVAL std::byte | operator""_b (unsigned long long value) |
| template<typename InputIt , typename OutputIt > | |
| constexpr OutputIt | copy (InputIt first, InputIt last, OutputIt d_first) |
constexpr backport of <algorithm>'s std::copy for C++17. | |
| template<typename InputIt , typename OutputIt , typename UnaryPredicate > | |
| constexpr OutputIt | copy_if (InputIt first, InputIt last, OutputIt d_first, UnaryPredicate pred) |
constexpr backport of <algorithm>'s std::copy_if for C++17. | |
| template<typename InputIt , typename Predicate > | |
| constexpr bool | all_of (InputIt first, InputIt last, Predicate pred) |
constexpr backport of <algorithm>'s std::all_of for C++17. | |
| template<typename InputIt , typename Predicate > | |
| constexpr bool | any_of (InputIt first, InputIt last, Predicate pred) |
constexpr backport of <algorithm>'s std::any_of for C++17. | |
| template<typename InputIt , typename Predicate > | |
| constexpr InputIt | find_if (InputIt first, InputIt last, Predicate pred) |
constexpr backport of <algorithm>'s std::find_if for C++17. | |
| template<typename ForwardIt , typename T > | |
| constexpr void | fill (ForwardIt begin, ForwardIt end, const T &value) |
constexpr backport of <algorithm>'s std::fill for C++17. | |
| template<typename It , typename Size , typename T > | |
| constexpr It | fill_n (It begin, Size count, const T &value) |
constexpr backport of <algorithm>'s std::fill_n for C++17. | |
| template<typename T , size_t kLhsSize, size_t kRhsSize> | |
| bool | operator== (const Vector< T, kLhsSize > &lhs, const Vector< T, kRhsSize > &rhs) |
| template<typename T , size_t kLhsSize, size_t kRhsSize> | |
| bool | operator!= (const Vector< T, kLhsSize > &lhs, const Vector< T, kRhsSize > &rhs) |
| template<typename T , size_t kLhsSize, size_t kRhsSize> | |
| bool | operator< (const Vector< T, kLhsSize > &lhs, const Vector< T, kRhsSize > &rhs) |
| template<typename T , size_t kLhsSize, size_t kRhsSize> | |
| bool | operator<= (const Vector< T, kLhsSize > &lhs, const Vector< T, kRhsSize > &rhs) |
| template<typename T , size_t kLhsSize, size_t kRhsSize> | |
| bool | operator> (const Vector< T, kLhsSize > &lhs, const Vector< T, kRhsSize > &rhs) |
| template<typename T , size_t kLhsSize, size_t kRhsSize> | |
| bool | operator>= (const Vector< T, kLhsSize > &lhs, const Vector< T, kRhsSize > &rhs) |
| template<auto method, typename T > | |
| auto | bind_member (T *instance) |
| template<typename Function > | |
| ScopeGuard (Function()) -> ScopeGuard< Function(*)()> | |
| template<typename A , typename B , typename T > | |
| constexpr bool | CheckedAdd (A a, B b, T &result) |
| template<typename T , typename A , typename B > | |
| constexpr std::optional< T > | CheckedAdd (A a, B b) |
| template<typename T , typename Inc > | |
| constexpr bool | CheckedIncrement (T &base, Inc inc) |
| template<typename A , typename B , typename T > | |
| constexpr bool | CheckedSub (A a, B b, T &result) |
| template<typename T , typename A , typename B > | |
| constexpr std::optional< T > | CheckedSub (A a, B b) |
| template<typename T , typename Dec > | |
| constexpr bool | CheckedDecrement (T &base, Dec dec) |
| template<typename A , typename B , typename T > | |
| constexpr bool | CheckedMul (A a, B b, T &result) |
| template<typename T , typename A , typename B > | |
| constexpr std::optional< T > | CheckedMul (A a, B b) |
| template<typename T > | |
| constexpr T | IntegerDivisionRoundNearest (T dividend, T divisor) |
| template<typename T > | |
| constexpr T | add_sat (T lhs, T rhs) noexcept |
| template<typename T > | |
| constexpr T | mul_sat (T lhs, T rhs) noexcept |
| template<typename T > | |
| Result (T value) -> Result< T > | |
Deduction guide to allow Result(v) rather than Result<T>(v). | |
| template<typename T > | |
| constexpr bool | operator== (const Result< T > &lhs, const Result< T > &rhs) |
Checks the equality of two Result<T> objects. | |
| template<typename T > | |
| constexpr bool | operator!= (const Result< T > &lhs, const Result< T > &rhs) |
Checks the inequality of two Result<T> objects. | |
| template<class ResultT , size_t kSourceExtentBytes> | |
| internal::SpanFromBytes< ResultT, kSourceExtentBytes > | span_cast (span< std::byte, kSourceExtentBytes > bytes) |
| template<class ResultT , size_t kSourceExtentBytes> | |
| internal::SpanFromBytes< const ResultT, kSourceExtentBytes > | span_cast (span< const std::byte, kSourceExtentBytes > bytes) |
| template<typename T , size_t X> | |
| span< const std::byte,(X==dynamic_extent ? dynamic_extent :sizeof(T) *X)> | as_bytes (span< T, X > s) noexcept |
| template<typename T , size_t X, typename = std::enable_if_t<!std::is_const<T>::value>> | |
| span< std::byte,(X==dynamic_extent ? dynamic_extent :sizeof(T) *X)> | as_writable_bytes (span< T, X > s) noexcept |
| constexpr Status | OkStatus () |
| constexpr bool | operator== (const Status &lhs, const Status &rhs) |
| constexpr bool | operator!= (const Status &lhs, const Status &rhs) |
| template<typename T , size_t kLhsCapacity, size_t kRhsCapacity> | |
| constexpr bool | operator== (const InlineBasicString< T, kLhsCapacity > &lhs, const InlineBasicString< T, kRhsCapacity > &rhs) noexcept |
| template<typename T , size_t kLhsCapacity, size_t kRhsCapacity> | |
| constexpr bool | operator!= (const InlineBasicString< T, kLhsCapacity > &lhs, const InlineBasicString< T, kRhsCapacity > &rhs) noexcept |
| template<typename T , size_t kLhsCapacity, size_t kRhsCapacity> | |
| constexpr bool | operator< (const InlineBasicString< T, kLhsCapacity > &lhs, const InlineBasicString< T, kRhsCapacity > &rhs) noexcept |
| template<typename T , size_t kLhsCapacity, size_t kRhsCapacity> | |
| constexpr bool | operator<= (const InlineBasicString< T, kLhsCapacity > &lhs, const InlineBasicString< T, kRhsCapacity > &rhs) noexcept |
| template<typename T , size_t kLhsCapacity, size_t kRhsCapacity> | |
| constexpr bool | operator> (const InlineBasicString< T, kLhsCapacity > &lhs, const InlineBasicString< T, kRhsCapacity > &rhs) noexcept |
| template<typename T , size_t kLhsCapacity, size_t kRhsCapacity> | |
| constexpr bool | operator>= (const InlineBasicString< T, kLhsCapacity > &lhs, const InlineBasicString< T, kRhsCapacity > &rhs) noexcept |
| template<typename T , size_t kLhsCapacity> | |
| constexpr bool | operator== (const InlineBasicString< T, kLhsCapacity > &lhs, const T *rhs) |
| template<typename T , size_t kRhsCapacity> | |
| constexpr bool | operator== (const T *lhs, const InlineBasicString< T, kRhsCapacity > &rhs) |
| template<typename T , size_t kLhsCapacity> | |
| constexpr bool | operator!= (const InlineBasicString< T, kLhsCapacity > &lhs, const T *rhs) |
| template<typename T , size_t kRhsCapacity> | |
| constexpr bool | operator!= (const T *lhs, const InlineBasicString< T, kRhsCapacity > &rhs) |
| template<typename T , size_t kLhsCapacity> | |
| constexpr bool | operator< (const InlineBasicString< T, kLhsCapacity > &lhs, const T *rhs) |
| template<typename T , size_t kRhsCapacity> | |
| constexpr bool | operator< (const T *lhs, const InlineBasicString< T, kRhsCapacity > &rhs) |
| template<typename T , size_t kLhsCapacity> | |
| constexpr bool | operator<= (const InlineBasicString< T, kLhsCapacity > &lhs, const T *rhs) |
| template<typename T , size_t kRhsCapacity> | |
| constexpr bool | operator<= (const T *lhs, const InlineBasicString< T, kRhsCapacity > &rhs) |
| template<typename T , size_t kLhsCapacity> | |
| constexpr bool | operator> (const InlineBasicString< T, kLhsCapacity > &lhs, const T *rhs) |
| template<typename T , size_t kRhsCapacity> | |
| constexpr bool | operator> (const T *lhs, const InlineBasicString< T, kRhsCapacity > &rhs) |
| template<typename T , size_t kLhsCapacity> | |
| constexpr bool | operator>= (const InlineBasicString< T, kLhsCapacity > &lhs, const T *rhs) |
| template<typename T , size_t kRhsCapacity> | |
| constexpr bool | operator>= (const T *lhs, const InlineBasicString< T, kRhsCapacity > &rhs) |
| template<size_t kBufferSize = 0u, typename... Args> | |
| auto | MakeString (Args &&... args) |
| template<typename T > | |
| ScopedLocker (T lock) -> ScopedLocker< T > | |
| template<typename T > | |
| ScopedLocker (T lock, std::defer_lock_t) -> ScopedLocker< T > | |
| system::AsyncCore & | System () |
| void | SystemStart (channel::ByteReaderWriter &io_channel) |
| void | BusyWaitForever () |
Variables | |
| constexpr auto | kTupleNull |
| constexpr size_t | dynamic_extent = std::numeric_limits<size_t>::max() |
| constexpr size_t | kExternallyAllocatedThreadStack |
| constexpr ConstexprTag | kConstexpr {} |
| internal::SpanFromBytes< const ResultT, kSourceExtentBytes > pw::span_cast | ( | span< const std::byte, kSourceExtentBytes > | bytes | ) |
Casts a pw::span<const std::byte> (ConstByteSpan) to a span of a different const type.
This function is only safe to use if the underlying data is actually of the specified type. You cannot safely use this function to reinterpret e.g. a raw byte array from malloc() as a span of integers.
This function is essentially the inverse of pw::as_bytes.
If kSourceExtentBytes is dynamic_extent, the returned span also has a dynamic extent. Otherwise, the returned span has a static extent of kSourceExtentBytes / sizeof(ResultT).
| ResultT | The type of the returned span. Must be one byte to avoid misuse and violation of the strict aliasing rule. This restriction might be lifted in the future. |
| kSourceExtentBytes | The extent of the source byte span. This is normally inferred and need not be explicitly provided. |