uart0.hpp
Go to the documentation of this file.
1 /*
2  * SocialLedge.com - Copyright (C) 2013
3  *
4  * This file is part of free software framework for embedded processors.
5  * You can use it and/or distribute it as long as this copyright header
6  * remains unmodified. The code is free for personal use and requires
7  * permission to use in a commercial product.
8  *
9  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
10  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
12  * I SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
13  * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
14  *
15  * You can reach the author of this software at :
16  * p r e e t . w i k i @ g m a i l . c o m
17  */
18 
24 #ifndef UART0_HPP_
25 #define UART0_HPP_
26 
27 #include "uart_dev.hpp" // Base class
28 #include "singleton_template.hpp" // Singleton Template
29 
30 
31 
39 class Uart0 : public UartDev, public SingletonTemplate<Uart0>
40 {
41  public:
47  bool init(unsigned int baudRate, int rxQSize=32, int txQSize=64);
48 
52  static char getcharIntrDriven(char unused)
53  {
54  char c = 0;
56  return c;
57  }
58  static char putcharIntrDriven(char thechar)
59  {
60  return Uart0::getInstance().putChar(thechar);
61  }
64  private:
65  Uart0();
66  friend class SingletonTemplate<Uart0>;
67 };
68 
69 
70 #endif /* UART0_HPP_ */
bool putChar(char out, unsigned int timeout=portMAX_DELAY)
Definition: uart_dev.cpp:50
static char getcharIntrDriven(char unused)
Definition: uart0.hpp:52
bool getChar(char *pInputChar, unsigned int timeout=portMAX_DELAY)
Definition: uart_dev.cpp:31
Provides UART Base class functionality for UART peripherals.
static Uart0 & getInstance()
Public member to get instance of this SINGLETON class.
Each real time kernel port consists of three files that contain the core kernel components and are common to every and one or more files that are specific to a particular microcontroller and or compiler The FreeRTOS Source directory contains the three files that are common to every port list c
Definition: readme.txt:2
Definition: uart0.hpp:39
Definition: uart_dev.hpp:61
static char putcharIntrDriven(char thechar)
Definition: uart0.hpp:58
bool init(unsigned int baudRate, int rxQSize=32, int txQSize=64)
Definition: uart0.cpp:39
Definition: singleton_template.hpp:55