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

provided a script for moving from device.h to target.json #1830

Merged
merged 7 commits into from
Jun 4, 2016
Merged
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
7 changes: 7 additions & 0 deletions docs/mbed_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ The list of **labels** defines how the build system looks for sources, libraries

If target inheritance is used, it's possible to alter the values of `extra_labels` using `extra_labels_add` and `extra_labels_remove`. This is similar to the `macros_add` and `macros_remove` mechanism described in the previous paragraph.

## features, features_add, features_remove

The list of **features** defines what hardware a device has.
This allows allowing mbed, libraries, or application source code to select between different implementations of drivers based on hardware availability, to selectively compile drivers for only the hardware that exists, or to test only the tests that apply to a particular platform.

If target inheritance is used, it's possible to alter the values of `features` using `features_add` and `features_remove`. This is similar to the `macros_add` and `macros_remove` mechanism described in the previous two paragraphs.

## supported_toolchains

This is the list of toolchains that can be used to compile code for the target. The known toolchains are `ARM`, `uARM`, `GCC_ARM`, `GCC_CR`, `IAR`.
Expand Down
424 changes: 261 additions & 163 deletions hal/targets.json

Large diffs are not rendered by default.

27 changes: 2 additions & 25 deletions hal/targets/hal/TARGET_ARM_SSG/TARGET_IOTSS/device.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
// Check the 'features' section of the target description in 'targets.json' for more details.
/* mbed Microcontroller Library
* Copyright (c) 2006-2015 ARM Limited
*
Expand All @@ -16,48 +18,23 @@
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

#define DEVICE_PORTIN 1
#define DEVICE_PORTOUT 1
#define DEVICE_PORTINOUT 1

#define DEVICE_INTERRUPTIN 1

#define DEVICE_ANALOGIN 1
#define DEVICE_ANALOGOUT 0

#define DEVICE_SERIAL 1
#define DEVICE_SERIAL_FC 1

#define DEVICE_I2C 1
#define DEVICE_I2CSLAVE 0

#define DEVICE_SPI 1
#define DEVICE_SPISLAVE 1

#define DEVICE_CLCD 1

#define DEVICE_TSC 1

#define DEVICE_AACI 1

#define DEVICE_CAN 0

#define DEVICE_RTC 0

#define DEVICE_ETHERNET 1

#define DEVICE_PWMOUT 0

#define DEVICE_SEMIHOST 0
#define DEVICE_LOCALFILESYSTEM 0

#define DEVICE_SLEEP 0

#define DEVICE_DEBUG_AWARENESS 0

#define DEVICE_STDIO_MESSAGES 0

#define DEVICE_ERROR_RED 0

#include "objects.h"

Expand Down
27 changes: 2 additions & 25 deletions hal/targets/hal/TARGET_ARM_SSG/TARGET_MPS2/device.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
// Check the 'features' section of the target description in 'targets.json' for more details.
/* mbed Microcontroller Library
* Copyright (c) 2006-2015 ARM Limited
*
Expand All @@ -16,48 +18,23 @@
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

#define DEVICE_PORTIN 1
#define DEVICE_PORTOUT 1
#define DEVICE_PORTINOUT 1

#define DEVICE_INTERRUPTIN 1

#define DEVICE_ANALOGIN 1
#define DEVICE_ANALOGOUT 0

#define DEVICE_SERIAL 1
#define DEVICE_SERIAL_FC 1

#define DEVICE_I2C 1
#define DEVICE_I2CSLAVE 0

#define DEVICE_SPI 1
#define DEVICE_SPISLAVE 1

#define DEVICE_CLCD 1

#define DEVICE_TSC 1

#define DEVICE_AACI 1

#define DEVICE_CAN 0

#define DEVICE_RTC 0

#define DEVICE_ETHERNET 1

#define DEVICE_PWMOUT 0

#define DEVICE_SEMIHOST 0
#define DEVICE_LOCALFILESYSTEM 0

#define DEVICE_SLEEP 0

#define DEVICE_DEBUG_AWARENESS 0

#define DEVICE_STDIO_MESSAGES 0

#define DEVICE_ERROR_RED 0

#include "objects.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
// Check the 'features' section of the target description in 'targets.json' for more details.
/* mbed Microcontroller Library
* Copyright (c) 2006-2015 ARM Limited
*
Expand All @@ -16,47 +18,20 @@
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

#define DEVICE_PORTIN 1
#define DEVICE_PORTOUT 1
#define DEVICE_PORTINOUT 1

#define DEVICE_INTERRUPTIN 1

#define DEVICE_ANALOGIN 1
#define DEVICE_ANALOGOUT 1

#define DEVICE_SERIAL 1
#define DEVICE_SERIAL_FC 1
#define DEVICE_SERIAL_ASYNCH 1

#define DEVICE_I2C 1
#define DEVICE_I2CSLAVE 1
#define DEVICE_I2C_ASYNCH 1

#define DEVICE_SPI 1
#define DEVICE_SPISLAVE 1
#define DEVICE_SPI_ASYNCH 1

#define DEVICE_CAN 0

#define DEVICE_RTC 1

#define DEVICE_ETHERNET 0

#define DEVICE_PWMOUT 1

#define DEVICE_SEMIHOST 0
#define DEVICE_LOCALFILESYSTEM 0
#define DEVICE_ID_LENGTH 0
#define DEVICE_MAC_OFFSET 0

#define DEVICE_SLEEP 1

#define DEVICE_DEBUG_AWARENESS 0

#define DEVICE_STDIO_MESSAGES 0

#define DEVICE_ERROR_PATTERN 0

#include "objects.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
// Check the 'features' section of the target description in 'targets.json' for more details.
/* mbed Microcontroller Library
* Copyright (c) 2006-2015 ARM Limited
*
Expand All @@ -16,47 +18,20 @@
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

#define DEVICE_PORTIN 1
#define DEVICE_PORTOUT 1
#define DEVICE_PORTINOUT 1

#define DEVICE_INTERRUPTIN 1

#define DEVICE_ANALOGIN 1
#define DEVICE_ANALOGOUT 1

#define DEVICE_SERIAL 1
#define DEVICE_SERIAL_FC 1
#define DEVICE_SERIAL_ASYNCH 1

#define DEVICE_I2C 1
#define DEVICE_I2CSLAVE 1
#define DEVICE_I2C_ASYNCH 1

#define DEVICE_SPI 1
#define DEVICE_SPISLAVE 1
#define DEVICE_SPI_ASYNCH 1

#define DEVICE_CAN 0

#define DEVICE_RTC 1

#define DEVICE_ETHERNET 0

#define DEVICE_PWMOUT 1

#define DEVICE_SEMIHOST 0
#define DEVICE_LOCALFILESYSTEM 0
#define DEVICE_ID_LENGTH 0
#define DEVICE_MAC_OFFSET 0

#define DEVICE_SLEEP 1

#define DEVICE_DEBUG_AWARENESS 0

#define DEVICE_STDIO_MESSAGES 0

#define DEVICE_ERROR_PATTERN 0

#include "objects.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
// Check the 'features' section of the target description in 'targets.json' for more details.
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
Expand All @@ -16,47 +18,20 @@
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

#define DEVICE_PORTIN 1
#define DEVICE_PORTOUT 1
#define DEVICE_PORTINOUT 1

#define DEVICE_INTERRUPTIN 1

#define DEVICE_ANALOGIN 1
#define DEVICE_ANALOGOUT 1

#define DEVICE_SERIAL 1
#define DEVICE_SERIAL_FC 1
#define DEVICE_SERIAL_ASYNCH 1

#define DEVICE_I2C 1
#define DEVICE_I2CSLAVE 1
#define DEVICE_I2C_ASYNCH 1

#define DEVICE_SPI 1
#define DEVICE_SPISLAVE 1
#define DEVICE_SPI_ASYNCH 1

#define DEVICE_CAN 0

#define DEVICE_RTC 1

#define DEVICE_ETHERNET 0

#define DEVICE_PWMOUT 1

#define DEVICE_SEMIHOST 0
#define DEVICE_LOCALFILESYSTEM 0
#define DEVICE_ID_LENGTH 0
#define DEVICE_MAC_OFFSET 0

#define DEVICE_SLEEP 1

#define DEVICE_DEBUG_AWARENESS 0

#define DEVICE_STDIO_MESSAGES 0

#define DEVICE_ERROR_PATTERN 0

#include "objects.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
// Check the 'features' section of the target description in 'targets.json' for more details.
/* mbed Microcontroller Library
* Copyright (c) 2006-2015 ARM Limited
*
Expand All @@ -16,47 +18,20 @@
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

#define DEVICE_PORTIN 1
#define DEVICE_PORTOUT 1
#define DEVICE_PORTINOUT 1

#define DEVICE_INTERRUPTIN 1

#define DEVICE_ANALOGIN 1
#define DEVICE_ANALOGOUT 0

#define DEVICE_SERIAL 1
#define DEVICE_SERIAL_FC 1
#define DEVICE_SERIAL_ASYNCH 1

#define DEVICE_I2C 1
#define DEVICE_I2CSLAVE 1
#define DEVICE_I2C_ASYNCH 1

#define DEVICE_SPI 1
#define DEVICE_SPISLAVE 1
#define DEVICE_SPI_ASYNCH 1

#define DEVICE_CAN 0

#define DEVICE_RTC 1

#define DEVICE_ETHERNET 0

#define DEVICE_PWMOUT 1

#define DEVICE_SEMIHOST 0
#define DEVICE_LOCALFILESYSTEM 0
#define DEVICE_ID_LENGTH 0
#define DEVICE_MAC_OFFSET 0

#define DEVICE_SLEEP 1

#define DEVICE_DEBUG_AWARENESS 0

#define DEVICE_STDIO_MESSAGES 0

#define DEVICE_ERROR_PATTERN 0

#include "objects.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
// Check the 'features' section of the target description in 'targets.json' for more details.
/* mbed Microcontroller Library
* Copyright (c) 2006-2015 ARM Limited
*
Expand All @@ -16,48 +18,20 @@
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

#define DEVICE_PORTIN 1
#define DEVICE_PORTOUT 1
#define DEVICE_PORTINOUT 1

#define DEVICE_INTERRUPTIN 1

#define DEVICE_ANALOGIN 1
#define DEVICE_ANALOGOUT 0

#define DEVICE_SERIAL 1
#define DEVICE_SERIAL_FC 1
#define DEVICE_SERIAL_ASYNCH 1

#define DEVICE_I2C 1
#define DEVICE_I2CSLAVE 1
#define DEVICE_I2C_ASYNCH 1

#define DEVICE_SPI 1
#define DEVICE_SPISLAVE 1
#define DEVICE_SPI_ASYNCH 1

#define DEVICE_CAN 0

#define DEVICE_RTC 1

#define DEVICE_ETHERNET 0

#define DEVICE_PWMOUT 1

#define DEVICE_SEMIHOST 0
#define DEVICE_LOCALFILESYSTEM 0
#define DEVICE_ID_LENGTH 0
#define DEVICE_MAC_OFFSET 0

#define DEVICE_LOWPOWERTIMER 1
#define DEVICE_SLEEP 1

#define DEVICE_DEBUG_AWARENESS 0

#define DEVICE_STDIO_MESSAGES 0

#define DEVICE_ERROR_PATTERN 0

#include "objects.h"

Expand Down
Loading