Changed clock name to lowercase
This commit is contained in:
parent
b9eb6285df
commit
e4cf315d0b
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "Clock.h"
|
#include "clock.h"
|
||||||
#include "usart.h"
|
#include "usart.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@ -32,7 +32,7 @@ int main()
|
|||||||
cUSART << "sizeof( void* ) = " << sizeof( void* ) << "\r\n";
|
cUSART << "sizeof( void* ) = " << sizeof( void* ) << "\r\n";
|
||||||
cUSART << "sizeof( unsigned char* ) = " << sizeof( unsigned char* ) << "\r\n";
|
cUSART << "sizeof( unsigned char* ) = " << sizeof( unsigned char* ) << "\r\n";
|
||||||
cUSART << "sizeof( unsigned int* ) = " << sizeof( unsigned int* ) << "\r\n\r\n";
|
cUSART << "sizeof( unsigned int* ) = " << sizeof( unsigned int* ) << "\r\n\r\n";
|
||||||
|
|
||||||
while( true )
|
while( true )
|
||||||
{
|
{
|
||||||
cUSART << "This has been running for \"" << ui32Counter++ << "\" seconds!\r\n\r\n";
|
cUSART << "This has been running for \"" << ui32Counter++ << "\" seconds!\r\n\r\n";
|
||||||
@ -41,7 +41,7 @@ int main()
|
|||||||
|
|
||||||
int iNumber;
|
int iNumber;
|
||||||
cUSART >> iNumber;
|
cUSART >> iNumber;
|
||||||
|
|
||||||
cUSART << "\r\nYou entered: " << iNumber << "\r\n\r\n";
|
cUSART << "\r\nYou entered: " << iNumber << "\r\n\r\n";
|
||||||
|
|
||||||
cUSART << "Please enter a decimal number: ";
|
cUSART << "Please enter a decimal number: ";
|
||||||
@ -53,9 +53,9 @@ int main()
|
|||||||
|
|
||||||
unsigned char uchByte;
|
unsigned char uchByte;
|
||||||
cUSART.receiveByte( uchByte, 1000 );
|
cUSART.receiveByte( uchByte, 1000 );
|
||||||
|
|
||||||
_delay_ms( 1000 );
|
_delay_ms( 1000 );
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "Clock.h"
|
#include "clock.h"
|
||||||
#include "string/string.h"
|
#include "string/string.h"
|
||||||
#include "vector/vector.h"
|
#include "vector/vector.h"
|
||||||
|
|
||||||
@ -68,20 +68,20 @@ public:
|
|||||||
MASTERSPI = 2
|
MASTERSPI = 2
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Parity
|
enum class Parity
|
||||||
{
|
{
|
||||||
DISABLED = 0,
|
DISABLED = 0,
|
||||||
ODD = 1,
|
ODD = 1,
|
||||||
EVEN = 2
|
EVEN = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class StopBit
|
enum class StopBit
|
||||||
{
|
{
|
||||||
ONE = 1,
|
ONE = 1,
|
||||||
TWO = 2
|
TWO = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
volatile uint8_t *m_vui8pUCSRA;
|
volatile uint8_t *m_vui8pUCSRA;
|
||||||
volatile uint8_t *m_vui8pUCSRB;
|
volatile uint8_t *m_vui8pUCSRB;
|
||||||
@ -106,13 +106,13 @@ private:
|
|||||||
public:
|
public:
|
||||||
USART0();
|
USART0();
|
||||||
~USART0();
|
~USART0();
|
||||||
|
|
||||||
void init( uint32_t ui32BaudRate = 9600, uint8_t ui8DataBits = 8, Parity enmParity = Parity::DISABLED, StopBit enmStopBits = StopBit::ONE, Mode enmMode = Mode::ASYNCHRONOUS );
|
void init( uint32_t ui32BaudRate = 9600, uint8_t ui8DataBits = 8, Parity enmParity = Parity::DISABLED, StopBit enmStopBits = StopBit::ONE, Mode enmMode = Mode::ASYNCHRONOUS );
|
||||||
|
|
||||||
bool receiveByte( unsigned char &chData, uint32_t ui32DelayMS );
|
bool receiveByte( unsigned char &chData, uint32_t ui32DelayMS );
|
||||||
unsigned char receiveByte();
|
unsigned char receiveByte();
|
||||||
string receiveLine( string strLineTerminator = "\r\n", size_t sizeMaxSize = 1024 );
|
string receiveLine( string strLineTerminator = "\r\n", size_t sizeMaxSize = 1024 );
|
||||||
|
|
||||||
void receive( char &chReceived );
|
void receive( char &chReceived );
|
||||||
void receive( unsigned char &uchReceived );
|
void receive( unsigned char &uchReceived );
|
||||||
void receive( short int &shiReceived );
|
void receive( short int &shiReceived );
|
||||||
@ -126,10 +126,10 @@ public:
|
|||||||
void receive( float &fReceived );
|
void receive( float &fReceived );
|
||||||
void receive( double &dReceived );
|
void receive( double &dReceived );
|
||||||
void receive( long double &ldReceived );
|
void receive( long double &ldReceived );
|
||||||
|
|
||||||
void transmitByte( unsigned char byteData );
|
void transmitByte( unsigned char byteData );
|
||||||
void transmit( string strData );
|
void transmit( string strData );
|
||||||
|
|
||||||
void transmit( char chData );
|
void transmit( char chData );
|
||||||
void transmit( unsigned char uchData );
|
void transmit( unsigned char uchData );
|
||||||
void transmit( short int shiData );
|
void transmit( short int shiData );
|
||||||
@ -143,7 +143,7 @@ public:
|
|||||||
void transmit( float fData );
|
void transmit( float fData );
|
||||||
void transmit( double dData );
|
void transmit( double dData );
|
||||||
void transmit( long double ldData );
|
void transmit( long double ldData );
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
template<typename T>
|
template<typename T>
|
||||||
USART0& operator<<( const T &RHS )
|
USART0& operator<<( const T &RHS )
|
||||||
@ -151,7 +151,7 @@ public:
|
|||||||
transmit( RHS );
|
transmit( RHS );
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
template<typename T>
|
template<typename T>
|
||||||
USART0& operator>>( T &RHS )
|
USART0& operator>>( T &RHS )
|
||||||
@ -172,4 +172,4 @@ public:
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user