maa: add global maa.h and maa.hpp and stop using /usr/include/maa/
* pkg-config now only sees maa.h & maa.hpp
* usage of maa/*.{h,hpp} is still allowed
* examples updated to use maa.{h,hpp}
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -754,6 +754,7 @@ WARN_LOGFILE =
|
|||||||
# Note: If this tag is empty the current directory is searched.
|
# Note: If this tag is empty the current directory is searched.
|
||||||
|
|
||||||
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/api/ \
|
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/api/ \
|
||||||
|
@CMAKE_CURRENT_SOURCE_DIR@/api/maa/ \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/README.md \
|
@CMAKE_CURRENT_SOURCE_DIR@/README.md \
|
||||||
@CMAKE_CURRENT_SOURCE_DIR@/docs/
|
@CMAKE_CURRENT_SOURCE_DIR@/docs/
|
||||||
|
|
||||||
|
|||||||
@@ -231,6 +231,12 @@ void maa_result_print(maa_result_t result);
|
|||||||
*/
|
*/
|
||||||
maa_boolean_t maa_pin_mode_test(int pin, maa_pinmodes_t mode);
|
maa_boolean_t maa_pin_mode_test(int pin, maa_pinmodes_t mode);
|
||||||
|
|
||||||
|
#include "maa/pwm.h"
|
||||||
|
#include "maa/aio.h"
|
||||||
|
#include "maa/gpio.h"
|
||||||
|
#include "maa/spi.h"
|
||||||
|
#include "maa/i2c.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
32
api/maa.hpp
Normal file
32
api/maa.hpp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
|
||||||
|
* Copyright (c) 2014 Intel Corporation.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "maa.h"
|
||||||
|
#include "maa/pwm.hpp"
|
||||||
|
#include "maa/aio.hpp"
|
||||||
|
#include "maa/gpio.hpp"
|
||||||
|
#include "maa/i2c.hpp"
|
||||||
|
#include "maa/spi.hpp"
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
#include "aio.h"
|
#include "maa/aio.h"
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "gpio.h"
|
#include "maa.h"
|
||||||
|
|
||||||
#define DEFAULT_IOPIN 8
|
#define DEFAULT_IOPIN 8
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
#include "aio.hpp"
|
#include "maa.hpp"
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "gpio.hpp"
|
#include "maa.hpp"
|
||||||
#define DEFAULT_IOPIN 8
|
#define DEFAULT_IOPIN 8
|
||||||
|
|
||||||
static int iopin;
|
static int iopin;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include "i2c.hpp"
|
#include "maa.hpp"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
|
||||||
#define MAX_BUFFER_LENGTH 6
|
#define MAX_BUFFER_LENGTH 6
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include "pwm.hpp"
|
#include "maa.hpp"
|
||||||
|
|
||||||
int running = 0;
|
int running = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "spi.hpp"
|
#include "maa.hpp"
|
||||||
|
|
||||||
int running = 0;
|
int running = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "pwm.h"
|
#include "maa.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "unistd.h"
|
#include "unistd.h"
|
||||||
|
|
||||||
#include "gpio.h"
|
#include "maa.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "i2c.h"
|
#include "maa.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
|
||||||
#define MAX_BUFFER_LENGTH 6
|
#define MAX_BUFFER_LENGTH 6
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "gpio.h"
|
#include "maa.h"
|
||||||
|
|
||||||
static volatile int counter = 0;
|
static volatile int counter = 0;
|
||||||
static volatile int oldcounter = 0;
|
static volatile int oldcounter = 0;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "gpio.h"
|
#include "maa.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "spi.h"
|
#include "maa.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
include_directories(
|
include_directories(
|
||||||
${PROJECT_SOURCE_DIR}/api
|
${PROJECT_SOURCE_DIR}/api
|
||||||
|
${PROJECT_SOURCE_DIR}/api/maa
|
||||||
${PROJECT_SOURCE_DIR}/include
|
${PROJECT_SOURCE_DIR}/include
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -16,6 +17,11 @@ set (maa_LIB_SRCS
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}/version.c
|
${CMAKE_CURRENT_BINARY_DIR}/version.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set (maa_LIB_GLOB_HEADERS
|
||||||
|
${PROJECT_SOURCE_DIR}/api/maa.h
|
||||||
|
${PROJECT_SOURCE_DIR}/api/maa.hpp
|
||||||
|
)
|
||||||
|
|
||||||
add_library (maa SHARED ${maa_LIB_SRCS})
|
add_library (maa SHARED ${maa_LIB_SRCS})
|
||||||
target_link_libraries (maa ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries (maa ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
@@ -25,7 +31,8 @@ set_target_properties(
|
|||||||
SOVERSION ${maa_VERSION_MAJOR}
|
SOVERSION ${maa_VERSION_MAJOR}
|
||||||
VERSION ${maa_VERSION_STRING}
|
VERSION ${maa_VERSION_STRING}
|
||||||
)
|
)
|
||||||
install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/ DESTINATION include/maa)
|
install (FILES ${maa_LIB_GLOB_HEADERS} DESTINATION include/)
|
||||||
|
install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/maa DESTINATION include/maa)
|
||||||
|
|
||||||
macro (maa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
|
macro (maa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
|
||||||
configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
|
configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ Description: Low Level Skeleton Library for Communication
|
|||||||
Version: @maa_VERSION_STRING@
|
Version: @maa_VERSION_STRING@
|
||||||
|
|
||||||
Libs: -L${libdir} -lmaa
|
Libs: -L${libdir} -lmaa
|
||||||
Cflags: -I${includedir}/maa
|
Cflags: -I${includedir}
|
||||||
|
|||||||
Reference in New Issue
Block a user