BlackLib Namespace Reference

Classes

class  BlackADC
 Interacts with end user, to use ADC. More...
 
class  BlackCore
 Base class of the other classes. More...
 
class  BlackCoreADC
 Preparation phase of Beaglebone Black, to use ADC. More...
 
class  BlackCoreGPIO
 Preparation phase of Beaglebone Black, to use GPIO. More...
 
class  BlackCorePWM
 Preparation phase of Beaglebone Black, to use PWM. More...
 
class  BlackDirectory
 Interacts with end user, to use directory system of Linux based OS. More...
 
class  BlackGPIO
 Interacts with end user, to use GPIO. More...
 
class  BlackI2C
 Interacts with end user, to use I2C. More...
 
class  BlackMutex
 Prevents accessing the same memory location at the same time from different threads. More...
 
class  BlackPWM
 Interacts with end user, to use PWM. More...
 
class  BlackSPI
 Interacts with end user, to use SPI. More...
 
struct  BlackSpiProperties
 Holds properties of SPI. More...
 
class  BlackThread
 Interface class for user specific thread class. More...
 
class  BlackTime
 Interacts with end user, to do basic time operations. More...
 
struct  BlackTimeElapsed
 Holds elapsed time properties. More...
 
class  BlackUART
 Interacts with end user, to use UART. More...
 
struct  BlackUartProperties
 Holds properties of UART. More...
 
struct  errorADC
 Holds BlackADC errors. More...
 
struct  errorCore
 Holds BlackCore errors. More...
 
struct  errorCoreADC
 Holds BlackCoreADC errors. More...
 
struct  errorCoreGPIO
 Holds BlackCoreGPIO errors. More...
 
struct  errorCorePWM
 Holds BlackCorePWM errors. More...
 
struct  errorGPIO
 Holds BlackGPIO errors. More...
 
struct  errorI2C
 Holds BlackI2C errors. More...
 
struct  errorPWM
 Holds BlackPWM errors. More...
 
struct  errorSPI
 Holds BlackSPI errors. More...
 
struct  errorUART
 Holds BlackUART errors. More...
 

Enumerations

enum  adcName {
  AIN0 = 0,
  AIN1 = 1,
  AIN2 = 2,
  AIN3 = 3,
  AIN4 = 4,
  AIN5 = 5,
  AIN6 = 6
}
 
enum  digitAfterPoint {
  dap1 = 1,
  dap2 = 2,
  dap3 = 3
}
 
enum  direction {
  input = 1,
  output = 2,
  bothDirection = (input|output)
}
 
enum  runValue {
  stop = 0,
  run = 1
}
 
enum  timeType {
  picosecond = -12,
  nanosecond = -9,
  microsecond = -6,
  milisecond = -3,
  second = 1
}
 
enum  openMode {
  ReadOnly = 0,
  WriteOnly = 1,
  ReadWrite = 2,
  Append = 4,
  Truncate = 8,
  NonBlock = 16
}
 
enum  digitalValue {
  low = 0,
  high = 1
}
 
enum  gpioName {
  GPIO_125 =125,
  GPIO_123 =123,
  GPIO_122 =122,
  GPIO_121 =121,
  GPIO_120 =120,
  GPIO_117 =117,
  GPIO_49 =49,
  GPIO_15 =15,
  GPIO_48 =48,
  GPIO_51 =51,
  GPIO_20 =20,
  GPIO_38 =38,
  GPIO_30 =30,
  GPIO_60 =60,
  GPIO_31 =31,
  GPIO_40 =40,
  GPIO_39 =39,
  GPIO_34 =34,
  GPIO_35 =35,
  GPIO_66 =66,
  GPIO_67 =67,
  GPIO_69 =69,
  GPIO_68 =68,
  GPIO_45 =45,
  GPIO_44 =44,
  GPIO_23 =23,
  GPIO_26 =26,
  GPIO_47 =47,
  GPIO_46 =46,
  GPIO_27 =27,
  GPIO_65 =65,
  GPIO_22 =22,
  GPIO_63 =63,
  GPIO_62 =62,
  GPIO_37 =37,
  GPIO_36 =36,
  GPIO_33 =33,
  GPIO_32 =32,
  GPIO_61 =61,
  GPIO_86 =86,
  GPIO_88 =88,
  GPIO_87 =87,
  GPIO_89 =89,
  GPIO_10 =10,
  GPIO_11 =11,
  GPIO_81 =81,
  GPIO_80 =80,
  GPIO_78 =78,
  GPIO_79 =79,
  GPIO_76 =76,
  GPIO_77 =77,
  GPIO_74 =74,
  GPIO_75 =75,
  GPIO_72 =72,
  GPIO_73 =73,
  GPIO_70 =70,
  GPIO_71 =71,
  GPIO_14 =14,
  GPIO_9 =9,
  GPIO_8 =8,
  GPIO_7 =7,
  GPIO_5 =5,
  GPIO_4 =4,
  GPIO_3 =3,
  GPIO_2 =2
}
 
