Renamed project to lowercase
This commit is contained in:
parent
6b44b1868c
commit
065f21440c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -2,6 +2,7 @@
|
||||
*.hpp eol=lf
|
||||
*.c eol=lf
|
||||
*.cpp eol=lf
|
||||
.git* eol=lf
|
||||
*.vcxproj* eol=crlf
|
||||
*.cppproj eol=crlf
|
||||
*.sln eol=crlf
|
||||
|
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
.vs
|
||||
Release
|
||||
Debug
|
||||
*.componentinfo.xml
|
||||
avrdude.bat
|
@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Atmel Studio Solution File, Format Version 11.00
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "InOut", "InOut\InOut.cppproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
|
||||
Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "inout", "inout\inout.cppproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
@ -1,17 +1,17 @@
|
||||
#include "InOut.h"
|
||||
#include "inout.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
volatile uint8_t* InOut::getPort( Pin enmPin, Type enmType )
|
||||
{
|
||||
volatile uint8_t *vpui8Port = nullptr;
|
||||
|
||||
|
||||
if( enmPin == Pin::P_NONE )
|
||||
{
|
||||
return vpui8Port;
|
||||
}
|
||||
|
||||
|
||||
uint8_t ui8Port = ( static_cast<uint16_t>( enmPin ) >> 4 ) & 0x0F;
|
||||
|
||||
|
||||
switch( ui8Port )
|
||||
{
|
||||
case 0:
|
||||
@ -99,13 +99,13 @@ void InOut::setPinDirection( Pin enmPin, Dir enmDir, bool bPullup )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
volatile uint8_t *vpui8PortDir = getPort( enmPin, Type::T_DDR );
|
||||
volatile uint8_t *vpui8PortOut = getPort( enmPin, Type::T_PORT );
|
||||
uint8_t ui8Pin = getPin( enmPin );
|
||||
|
||||
|
||||
setPinDirection( vpui8PortDir, ui8Pin, enmDir );
|
||||
|
||||
|
||||
if( enmDir == Dir::D_IN )
|
||||
{
|
||||
writePin( vpui8PortOut, ui8Pin, bPullup );
|
||||
@ -119,10 +119,10 @@ bool InOut::readPin( Pin enmPin )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
volatile uint8_t *vpui8Port = getPort( enmPin, Type::T_PIN );
|
||||
uint8_t ui8Pin = getPin( enmPin );
|
||||
|
||||
|
||||
return readPin( vpui8Port, ui8Pin );
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ void InOut::writePin( Pin enmPin, bool bValue )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
volatile uint8_t *vpui8Port = getPort( enmPin, Type::T_PORT );
|
||||
uint8_t ui8Pin = getPin( enmPin );
|
||||
|
||||
@ -147,9 +147,9 @@ uint8_t InOut::readPort( Pin enmPortPin )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
volatile uint8_t *vpui8Port = getPort( enmPortPin, Type::T_PIN );
|
||||
|
||||
|
||||
return readPort( vpui8Port );
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ void InOut::writePort( Pin enmPortPin, uint8_t ui8Value )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
volatile uint8_t *vpui8Port = getPort( enmPortPin, Type::T_PORT );
|
||||
|
||||
writePort( vpui8Port, ui8Value );
|
||||
@ -190,7 +190,7 @@ void InOutPin::setPin( InOut::Pin enmPin )
|
||||
m_vpui8Input = InOut::getPort( enmPin, InOut::Type::T_PIN );
|
||||
m_vpui8Dir = InOut::getPort( enmPin, InOut::Type::T_DDR );
|
||||
m_vpui8Output = InOut::getPort( enmPin, InOut::Type::T_PORT );
|
||||
|
||||
|
||||
m_ui8Pin = InOut::getPin( enmPin );
|
||||
}
|
||||
|
||||
@ -218,4 +218,4 @@ void InOutPort::setPort( InOut::Pin enmPortPin )
|
||||
m_vpui8Input = InOut::getPort( enmPortPin, InOut::Type::T_PIN );
|
||||
m_vpui8Dir = InOut::getPort( enmPortPin, InOut::Type::T_DDR );
|
||||
m_vpui8Output = InOut::getPort( enmPortPin, InOut::Type::T_PORT );
|
||||
}
|
||||
}
|
@ -12,9 +12,9 @@
|
||||
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
||||
<OutputFileExtension>.elf</OutputFileExtension>
|
||||
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
||||
<AssemblyName>InOut</AssemblyName>
|
||||
<Name>InOut</Name>
|
||||
<RootNamespace>InOut</RootNamespace>
|
||||
<AssemblyName>inout</AssemblyName>
|
||||
<Name>inout</Name>
|
||||
<RootNamespace>inout</RootNamespace>
|
||||
<ToolchainFlavour>Native</ToolchainFlavour>
|
||||
<KeepTimersRunning>true</KeepTimersRunning>
|
||||
<OverrideVtor>false</OverrideVtor>
|
||||
@ -170,10 +170,10 @@
|
||||
<Compile Include="Clock.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="InOut.cpp">
|
||||
<Compile Include="inout.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="InOut.h">
|
||||
<Compile Include="inout.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="main.cpp">
|
||||
@ -181,4 +181,4 @@
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||
</Project>
|
||||
</Project>
|
@ -116,17 +116,17 @@ public:
|
||||
T_DDR = 1,
|
||||
T_PORT = 2
|
||||
};
|
||||
|
||||
|
||||
static volatile uint8_t* getPort( Pin enmPin, Type enmType );
|
||||
static uint8_t getPin( Pin enmPin );
|
||||
|
||||
|
||||
static void setPinDirection( Pin enmPin, Dir enmDir, bool bPullup );
|
||||
static bool readPin( Pin enmPin );
|
||||
static void writePin( Pin enmPin, bool bValue );
|
||||
|
||||
|
||||
static uint8_t readPort( Pin enmPortPin );
|
||||
static void writePort( Pin enmPortPin, uint8_t ui8Value );
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline void setPinDirection( volatile uint8_t *vpui8Port, uint8_t ui8Pin, Dir enmDir )
|
||||
{
|
||||
@ -139,7 +139,7 @@ public:
|
||||
*vpui8Port &= ~( 1 << ui8Pin );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline bool readPin( volatile uint8_t *vpui8Port, uint8_t ui8Pin )
|
||||
{
|
||||
@ -147,10 +147,10 @@ public:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline void writePin( volatile uint8_t *vpui8Port, uint8_t ui8Pin, bool bValue )
|
||||
{
|
||||
@ -163,19 +163,19 @@ public:
|
||||
*vpui8Port &= ~( 1 << ui8Pin );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline void setPortDirection( volatile uint8_t *vpui8Port, Dir enmDir )
|
||||
{
|
||||
*vpui8Port = ( ( enmDir == InOut::Dir::D_OUT ) ? ( 0xFF ) : ( 0x00 ) );
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline uint8_t readPort( volatile uint8_t *vpui8Port )
|
||||
{
|
||||
return *vpui8Port;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline void writePort( volatile uint8_t *vpui8Port, uint8_t ui8Value )
|
||||
{
|
||||
@ -191,16 +191,16 @@ private:
|
||||
volatile uint8_t *m_vpui8Input;
|
||||
volatile uint8_t *m_vpui8Dir;
|
||||
volatile uint8_t *m_vpui8Output;
|
||||
|
||||
|
||||
uint8_t m_ui8Pin;
|
||||
|
||||
|
||||
public:
|
||||
InOutPin();
|
||||
InOutPin( InOut::Pin enmPin );
|
||||
~InOutPin();
|
||||
|
||||
|
||||
void setPin( InOut::Pin enmPin );
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
inline void setDirection( InOut::Dir enmDir, bool bPullup )
|
||||
{
|
||||
@ -208,15 +208,15 @@ public:
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
InOut::setPinDirection( m_vpui8Dir, m_ui8Pin, enmDir );
|
||||
|
||||
|
||||
if( enmDir == InOut::Dir::D_IN )
|
||||
{
|
||||
InOut::writePin( m_vpui8Output, m_ui8Pin, bPullup );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
inline bool read()
|
||||
{
|
||||
@ -224,10 +224,10 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return InOut::readPin( m_vpui8Input, m_ui8Pin );
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
inline void write( bool bValue )
|
||||
{
|
||||
@ -235,7 +235,7 @@ public:
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
InOut::writePin( m_vpui8Output, m_ui8Pin, bValue );
|
||||
}
|
||||
};
|
||||
@ -253,9 +253,9 @@ public:
|
||||
InOutPort();
|
||||
InOutPort( InOut::Pin enmPortPin );
|
||||
~InOutPort();
|
||||
|
||||
|
||||
void setPort( InOut::Pin enmPortPin );
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
inline void setDirection( InOut::Dir enmDir, bool bPullup )
|
||||
{
|
||||
@ -263,15 +263,15 @@ public:
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
InOut::setPortDirection( m_vpui8Dir, enmDir );
|
||||
|
||||
|
||||
if( enmDir == InOut::Dir::D_IN )
|
||||
{
|
||||
InOut::writePort( m_vpui8Output, ( ( bPullup ) ? ( 0xFF ) : ( 0x00 ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
inline uint8_t read()
|
||||
{
|
||||
@ -279,10 +279,10 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return InOut::readPort( m_vpui8Input );
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
inline void write( uint8_t ui8Value )
|
||||
{
|
||||
@ -290,9 +290,9 @@ public:
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
InOut::writePort( m_vpui8Output, ui8Value );
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
@ -4,13 +4,13 @@
|
||||
* Version 1.3
|
||||
*/
|
||||
|
||||
#include "Clock.h"
|
||||
#include "InOut.h"
|
||||
#include "clock.h"
|
||||
#include "inout.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
InOutPin cLED( InOut::Pin::P_D7 );
|
||||
|
||||
|
||||
cLED.setDirection( InOut::Dir::D_OUT, false );
|
||||
|
||||
cLED.write( false );
|
||||
@ -47,6 +47,6 @@ int main()
|
||||
|
||||
_delay_ms( 1000 );
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user