DHCOM_HAL
Hardware-abstraction library (HAL) for multiple targets, including DHCOM modules
|
Class representing particular HW/SW combination, from which the I/O implementation may depend. More...
#include <System.h>
Public Types | |
enum | HARDWARE { HARDWARE_INVALID = 0, HARDWARE_DHCOM_IMX25 = 1, HARDWARE_DHCOM_AM35 = 2, HARDWARE_PC = 100 } |
Public Member Functions | |
System () | |
The class which represents the target hardware. | |
System (HARDWARE hardware) | |
Constructor of a System object with target hardware specification. | |
STATUS | setHardware (HARDWARE hardware) |
Sets the target hardware. | |
HARDWARE | getHardware () const |
Returns the target hardware. | |
uint16_t | getUartsNumber (STATUS *status=NULL) const |
Get the number of supported hardware UARTS. | |
const char * | getUartDeviceName (UART::DEVICE device, STATUS *status=NULL) const |
Get the OS-dependent device name for UART. | |
uint16_t | getGPIOPortsNumber (STATUS *status=NULL) const |
Get the number of supported GPIO ports. | |
uint8_t | getGPIOPortPin (GPIO::PORT port, STATUS *status=NULL) const |
Class representing particular HW/SW combination, from which the I/O implementation may depend.
The I/O classes which depend on the System require the System object in their constructor args.
dhcom::System::System | ( | ) |
The class which represents the target hardware.
Constructor of a System object, undefined hardware.
This class provides some flexibility to configure in-runtime on which target hardware we run. For example, both DHCOM module types run under linux-arm, so the same library binary can work for both, and nicely abstract from the particular module type, given the System object is correctly created.
The hardware my be defined later by call to System::setHardware().
dhcom::System::System | ( | System::HARDWARE | hardware | ) |
Constructor of a System object with target hardware specification.
hardware | - the assumed target hardware. |
uint8_t dhcom::System::getGPIOPortPin | ( | GPIO::PORT | port, |
STATUS * | status = NULL |
||
) | const |
port | - the port for which to get the pin number. |
status | - if NULL, status is not returned, otherwise the status will be assigned to STATUS_SUCCESS, STATUS_HARDWARE_UNDEFINED or STATUS_DEVICE_DOESNT_EXIST. |
System::HARDWARE dhcom::System::getHardware | ( | ) | const |
Returns the target hardware.
const char * dhcom::System::getUartDeviceName | ( | UART::DEVICE | device, |
STATUS * | status = NULL |
||
) | const |
Get the OS-dependent device name for UART.
device | - which device to look for. |
status | - if NULL, status is not returned, otherwise the status will be assigned to STATUS_SUCCESS, STATUS_HARDWARE_UNDEFINED or STATUS_DEVICE_DOESNT_EXIST. |
Get the number of supported hardware UARTS.
status | - if NULL, status is not returned, otherwise the status will be assigned to STATUS_SUCCESS or STATUS_HARDWARE_UNDEFINED |
STATUS dhcom::System::setHardware | ( | System::HARDWARE | hardware | ) |
Sets the target hardware.
The hardware can only be set if it was not set before - by this call or in constructor.
hardware | - the assumed target hardware. |