Hubo Library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
hubocfg.h
Go to the documentation of this file.
1 #ifndef HUBOCFG_H
2  #define HUBOCFG_H
3 
4 
5 #ifndef MAX_MCP23017_SLAVES
6  #define MAX_MCP23017_SLAVES (7)
7 #endif
8 
9 
10 namespace HuboLib
11 {
23  class SPI_Config
24  {
25  public:
26  SPI_Config();
27 
28  char* m_pMCP3x08Device; // e.g. "/dev/spidev0.1" for choosing CS1
29  };
30  extern SPI_Config g_SPIConfig;
31 
32 
40  class I2C_Config
41  {
42  public:
43  I2C_Config();
44 
45  unsigned char m_MCP23017DeviceAddress; // e.g. 0x20
46  unsigned char m_MCP23017SlaveDeviceAddressList[MAX_MCP23017_SLAVES]; // The list of I2C addresses to check for I2C slaves e.g. 0x21, 0x22 ...
47  unsigned short m_MCP23017SlaveCycleTickDivider; // e.g. 1 for each call (default), 2 for every 2nd call 3 for every 3rd call...
48  const char* m_sI2CDevice; // Raspberry Pi uses "/dev/i2c-1", Banana Pi uses "/dev/i2c-0"
49  };
50  extern I2C_Config g_I2CConfig;
51 
52 
59  class W1_Config
60  {
61  public:
62  W1_Config();
63 
64  char* m_pW1DeviceRootPath; // e.g. "/sys/bus/w1/devices"
65  };
66  extern W1_Config g_W1Config;
67 
68 } // namespace HuboLib
69 
70 
71 namespace BCM2835
72 {
82  {
83  public:
85 
86  bool m_bUseMutexProtection; // If set to true then all access to BCM2835 functions are protected by a mutex.
87  };
89 
90 } // namespace BCM2835
91 
92 #endif // HUBOCFG_H
93 
const char * m_sI2CDevice
Definition: hubocfg.h:48
unsigned char m_MCP23017DeviceAddress
Definition: hubocfg.h:45
char * m_pW1DeviceRootPath
Definition: hubocfg.h:64
BCM2835_Config g_bcm2835Config
unsigned short m_MCP23017SlaveCycleTickDivider
Definition: hubocfg.h:47
char * m_pMCP3x08Device
Definition: hubocfg.h:28
#define MAX_MCP23017_SLAVES
Definition: hubocfg.h:6
Use to configure I2C specific parameters.
Definition: hubocfg.h:40
SPI_Config g_SPIConfig
I2C_Config g_I2CConfig
unsigned char m_MCP23017SlaveDeviceAddressList[MAX_MCP23017_SLAVES]
Definition: hubocfg.h:46
Use to configure SPI specific parameters.
Definition: hubocfg.h:23
Use to configure BCM2835 specific parameters.
Definition: hubocfg.h:81
W1_Config g_W1Config
Use to configure 1wire specific parameters.
Definition: hubocfg.h:59