Shortened function names and removed useless constructor

This commit is contained in:
BlackMark 2018-04-26 15:58:15 +02:00
parent a69465fca0
commit 42bc1147b8

30
inout.h
View File

@ -202,10 +202,8 @@ template<InOut::Pin enmPin>
class InOutPin
{
public:
inline InOutPin() __attribute__( (always_inline) );
static inline void setDirection( InOut::Dir enmDir ) __attribute__( (always_inline) );
static inline void setPullup( bool bPullup ) __attribute__( (always_inline) );
static inline void direction( InOut::Dir enmDir ) __attribute__( (always_inline) );
static inline void pullup( bool bPullup ) __attribute__( (always_inline) );
static inline bool read() __attribute__( (always_inline) );
static inline void write( bool bValue ) __attribute__( (always_inline) );
@ -213,12 +211,7 @@ public:
//////////////////////////////////////////////////////////////////////////
template<InOut::Pin enmPin>
inline InOutPin<enmPin>::InOutPin()
{}
//////////////////////////////////////////////////////////////////////////
template<InOut::Pin enmPin>
inline void InOutPin<enmPin>::setDirection( InOut::Dir enmDir )
inline void InOutPin<enmPin>::direction( InOut::Dir enmDir )
{
constexpr volatile uint8_t *vpui8DDR = InOut::getPort( enmPin, InOut::Type::DDR );
constexpr uint8_t ui8Pin = InOut::getPin( enmPin );
@ -231,7 +224,7 @@ inline void InOutPin<enmPin>::setDirection( InOut::Dir enmDir )
//////////////////////////////////////////////////////////////////////////
template<InOut::Pin enmPin>
inline void InOutPin<enmPin>::setPullup( bool bPullup )
inline void InOutPin<enmPin>::pullup( bool bPullup )
{
write( bPullup );
}
@ -269,10 +262,8 @@ template<InOut::Port enmPort>
class InOutPort
{
public:
inline InOutPort() __attribute__( (always_inline) );
static inline void setDirection( InOut::Dir enmDir ) __attribute__( (always_inline) );
static inline void setPullup( bool bPullup ) __attribute__( (always_inline) );
static inline void direction( InOut::Dir enmDir ) __attribute__( (always_inline) );
static inline void pullup( bool bPullup ) __attribute__( (always_inline) );
static inline uint8_t read() __attribute__( (always_inline) );
static inline void write( uint8_t ui8Value ) __attribute__( (always_inline) );
@ -280,12 +271,7 @@ public:
//////////////////////////////////////////////////////////////////////////
template<InOut::Port enmPort>
inline InOutPort<enmPort>::InOutPort()
{}
//////////////////////////////////////////////////////////////////////////
template<InOut::Port enmPort>
inline void InOutPort<enmPort>::setDirection( InOut::Dir enmDir )
inline void InOutPort<enmPort>::direction( InOut::Dir enmDir )
{
constexpr volatile uint8_t *vpui8DDR = InOut::getPort( static_cast<InOut::Pin>( enmPort ), InOut::Type::DDR );
*vpui8DDR = ( enmDir == InOut::Dir::OUT ) ? 0xFF : 0x00;
@ -293,7 +279,7 @@ inline void InOutPort<enmPort>::setDirection( InOut::Dir enmDir )
//////////////////////////////////////////////////////////////////////////
template<InOut::Port enmPort>
inline void InOutPort<enmPort>::setPullup( bool bPullup )
inline void InOutPort<enmPort>::pullup( bool bPullup )
{
write( bPullup ? 0xFF : 0x00 );
}