enum  workingMode {
  SecureMode = 0,
  FastMode = 1
}
 
enum  i2cName {
  I2C_0 = 0,
  I2C_1 = 1
}
 
enum  transactionType {
  SMBUS_QUICK = 0,
  SMBUS_BYTE = 1,
  SMBUS_BYTE_DATA = 2,
  SMBUS_WORD_DATA = 3,
  SMBUS_PROC_CALL = 4,
  SMBUS_BLOCK_DATA = 5,
  SMBUS_I2C_BLOCK_BROKEN = 6,
  SMBUS_BLOCK_PROC_CALL = 7,
  SMBUS_I2C_BLOCK_DATA = 8
}
 
enum  pwmName {
  P8_13 = 0,
  P8_19 = 1,
  P9_14 = 2,
  P9_16 = 3,
  P9_21 = 4,
  P9_22 = 5,
  P9_42 = 6,
  EHRPWM2B = P8_13,
  EHRPWM2A = P8_19,
  EHRPWM1A = P9_14,
  EHRPWM1B = P9_16,
  EHRPWM0B = P9_21,
  EHRPWM0A = P9_22,
  ECAP0 = P9_42
}
 
enum  polarityType {
  straight = 0,
  reverse = 1
}
 
enum  spiName {
  SPI0_0 = 0,
  SPI0_1 = 1,
  SPI1_0 = 2,
  SPI1_1 = 3
}
 
enum  spiMode {
  SpiDefault = 0x00,
  SpiPhase = 0x01,
  SpiPolarity = 0x02,
  SpiChipSelectHigh = 0x04,
  SpiLsbFirst = 0x08,
  Spi3Wire = 0x10,
  SpiLoop = 0x20,
  SpiNoChipSelect = 0x40,
  SpiReady = 0x80,
  SpiMode0 = (0|0),
  SpiMode1 = (0|SpiPhase),
  SpiMode2 = (SpiPolarity|0),
  SpiMode3 = (SpiPolarity|SpiPhase)
}
 
enum  uartName {
  UART1 = 1,
  UART2 = 2,
  UART4 = 4,
  UART5 = 5
}
 
enum  baudRate {
  Baud0 = 0,
  Baud50 = 1,
  Baud75 = 2,
  Baud110 = 3,
  Baud134 = 4,
  Baud150 = 5,
  Baud200 = 6,
  Baud300 = 7,
  Baud600 = 8,
  Baud1200 = 9,
  Baud1800 = 10,
  Baud2400 = 11,
  Baud4800 = 12,
  Baud9600 = 13,
  Baud19200 = 14,
  Baud38400 = 15
}
 
enum  parity {
  ParityNo = 0,
  ParityOdd = 1,
  ParityEven = 2,
  ParityDefault = -1
}
 
enum  characterSize {
  Char5 = 5,
  Char6 = 6,
  Char7 = 7,
  Char8 = 8,
  CharDefault = 0
}
 
enum  stopBits {
  StopOne = 1,
  StopTwo = 2,
  StopDefault = -1
}
 
enum  uartApplyMode {
  ApplyNow = 0,
  ApplyDrain = 1,
  ApplyFlush = 2
}
 

Functions

template<typename T >
std::string tostr (const T &t)
 Uses for converting the different types variable to string type. More...
 

Variables

const std::string DEFAULT_CAPE_MGR_NUMBER = "8"
 If capemgr finding fails, it uses this number. More...
 
const std::string DEFAULT_OCP_NUMBER = "2"
 If ocp finding fails, it uses this number. More...
 
const std::string DEFAULT_HELPER_NUMBER = "14"
 If helper finding fails, it uses this number. More...
 
const std::string DEFAULT_PWM_TEST_NUMBER = "15"
 If pwm_test finding fails, it uses this number. More...
 
const std::string DEFAULT_SPI0_PINMUX = "48030000"
 SPI0 pinmux number. More...
 
