Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the new IOT2050-SM variant and some improvements #1124

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/mraa/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/** Max size off Mraa Platform name */
#define MRAA_PLATFORM_NAME_MAX_SIZE 64
/** Size off Mraa pin name */
#define MRAA_PIN_NAME_SIZE 12
#define MRAA_PIN_NAME_SIZE 32

/** Bit Shift for Mraa sub platform */
#define MRAA_SUB_PLATFORM_BIT_SHIFT 9
Expand Down
1 change: 1 addition & 0 deletions api/mraa/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef enum {
MRAA_RADXA_ROCK_3B = 32, /**< Radxa ROCK 3 Model B */
MRAA_RADXA_CM3 = 33, /**< Radxa CM3 */
MRAA_RADXA_CM5_IO = 34, /**< Radxa CM5 IO */
MRAA_SIEMENS_IOT2050_SM = 35, /**< Siemens IOT2050-SM board */

// USB platform extenders start at 256
MRAA_FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */
Expand Down
4 changes: 4 additions & 0 deletions include/arm/siemens/iot2050.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ extern "C" {

#define PLATFORM_NAME "SIMATIC IOT2050"
#define MRAA_IOT2050_PINCOUNT 21
#define MRAA_IOT2050_SM_PINCOUNT 1

mraa_board_t *
mraa_siemens_iot2050();

mraa_board_t *
mraa_siemens_iot2050_sm();

#ifdef __cplusplus
}
#endif
4 changes: 4 additions & 0 deletions src/arm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ mraa_arm_platform()
platform_type = MRAA_RASPBERRY_PI;
else if (mraa_file_contains("/proc/device-tree/model", "ADLINK ARM, LEC-PX30"))
platform_type = MRAA_ADLINK_IPI;
else if (mraa_file_contains("/proc/device-tree/model", "SIMATIC IOT2050 Advanced SM"))
platform_type = MRAA_SIEMENS_IOT2050_SM;
else if (mraa_file_contains("/proc/device-tree/model", "SIMATIC IOT2050"))
platform_type = MRAA_SIEMENS_IOT2050;
else if (mraa_file_contains("/proc/device-tree/model", "Xunlong Orange Pi Prime"))
Expand Down Expand Up @@ -174,6 +176,8 @@ mraa_arm_platform()
break;
case MRAA_ORANGE_PI_PRIME:
plat = mraa_orange_pi_prime();
case MRAA_SIEMENS_IOT2050_SM:
plat = mraa_siemens_iot2050_sm();
break;
default:
plat = NULL;
Expand Down
Loading