Skip to content

Commit

Permalink
Merge pull request #1830 from theotherjimmy/device-h-to-target-json
Browse files Browse the repository at this point in the history
provided a script for moving from device.h to target.json
  • Loading branch information
0xc0170 committed Jun 4, 2016
2 parents 986225d + 66574aa commit d1ec4be
Show file tree
Hide file tree
Showing 120 changed files with 714 additions and 2,605 deletions.
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

0 comments on commit d1ec4be

Please sign in to comment.