const std::string DEFAULT_SPI1_PINMUX = "481a0000"
 SPI1 pinmux number. More...
 
const unsigned int DEFAULT_OPEN_MODE = (ReadWrite)
 Default open mode. More...
 
const std::string PWM_TEST_NAME_NOT_FOUND = "PwmTestNameError"
 If pwm test name could not find, function returns this string. More...
 
const std::string GPIO_PIN_NOT_READY_STRING = "Gpio Pin Isn\'t Ready"
 If gpio pin is not ready, function returns this string. More...
 
const int GPIO_PIN_NOT_READY_INT = -2
 If gpio pin is not ready, function returns this integer. More...
 
const std::string UART_READ_FAILED = "UartReadError"
 If uart read is failed, function returns this string. More...
 
const std::string UART_WRITE_FAILED = "UartWriteError"
 If uart write is failed, function returns this string. More...
 
const std::string SEARCH_DIR_NOT_FOUND = "Not Found"
 If directory searching fails, function returns this string. More...
 
const std::string FILE_COULD_NOT_OPEN_STRING = "File Couldn\'t Open"
 If file could not open, function returns this string. More...
 
const int FILE_COULD_NOT_OPEN_INT = -1
 If file could not open, function returns this integer. More...
 
const float FILE_COULD_NOT_OPEN_FLOAT = -1.0
 If file could not open, function returns this float value. More...
 
const std::string CURRENT_DIRECTORY_NOT_FOUND = "Current Directory Couldn\'t Find"
 If current directory could not find, function returns this. More...
 
const std::string pwmNameMap [7]
 

Enumeration Type Documentation

This enum is used for selecting ADC input.

Enumerator
AIN0 
AIN1 
AIN2 
AIN3 
AIN4 
AIN5 
AIN6 

This enum is used for setting baud rate.

Enumerator
Baud0 
Baud50 
Baud75 
Baud110 
Baud134 
Baud150 
Baud200 
Baud300 
Baud600 
Baud1200 
Baud1800 
Baud2400 
Baud4800 
Baud9600 
Baud19200 
Baud38400 

This enum is used for setting character size.

Enumerator
Char5 
Char6 
Char7 
Char8 
CharDefault 

This enum is used for selecting convert level of ADC value.

Enumerator
dap1 
dap2 
dap3 

This enum is used for setting digital output value.

Enumerator
low 
high 

This enum is used for selecting direction.

Enumerator
input 
output 
bothDirection 

This enum is used for selecting GPIO number.

Enumerator
GPIO_125 
GPIO_123 
GPIO_122 
GPIO_121 
GPIO_120 
GPIO_117 
GPIO_49 
GPIO_15 
GPIO_48 
GPIO_51 
GPIO_20 
GPIO_38 
GPIO_30 
GPIO_60 
GPIO_31 
GPIO_40 
GPIO_39 
GPIO_34 
GPIO_35 
GPIO_66 
GPIO_67 
GPIO_69 
GPIO_68 
GPIO_45 
GPIO_44 
GPIO_23 
GPIO_26 
GPIO_47 
GPIO_46 
GPIO_27 
GPIO_65 
GPIO_22 
GPIO_63 
GPIO_62 
GPIO_37 
GPIO_36 
GPIO_33 
GPIO_32 
GPIO_61 
GPIO_86 
GPIO_88 
GPIO_87 
GPIO_89 
GPIO_10 
GPIO_11 
GPIO_81 
GPIO_80 
GPIO_78 
GPIO_79 
GPIO_76 
GPIO_77 
GPIO_74 
GPIO_75 
GPIO_72 
GPIO_73 
GPIO_70 
GPIO_71 
GPIO_14 
GPIO_9 
GPIO_8 
GPIO_7 
GPIO_5 
GPIO_4 
GPIO_3 
GPIO_2 

This enum is used for setting i2c name.

Enumerator
I2C_0 
I2C_1 

This enum is used for selecting file open mode.

Enumerator
ReadOnly 
WriteOnly 
ReadWrite 
Append 
Truncate 
NonBlock 

This enum is used for setting parity.

Enumerator
ParityNo 
ParityOdd 
ParityEven 
ParityDefault 

This enum is used for setting PWM polarity.

Enumerator
straight 
reverse 

This enum is used for selecting PWM name.

