1-Wire® library for mbed. Complete 1-Wire library that supports our silicon masters along with a bit-bang master on the MAX32600MBED platform with one common interface for mbed. Slave support has also been included and more slaves will be added as time permits.
Dependents: MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more
Superseded by MaximInterface.
Diff: array.hpp
- Revision:
- 49:36954b62f503
- Parent:
- 43:23017dcd2ec3
diff -r 6f9208ae280e -r 36954b62f503 array.hpp --- a/array.hpp Thu Apr 07 11:26:20 2016 -0500 +++ b/array.hpp Fri Apr 08 16:11:16 2016 -0500 @@ -4,11 +4,15 @@ #include <cstdint> #include <cstring> +/// Generic array class similar to std::array. template <typename T, std::size_t N> class array { public: + /// Number of elements contained in the array. static const std::size_t length = N; + + /// Built-in array representation. typedef T Buffer[N]; private: @@ -34,14 +38,16 @@ return !operator==(rhs); } + /// Conversion to array reference. operator Buffer &() { - return m_buffer; // Conversion to array reference + return m_buffer; } - operator const Buffer&() const + /// Conversion to const array reference. + operator const Buffer &() const { - return m_buffer; // Conversion to const array reference + return m_buffer; } array<T, N>() { } @@ -57,4 +63,4 @@ } }; -#endif \ No newline at end of file +#endif