Shortened function names and removed useless constructor
This commit is contained in:
parent
a69465fca0
commit
42bc1147b8
30
inout.h
30
inout.h
@ -202,10 +202,8 @@ template<InOut::Pin enmPin>
|
|||||||
class InOutPin
|
class InOutPin
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline InOutPin() __attribute__( (always_inline) );
|
static inline void direction( InOut::Dir enmDir ) __attribute__( (always_inline) );
|
||||||
|
static inline void pullup( bool bPullup ) __attribute__( (always_inline) );
|
||||||
static inline void setDirection( InOut::Dir enmDir ) __attribute__( (always_inline) );
|
|
||||||
static inline void setPullup( bool bPullup ) __attribute__( (always_inline) );
|
|
||||||
|
|
||||||
static inline bool read() __attribute__( (always_inline) );
|
static inline bool read() __attribute__( (always_inline) );
|
||||||
static inline void write( bool bValue ) __attribute__( (always_inline) );
|
static inline void write( bool bValue ) __attribute__( (always_inline) );
|
||||||
@ -213,12 +211,7 @@ public:
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
template<InOut::Pin enmPin>
|
template<InOut::Pin enmPin>
|
||||||
inline InOutPin<enmPin>::InOutPin()
|
inline void InOutPin<enmPin>::direction( InOut::Dir enmDir )
|
||||||
{}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
template<InOut::Pin enmPin>
|
|
||||||
inline void InOutPin<enmPin>::setDirection( InOut::Dir enmDir )
|
|
||||||
{
|
{
|
||||||
constexpr volatile uint8_t *vpui8DDR = InOut::getPort( enmPin, InOut::Type::DDR );
|
constexpr volatile uint8_t *vpui8DDR = InOut::getPort( enmPin, InOut::Type::DDR );
|
||||||
constexpr uint8_t ui8Pin = InOut::getPin( enmPin );
|
constexpr uint8_t ui8Pin = InOut::getPin( enmPin );
|
||||||
@ -231,7 +224,7 @@ inline void InOutPin<enmPin>::setDirection( InOut::Dir enmDir )
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
template<InOut::Pin enmPin>
|
template<InOut::Pin enmPin>
|
||||||
inline void InOutPin<enmPin>::setPullup( bool bPullup )
|
inline void InOutPin<enmPin>::pullup( bool bPullup )
|
||||||
{
|
{
|
||||||
write( bPullup );
|
write( bPullup );
|
||||||
}
|
}
|
||||||
@ -269,10 +262,8 @@ template<InOut::Port enmPort>
|
|||||||
class InOutPort
|
class InOutPort
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline InOutPort() __attribute__( (always_inline) );
|
static inline void direction( InOut::Dir enmDir ) __attribute__( (always_inline) );
|
||||||
|
static inline void pullup( bool bPullup ) __attribute__( (always_inline) );
|
||||||
static inline void setDirection( InOut::Dir enmDir ) __attribute__( (always_inline) );
|
|
||||||
static inline void setPullup( bool bPullup ) __attribute__( (always_inline) );
|
|
||||||
|
|
||||||
static inline uint8_t read() __attribute__( (always_inline) );
|
static inline uint8_t read() __attribute__( (always_inline) );
|
||||||
static inline void write( uint8_t ui8Value ) __attribute__( (always_inline) );
|
static inline void write( uint8_t ui8Value ) __attribute__( (always_inline) );
|
||||||
@ -280,12 +271,7 @@ public:
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
template<InOut::Port enmPort>
|
template<InOut::Port enmPort>
|
||||||
inline InOutPort<enmPort>::InOutPort()
|
inline void InOutPort<enmPort>::direction( InOut::Dir enmDir )
|
||||||
{}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
template<InOut::Port enmPort>
|
|
||||||
inline void InOutPort<enmPort>::setDirection( InOut::Dir enmDir )
|
|
||||||
{
|
{
|
||||||
constexpr volatile uint8_t *vpui8DDR = InOut::getPort( static_cast<InOut::Pin>( enmPort ), InOut::Type::DDR );
|
constexpr volatile uint8_t *vpui8DDR = InOut::getPort( static_cast<InOut::Pin>( enmPort ), InOut::Type::DDR );
|
||||||
*vpui8DDR = ( enmDir == InOut::Dir::OUT ) ? 0xFF : 0x00;
|
*vpui8DDR = ( enmDir == InOut::Dir::OUT ) ? 0xFF : 0x00;
|
||||||
@ -293,7 +279,7 @@ inline void InOutPort<enmPort>::setDirection( InOut::Dir enmDir )
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
template<InOut::Port enmPort>
|
template<InOut::Port enmPort>
|
||||||
inline void InOutPort<enmPort>::setPullup( bool bPullup )
|
inline void InOutPort<enmPort>::pullup( bool bPullup )
|
||||||
{
|
{
|
||||||
write( bPullup ? 0xFF : 0x00 );
|
write( bPullup ? 0xFF : 0x00 );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user