Enumerator
P8_13 
P8_19 
P9_14 
P9_16 
P9_21 
P9_22 
P9_42 
EHRPWM2B 
EHRPWM2A 
EHRPWM1A 
EHRPWM1B 
EHRPWM0B 
EHRPWM0A 
ECAP0 

This enum is used for setting run state (like PWM).

Enumerator
stop 
run 

This enum is used for setting spi mode.

Enumerator
SpiDefault 
SpiPhase 
SpiPolarity 
SpiChipSelectHigh 
SpiLsbFirst 
Spi3Wire 
SpiLoop 
SpiNoChipSelect 
SpiReady 
SpiMode0 
SpiMode1 
SpiMode2 
SpiMode3 

This enum is used for setting spi name.

Enumerator
SPI0_0 
SPI0_1 
SPI1_0 
SPI1_1 

This enum is used for setting stop bit(s) size.

Enumerator
StopOne 
StopTwo 
StopDefault 

This enum is used for selecting time type (like BlackPWM::setPeriodTime() function).

Enumerator
picosecond 
nanosecond 
microsecond 
milisecond 
second 

This enum is used for selecting i2c bus transaction type.

Enumerator
SMBUS_QUICK 
SMBUS_BYTE 
SMBUS_BYTE_DATA 
SMBUS_WORD_DATA 
SMBUS_PROC_CALL 
SMBUS_BLOCK_DATA 
SMBUS_I2C_BLOCK_BROKEN 
SMBUS_BLOCK_PROC_CALL 
SMBUS_I2C_BLOCK_DATA 

This enum is used for selecting apply mode of uart property's changes.

Enumerator
ApplyNow 
ApplyDrain 
ApplyFlush 

This enum is used for selecting UART name.

Enumerator
UART1 
UART2 
UART4 
UART5 

This enum is used for selecting working mode.

Enumerator
SecureMode 
FastMode 

Function Documentation

template<typename T >
std::string BlackLib::tostr ( const T &  t)
inline

Uses for converting the different types variable to string type.

Template Parameters
Tvariable which will convert.
Returns
String type value of T type variable.

Variable Documentation

const std::string BlackLib::CURRENT_DIRECTORY_NOT_FOUND = "Current Directory Couldn\'t Find"

If current directory could not find, function returns this.

const std::string BlackLib::DEFAULT_CAPE_MGR_NUMBER = "8"

If capemgr finding fails, it uses this number.

const std::string BlackLib::DEFAULT_HELPER_NUMBER = "14"

If helper finding fails, it uses this number.

const std::string BlackLib::DEFAULT_OCP_NUMBER = "2"

If ocp finding fails, it uses this number.

const unsigned int BlackLib::DEFAULT_OPEN_MODE = (ReadWrite)

Default open mode.

const std::string BlackLib::DEFAULT_PWM_TEST_NUMBER = "15"

If pwm_test finding fails, it uses this number.

const std::string BlackLib::DEFAULT_SPI0_PINMUX = "48030000"

SPI0 pinmux number.

const std::string BlackLib::DEFAULT_SPI1_PINMUX = "481a0000"

SPI1 pinmux number.

const float BlackLib::FILE_COULD_NOT_OPEN_FLOAT = -1.0

If file could not open, function returns this float value.

const int BlackLib::FILE_COULD_NOT_OPEN_INT = -1

If file could not open, function returns this integer.

const std::string BlackLib::FILE_COULD_NOT_OPEN_STRING = "File Couldn\'t Open"

If file could not open, function returns this string.

const int BlackLib::GPIO_PIN_NOT_READY_INT = -2

If gpio pin is not ready, function returns this integer.

const std::string BlackLib::GPIO_PIN_NOT_READY_STRING = "Gpio Pin Isn\'t Ready"

If gpio pin is not ready, function returns this string.

const std::string BlackLib::PWM_TEST_NAME_NOT_FOUND = "PwmTestNameError"

If pwm test name could not find, function returns this string.

const std::string BlackLib::pwmNameMap[7]
Initial value:
= { "P8_13",
"P8_19",
"P9_14",
"P9_16",
"P9_21",
"P9_22",
"P9_42",
}

This string array is used for mapping pwm name.

const std::string BlackLib::SEARCH_DIR_NOT_FOUND = "Not Found"

If directory searching fails, function returns this string.

const std::string BlackLib::UART_READ_FAILED = "UartReadError"

If uart read is failed, function returns this string.

const std::string BlackLib::UART_WRITE_FAILED = "UartWriteError"

If uart write is failed, function returns this string.