Private
Public Access
2
0

beaglebone.h: added Beaglebone Black Platform

src/arm/CMakeLists.txt added beaglebone.c as a dependency src/arm/arm.c added
initialization of beaglebone black platform src/arm/beaglebone.c mraa support
for the Beaglebone Black Rev B+C includes support for mmap access to gpio

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Michael Ring
2015-02-21 16:30:09 +01:00
committed by Brendan Le Foll
parent d0c466e81c
commit d9d55e42bc
5 changed files with 1401 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ typedef enum {
MRAA_INTEL_DE3815 = 3, /**< The Intel DE3815 Baytrail NUC */
MRAA_INTEL_MINNOWBOARD_MAX = 4, /**< The Intel Minnow Board Max */
MRAA_RASPBERRY_PI = 5, /**< The different Raspberry PI Models -like A,B,A+,B+ */
MRAA_BEAGLEBONE = 6, /**< The different BeagleBone Black Modes B/C */
MRAA_UNKNOWN_PLATFORM =
99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */

41
include/arm/beaglebone.h Normal file
View File

@@ -0,0 +1,41 @@
/*
* Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
* Author: Michael Ring <mail@michael-ring.org>
* 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
#ifdef __cplusplus
extern "C" {
#endif
#include "mraa_internal.h"
#define MRAA_BEAGLEBONE_BLACK_PINCOUNT 93
mraa_board_t *
mraa_beaglebone();
#ifdef __cplusplus
}
#endif

View File

@@ -2,5 +2,6 @@ message (INFO " - Adding ARM platforms")
set (mraa_LIB_SRCS_NOAUTO ${mraa_LIB_SRCS_NOAUTO}
${PROJECT_SOURCE_DIR}/src/arm/arm.c
${PROJECT_SOURCE_DIR}/src/arm/raspberry_pi.c
${PROJECT_SOURCE_DIR}/src/arm/beaglebone.c
PARENT_SCOPE
)

View File

@@ -28,6 +28,7 @@
#include "mraa_internal.h"
#include "arm/raspberry_pi.h"
#include "arm/beaglebone.h"
mraa_platform_t
mraa_arm_platform()
@@ -45,6 +46,9 @@ mraa_arm_platform()
if (strstr(line, "BCM2709")) {
platform_type = MRAA_RASPBERRY_PI;
}
if (strstr(line, "Generic AM33XX")) {
platform_type = MRAA_BEAGLEBONE;
}
}
}
fclose(fh);
@@ -55,9 +59,12 @@ mraa_arm_platform()
case MRAA_RASPBERRY_PI:
plat = mraa_raspberry_pi();
break;
case MRAA_BEAGLEBONE:
plat = mraa_beaglebone();
break;
default:
plat = mraa_raspberry_pi();
syslog(LOG_ERR, "Platform not supported, initialising as MRAA_RASPBERRY_PI");
plat = NULL;
syslog(LOG_ERR, "Unknown Platform, currently not supported by MRAA");
}
return platform_type;
}

1349
src/arm/beaglebone.c Normal file

File diff suppressed because it is too large Load Diff