Private
Public Access
2
0

Peripheralman: Update peripheralman API docs

* Update documentation for C methods
    * Update documentation for CXX methods
    * Update build instructions for building on AT Peripheral Manager Client

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck
2017-04-24 16:04:33 -07:00
parent 87fda62759
commit aeb293a163
4 changed files with 40 additions and 46 deletions

View File

@@ -170,7 +170,7 @@ elseif (DETECTED_ARCH STREQUAL "MOCK")
elseif (DETECTED_ARCH STREQUAL "PERIPHERALMAN")
set (PERIPHERALMAN ON)
else ()
message (FATAL_ERROR "Only x86, arm, peripheral manager and mock platforms currently supported")
message (FATAL_ERROR "Only x86, arm, PERIPHERALMAN and mock platforms currently supported")
endif()
if (BUILDSWIGPYTHON OR BUILDTESTS)

View File

@@ -234,39 +234,35 @@ unsigned int mraa_get_platform_pin_count(uint8_t platform_offset);
char* mraa_get_pin_name(int pin);
/**
* Get pin number, board must be initialised.
* Get GPIO index by pin name, board must be initialised.
*
* @param pin_name: GPIO Pin Name. Eg: IO0
* @return int of MRAA index for gpio
* @param pin_name: GPIO pin name. Eg: IO0
* @return int of MRAA index for GPIO or -1 if not found.
*/
int mraa_gpio_lookup(const char* pin_name);
/**
* Get pin number, board must be initialised.
* Get I2C bus index by bus name, board must be initialised.
*
* @param i2c_name: I2c Bus Name. Eg: I2C6
* @return int of MRAA index of i2c bus
* @param i2c_name: I2C bus name. Eg: I2C6
* @return int of MRAA index for I2C bus or -1 if not found.
*/
int mraa_i2c_lookup(const char* i2c_name);
/**
* Get pin number, board must be initialised.
* Get SPI bus index by bus name, board must be initialised.
*
* @param spi_name: Name of spi bus. Eg: SPI2
* @return int for MRAA index of spi bus
* @param spi_name: Name of SPI bus. Eg: SPI2
* @return int of MRAA index for SPI bus or -1 if not found.
*/
int mraa_spi_lookup(const char* spi_name);
/**
* Get pin number, board must be initialised.
* Get PWM index by PWM name, board must be initialised.
*
* @param pwm_name: Name of pwm. Eg:PWM0
* @return int of MRAA index for pwm bus
* @param pwm_name: Name of PWM. Eg:PWM0
* @return int of MRAA index for PWM or -1 if not found.
*/
int mraa_pwm_lookup(const char* pwm_name);
/**

View File

@@ -217,11 +217,11 @@ getPinName(int pin)
}
/**
* Get pin number, board must be initialised.
* Get GPIO index by pin name, board must be initialised.
*
* @param pin_name: GPIO Pin Name. Eg: IO0
* @throws std::invalid_argument if name is not valid
* @return int of MRAA index for gpio
* @param pin_name: GPIO pin name. Eg: IO0
* @throws std::invalid_argument if name is not found
* @return int of MRAA index for GPIO
*/
inline int
getGpioLookup(std::string pin_name)
@@ -238,11 +238,11 @@ getGpioLookup(std::string pin_name)
}
/**
* Get pin number, board must be initialised.
* Get I2C bus index by bus name, board must be initialised.
*
* @param i2c_name: I2c Bus Name. Eg: I2C6
* @throws std::invalid_argument if name is not valid
* @return int of MRAA index of i2c bus
* @param i2c_name: I2C bus name. Eg: I2C6
* @throws std::invalid_argument if name is not found
* @return int of MRAA index for I2C bus
*/
inline int
getI2cLookup(std::string i2c_name)
@@ -259,11 +259,11 @@ getI2cLookup(std::string i2c_name)
}
/**
* Get pin number, board must be initialised.
* Get SPI bus index by bus name, board must be initialised.
*
* @param spi_name: Name of spi bus. Eg: SPI2
* @throws std::invalid_argument if name is not valid
* @return int for MRAA index of spi bus
* @param spi_name: Name of SPI bus. Eg: SPI2
* @throws std::invalid_argument if name is not found
* @return int of MRAA index for SPI bus
*/
inline int
getSpiLookup(std::string spi_name)
@@ -280,11 +280,11 @@ getSpiLookup(std::string spi_name)
}
/**
* Get pin number, board must be initialised.
* Get PWM index by PWM name, board must be initialised.
*
* @param pwm_name: Name of pwm. Eg:PWM0
* @throws std::invalid_argument if name is not valid
* @return int of MRAA index for pwm bus
* @param pwm_name: Name of PWM. Eg:PWM0
* @throws std::invalid_argument if name is not found
* @return int of MRAA index for PWM
*/
inline int
getPwmLookup(std::string pwm_name)

View File

@@ -185,20 +185,18 @@ build machine.
cmake -DRPM=ON -DCMAKE_INSTALL_PREFIX=/usr ..
~~~~~~~~~~~~~
## Building for Peripheralmanager Android Things
## Building for the Android Things Peripheralmanager Client
Change src/CMakeLists.txt:140 to the location of libandroidthings.so on your
machine or have it in your Android NDK. Switch the toolchain file var to point
to where your Android NDK is (here android-ndk is in /opt).
Requirements:
Android Things Native Library (https://github.com/androidthings/native-libandroidthings)
Android NDK >= 14b
NDK r13b
The Android Things Native Library contains a CMake find_package module
(FindAndroidThings.cmake). Make sure the directory containing this module is
added to the CMAKE_MODULE_PATH.
Example cmake -DCMAKE_MODULE_PATH=/path/to/native-libandroidthings
NDK r14b
~~~~~~~~~~~~~{.sh}
cmake -DBUILDSWIG=OFF -DBUILDARCH=PERIPHERALMAN -DANDROID_TOOLCHAIN_NAME=x86-i686 -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk-r13b/build/cmake/android.toolchain.cmake ..
cmake -DBUILDSWIG=OFF -DBUILDARCH=PERIPHERALMAN -DANDROID_TOOLCHAIN_NAME=x86-i686 -DCMAKE_TOOLCHAIN_FILE=/path/to/android-ndk-r14b/build/cmake/android.toolchain.cmake -DCMAKE_MODULE_PATH=/path/to/native-libandroidthings ..
~~~~~~~~~~~~~
NDK r14-beta1
~~~~~~~~~~~~~{.sh}
cmake -DBUILDSWIG=OFF -DBUILDARCH=PERIPHERALMAN -DANDROID_TOOLCHAIN_NAME=x86-i686 -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk-r14-beta1/build/cmake/android.toolchain.cmake ..
~~~~~~~~~~~~~
For some reason this is broken on cmake 3.7+ Use cmake 3.6+ for the time being