LCOV - code coverage report
Current view: top level - src/AH/Hardware - Arduino-Hardware-Types.hpp (source / functions) Hit Total Coverage
Test: 3a807a259ebe0769dd942f7f612dca5273937539 Lines: 2 2 100.0 %
Date: 2024-03-24 17:16:54 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <AH/Hardware/Hardware-Types.hpp>
       4             : #include <AH/Types/FunctionTraits.hpp>
       5             : 
       6             : #include <AH/Arduino-Wrapper.h> // pin functions and constants
       7             : 
       8             : #if defined(ARDUINO_API_VERSION)
       9             : 
      10             : using ArduinoPin_t = pin_size_t;
      11             : using PinStatus_t = PinStatus;
      12             : using PinMode_t = PinMode;
      13             : using BitOrder_t = BitOrder;
      14             : 
      15             : #else // ARDUINO_API_VERSION
      16             : 
      17             : using ArduinoPin_t =
      18             :     AH::function_traits<decltype(::digitalWrite)>::argument_t<0>;
      19             : using PinStatus_t =
      20             :     AH::function_traits<decltype(::digitalWrite)>::argument_t<1>;
      21             : using PinMode_t = AH::function_traits<decltype(::pinMode)>::argument_t<1>;
      22             : 
      23             : #if defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD)
      24             : using BitOrder_t = BitOrder;
      25             : #else
      26             : using BitOrder_t = uint8_t;
      27             : #endif
      28             : 
      29             : namespace AH_pin_detail {
      30             : constexpr static auto tmp_HIGH = HIGH;
      31             : constexpr static auto tmp_LOW = LOW;
      32             : constexpr static auto tmp_INPUT = INPUT;
      33             : constexpr static auto tmp_OUTPUT = OUTPUT;
      34             : constexpr static auto tmp_INPUT_PULLUP = INPUT_PULLUP;
      35             : } // namespace AH_pin_detail
      36             : #ifdef HIGH
      37             : #undef HIGH
      38             : #define HIGH HIGH
      39             : #endif
      40             : #ifdef LOW
      41             : #undef LOW
      42             : #define LOW LOW
      43             : #endif
      44             : #ifdef INPUT
      45             : #undef INPUT
      46             : #define INPUT INPUT
      47             : #endif
      48             : #ifdef OUTPUT
      49             : #undef OUTPUT
      50             : #define OUTPUT OUTPUT
      51             : #endif
      52             : #ifdef INPUT_PULLUP
      53             : #undef INPUT_PULLUP
      54             : #define INPUT_PULLUP INPUT_PULLUP
      55             : #endif
      56             : constexpr PinStatus_t HIGH = AH_pin_detail::tmp_HIGH;
      57             : constexpr PinStatus_t LOW = AH_pin_detail::tmp_LOW;
      58             : constexpr PinMode_t INPUT = AH_pin_detail::tmp_INPUT;
      59             : constexpr PinMode_t OUTPUT = AH_pin_detail::tmp_OUTPUT;
      60             : constexpr PinMode_t INPUT_PULLUP = AH_pin_detail::tmp_INPUT_PULLUP;
      61             : 
      62             : #endif // ARDUINO_API_VERSION
      63             : 
      64             : BEGIN_AH_NAMESPACE
      65             : template <class T>
      66          34 : inline ArduinoPin_t arduino_pin_cast(T t) {
      67          34 :     return static_cast<ArduinoPin_t>(t);
      68             : }
      69             : END_AH_NAMESPACE

Generated by: LCOV version 1.15