DHCOM_HAL
Hardware-abstraction library (HAL) for multiple targets, including DHCOM modules
 All Data Structures Namespaces Files Functions Typedefs Enumerations Enumerator Macros Pages
System.h
Go to the documentation of this file.
1 /*
2  * System.h
3  *
4  * Created on: Jan 14, 2013
5  * Author: Peter Kishalov (PK), DH electronics GmbH
6  */
7 
8 
9 #ifndef SYSTEM_H_
10 #define SYSTEM_H_
11 
12 
13 #include <DHCOM_HAL.h>
14 #include <hal/Types.h>
15 #include <hal/UART.h>
16 #include <hal/GPIO.h>
17 
18 
20 //#define USE_HARDWARE_DHCOM_IMX25
22 //#define USE_HARDWARE_DHCOM_AM35
24 //#define USE_HARDWARE_PC
25 
26 
27 namespace dhcom
28 {
29 
30 
31 struct HardwareProps;
32 
33 
35 {
36 public:
37  // Enumeration for all possible hardware platforms
38  enum HARDWARE
39  {
40  HARDWARE_INVALID = 0,
41  HARDWARE_DHCOM_IMX25 = 1,
42  HARDWARE_DHCOM_AM35 = 2,
43  HARDWARE_PC = 100
44  };
45 
46  System();
47  System(HARDWARE hardware);
48 
49  STATUS setHardware(HARDWARE hardware);
50  HARDWARE getHardware() const;
51 
52  uint16_t getUartsNumber(STATUS *status = NULL) const;
53  const char *getUartDeviceName(UART::DEVICE device, STATUS *status = NULL) const;
54 
55  uint16_t getGPIOPortsNumber(STATUS *status = NULL) const;
56  uint8_t getGPIOPortPin(GPIO::PORT port, STATUS *status = NULL) const;
57 
58 private:
59  static HardwareProps *hwProps_;
60 };
61 
62 
148 }
149 
150 
151 #endif /* SYSTEM_H_ */