Skip to content

Commit 7bf987a

Browse files
committed
Merge mainline updates
2 parents b0184e6 + be04314 commit 7bf987a

File tree

275 files changed

+26000
-11004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+26000
-11004
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ NXP:
3333
* LPC810 (Cortex-M0+)
3434
* [LPC812](http://developer.mbed.org/platforms/NXP-LPC800-MAX/) (Cortex-M0+)
3535
* [EA LPC4088](http://developer.mbed.org/platforms/EA-LPC4088/) (Cortex-M4F)
36+
* [EA LPC4088 DM](http://developer.mbed.org/platforms/EA-LPC4088-Display-Module/) (Cortex-M4F)
3637
* LPC4330 (Cortex-M4F + Cortex-M0)
3738
* [LPC1347](http://developer.mbed.org/platforms/DipCortex-M3/) (Cortex-M3)
3839
* [LPC1114](http://developer.mbed.org/platforms/LPC1114FN28/) (Cortex-M0)

libraries/USBDevice/USBDevice/USBEndpoints.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ typedef enum {
3737
} EP_STATUS;
3838

3939
/* Include configuration for specific target */
40-
#if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088)
40+
#if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM)
4141
#include "USBEndpoints_LPC17_LPC23.h"
4242
#elif defined(TARGET_LPC11UXX) || defined(TARGET_LPC1347) || defined (TARGET_LPC11U6X) || defined (TARGET_LPC1549)
4343
#include "USBEndpoints_LPC11U.h"

libraries/USBDevice/USBDevice/USBHAL_LPC40.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1717
*/
1818

19-
#if defined(TARGET_LPC4088)
19+
#if defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM)
2020

2121
#include "USBHAL.h"
2222

libraries/mbed/api/BusIn.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,35 @@ class BusIn {
5858
*/
5959
void mode(PinMode pull);
6060

61+
/** Binary mask of bus pins connected to actual pins (not NC pins)
62+
* If bus pin is in NC state make corresponding bit will be cleared (set to 0), else bit will be set to 1
63+
*
64+
* @returns
65+
* Binary mask of connected pins
66+
*/
67+
int mask() {
68+
return _nc_mask;
69+
}
70+
6171
#ifdef MBED_OPERATORS
6272
/** A shorthand for read()
6373
*/
6474
operator int();
75+
76+
/** Access to particular bit in random-iterator fashion
77+
*/
78+
DigitalIn & operator[] (int index);
6579
#endif
6680

6781
protected:
6882
DigitalIn* _pin[16];
6983

84+
/** Mask of bus's NC pins
85+
* If bit[n] is set to 1 - pin is connected
86+
* if bit[n] is cleared - pin is not connected (NC)
87+
*/
88+
int _nc_mask;
89+
7090
/* disallow copy constructor and assignment operators */
7191
private:
7292
BusIn(const BusIn&);

libraries/mbed/api/BusInOut.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class BusInOut {
5151
*/
5252
void write(int value);
5353

54-
5554
/** Read the value currently output on the bus
5655
*
5756
* @returns
@@ -73,12 +72,26 @@ class BusInOut {
7372
*/
7473
void mode(PinMode pull);
7574

75+
/** Binary mask of bus pins connected to actual pins (not NC pins)
76+
* If bus pin is in NC state make corresponding bit will be cleared (set to 0), else bit will be set to 1
77+
*
78+
* @returns
79+
* Binary mask of connected pins
80+
*/
81+
int mask() {
82+
return _nc_mask;
83+
}
84+
7685
#ifdef MBED_OPERATORS
7786
/** A shorthand for write()
7887
*/
7988
BusInOut& operator= (int v);
8089
BusInOut& operator= (BusInOut& rhs);
8190

91+
/** Access to particular bit in random-iterator fashion
92+
*/
93+
DigitalInOut& operator[] (int index);
94+
8295
/** A shorthand for read()
8396
*/
8497
operator int();
@@ -87,6 +100,12 @@ class BusInOut {
87100
protected:
88101
DigitalInOut* _pin[16];
89102

103+
/** Mask of bus's NC pins
104+
* If bit[n] is set to 1 - pin is connected
105+
* if bit[n] is cleared - pin is not connected (NC)
106+
*/
107+
int _nc_mask;
108+
90109
/* disallow copy constructor and assignment operators */
91110
private:
92111
BusInOut(const BusInOut&);

libraries/mbed/api/BusOut.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,26 @@ class BusOut {
5656
*/
5757
int read();
5858

59+
/** Binary mask of bus pins connected to actual pins (not NC pins)
60+
* If bus pin is in NC state make corresponding bit will be cleared (set to 0), else bit will be set to 1
61+
*
62+
* @returns
63+
* Binary mask of connected pins
64+
*/
65+
int mask() {
66+
return _nc_mask;
67+
}
68+
5969
#ifdef MBED_OPERATORS
6070
/** A shorthand for write()
6171
*/
6272
BusOut& operator= (int v);
6373
BusOut& operator= (BusOut& rhs);
6474

75+
/** Access to particular bit in random-iterator fashion
76+
*/
77+
DigitalOut& operator[] (int index);
78+
6579
/** A shorthand for read()
6680
*/
6781
operator int();
@@ -70,6 +84,12 @@ class BusOut {
7084
protected:
7185
DigitalOut* _pin[16];
7286

87+
/** Mask of bus's NC pins
88+
* If bit[n] is set to 1 - pin is connected
89+
* if bit[n] is cleared - pin is not connected (NC)
90+
*/
91+
int _nc_mask;
92+
7393
/* disallow copy constructor and assignment operators */
7494
private:
7595
BusOut(const BusOut&);

libraries/mbed/api/DigitalIn.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ class DigitalIn {
8080
gpio_mode(&gpio, pull);
8181
}
8282

83+
/** Return the output setting, represented as 0 or 1 (int)
84+
*
85+
* @returns
86+
* Non zero value if pin is connected to uc GPIO
87+
* 0 if gpio object was initialized with NC
88+
*/
89+
int is_connected() {
90+
return gpio_is_connected(&gpio);
91+
}
92+
8393
#ifdef MBED_OPERATORS
8494
/** An operator shorthand for read()
8595
*/

libraries/mbed/api/DigitalInOut.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ class DigitalInOut {
8585
gpio_mode(&gpio, pull);
8686
}
8787

88+
/** Return the output setting, represented as 0 or 1 (int)
89+
*
90+
* @returns
91+
* Non zero value if pin is connected to uc GPIO
92+
* 0 if gpio object was initialized with NC
93+
*/
94+
int is_connected() {
95+
return gpio_is_connected(&gpio);
96+
}
97+
8898
#ifdef MBED_OPERATORS
8999
/** A shorthand for write()
90100
*/

libraries/mbed/api/DigitalOut.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ class DigitalOut {
7777
return gpio_read(&gpio);
7878
}
7979

80+
/** Return the output setting, represented as 0 or 1 (int)
81+
*
82+
* @returns
83+
* Non zero value if pin is connected to uc GPIO
84+
* 0 if gpio object was initialized with NC
85+
*/
86+
int is_connected() {
87+
return gpio_is_connected(&gpio);
88+
}
89+
8090
#ifdef MBED_OPERATORS
8191
/** A shorthand for write()
8292
*/

libraries/mbed/api/mbed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#ifndef MBED_H
1717
#define MBED_H
1818

19-
#define MBED_LIBRARY_VERSION 92
19+
#define MBED_LIBRARY_VERSION 93
2020

2121
#include "platform.h"
2222

libraries/mbed/common/BusIn.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,29 @@
1414
* limitations under the License.
1515
*/
1616
#include "BusIn.h"
17+
#include "mbed_assert.h"
1718

1819
namespace mbed {
1920

2021
BusIn::BusIn(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) {
2122
PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15};
2223

24+
_nc_mask = 0;
2325
for (int i=0; i<16; i++) {
2426
_pin[i] = (pins[i] != NC) ? new DigitalIn(pins[i]) : 0;
27+
if (pins[i] != NC) {
28+
_nc_mask |= (1 << i);
29+
}
2530
}
2631
}
2732

2833
BusIn::BusIn(PinName pins[16]) {
34+
_nc_mask = 0;
2935
for (int i=0; i<16; i++) {
3036
_pin[i] = (pins[i] != NC) ? new DigitalIn(pins[i]) : 0;
37+
if (pins[i] != NC) {
38+
_nc_mask |= (1 << i);
39+
}
3140
}
3241
}
3342

@@ -61,6 +70,13 @@ void BusIn::mode(PinMode pull) {
6170
BusIn::operator int() {
6271
return read();
6372
}
73+
74+
DigitalIn& BusIn::operator[] (int index) {
75+
MBED_ASSERT(index >= 0 && index <= 16);
76+
MBED_ASSERT(_pin[index]);
77+
return *_pin[index];
78+
}
79+
6480
#endif
6581

6682
} // namespace mbed

libraries/mbed/common/BusInOut.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,29 @@
1414
* limitations under the License.
1515
*/
1616
#include "BusInOut.h"
17+
#include "mbed_assert.h"
1718

1819
namespace mbed {
1920

2021
BusInOut::BusInOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) {
2122
PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15};
2223

24+
_nc_mask = 0;
2325
for (int i=0; i<16; i++) {
2426
_pin[i] = (pins[i] != NC) ? new DigitalInOut(pins[i]) : 0;
27+
if (pins[i] != NC) {
28+
_nc_mask |= (1 << i);
29+
}
2530
}
2631
}
2732

2833
BusInOut::BusInOut(PinName pins[16]) {
34+
_nc_mask = 0;
2935
for (int i=0; i<16; i++) {
3036
_pin[i] = (pins[i] != NC) ? new DigitalInOut(pins[i]) : 0;
37+
if (pins[i] != NC) {
38+
_nc_mask |= (1 << i);
39+
}
3140
}
3241
}
3342

@@ -92,6 +101,12 @@ BusInOut& BusInOut::operator= (BusInOut& rhs) {
92101
return *this;
93102
}
94103

104+
DigitalInOut& BusInOut::operator[] (int index) {
105+
MBED_ASSERT(index >= 0 && index <= 16);
106+
MBED_ASSERT(_pin[index]);
107+
return *_pin[index];
108+
}
109+
95110
BusInOut::operator int() {
96111
return read();
97112
}

libraries/mbed/common/BusOut.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,29 @@
1414
* limitations under the License.
1515
*/
1616
#include "BusOut.h"
17+
#include "mbed_assert.h"
1718

1819
namespace mbed {
1920

2021
BusOut::BusOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) {
2122
PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15};
2223

24+
_nc_mask = 0;
2325
for (int i=0; i<16; i++) {
2426
_pin[i] = (pins[i] != NC) ? new DigitalOut(pins[i]) : 0;
27+
if (pins[i] != NC) {
28+
_nc_mask |= (1 << i);
29+
}
2530
}
2631
}
2732

2833
BusOut::BusOut(PinName pins[16]) {
34+
_nc_mask = 0;
2935
for (int i=0; i<16; i++) {
3036
_pin[i] = (pins[i] != NC) ? new DigitalOut(pins[i]) : 0;
37+
if (pins[i] != NC) {
38+
_nc_mask |= (1 << i);
39+
}
3140
}
3241
}
3342

@@ -68,6 +77,12 @@ BusOut& BusOut::operator= (BusOut& rhs) {
6877
return *this;
6978
}
7079

80+
DigitalOut& BusOut::operator[] (int index) {
81+
MBED_ASSERT(index >= 0 && index <= 16);
82+
MBED_ASSERT(_pin[index]);
83+
return *_pin[index];
84+
}
85+
7186
BusOut::operator int() {
7287
return read();
7388
}

libraries/mbed/common/us_ticker_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void us_ticker_insert_event(ticker_event_t *obj, timestamp_t timestamp, uint32_t
7070
ticker_event_t *prev = NULL, *p = head;
7171
while (p != NULL) {
7272
/* check if we come before p */
73-
if ((int64_t)(timestamp - p->timestamp) < 0) {
73+
if ((int)(timestamp - p->timestamp) < 0) {
7474
break;
7575
}
7676
/* go to the next element */

libraries/mbed/hal/gpio_api.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ extern "C" {
2828
**/
2929
uint32_t gpio_set(PinName pin);
3030

31+
/* Checks if gpio object is connected (pin was not initialized with NC)
32+
* @param pin The pin to be set as GPIO
33+
* @return 0 if port is initialized with NC
34+
**/
35+
int gpio_is_connected(const gpio_t *obj);
36+
3137
/* GPIO object */
3238
void gpio_init(gpio_t *obj, PinName pin);
3339

libraries/mbed/hal/us_ticker_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
extern "C" {
2323
#endif
2424

25-
typedef uint64_t timestamp_t;
25+
typedef uint32_t timestamp_t;
2626

2727
uint32_t us_ticker_read(void);
2828

libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K22F/cmsis_nvic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*/
3131
#include "cmsis_nvic.h"
3232

33-
#define NVIC_RAM_VECTOR_ADDRESS (0x1FFFE000) // Vectors positioned at start of RAM
33+
#define NVIC_RAM_VECTOR_ADDRESS (0x1FFF0000) // Vectors positioned at start of RAM
3434
#define NVIC_FLASH_VECTOR_ADDRESS (0x0) // Initial vector position in flash
3535

3636
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {

libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K22F/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#ifndef MBED_CMSIS_NVIC_H
3333
#define MBED_CMSIS_NVIC_H
3434

35-
#define NVIC_NUM_VECTORS (16 + 46) // CORE + MCU Peripherals
35+
#define NVIC_NUM_VECTORS (16 + 86) // CORE + MCU Peripherals
3636
#define NVIC_USER_IRQ_OFFSET 16
3737

3838
#include "cmsis.h"

0 commit comments

Comments
 (0)