Skip to content

Commit 35e65da

Browse files
committed
Merge pull request #3 from mbedmicro/master
Sync with master
2 parents f44b3ab + 53e1cdc commit 35e65da

File tree

1,663 files changed

+770510
-290675
lines changed

Some content is hidden

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

1,663 files changed

+770510
-290675
lines changed

README.md

Lines changed: 48 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,58 +16,68 @@ have been built on top of the SDK by the mbed Developer Community.
1616

1717
Documentation
1818
-------------
19-
* [Tools](http://mbed.org/handbook/mbed-tools): how to setup and use the build system.
20-
* [mbed library internals](http://mbed.org/handbook/mbed-library-internals)
21-
* [Adding a new target microcontroller](http://mbed.org/handbook/mbed-SDK-porting)
19+
* [Tools](http://developer.mbed.org/handbook/mbed-tools): how to setup and use the build system.
20+
* [mbed library internals](http://developer.mbed.org/handbook/mbed-library-internals)
21+
* [Adding a new target microcontroller](http://developer.mbed.org/handbook/mbed-SDK-porting)
2222

2323
Supported Microcontrollers and Boards
2424
-------------------------------------
25-
View all on the [mbed Platforms](https://mbed.org/platforms/) page.
25+
View all on the [mbed Platforms](https://developer.mbed.org/platforms/) page.
2626

2727
NXP:
28-
* [mbed LPC1768](http://mbed.org/platforms/mbed-LPC1768/) (Cortex-M3)
29-
* [u-blox C027 LPC1768](http://mbed.org/platforms/u-blox-C027/) (Cortex-M3)
30-
* [mbed LPC11U24](http://mbed.org/platforms/mbed-LPC11U24/) (Cortex-M0)
31-
* [EA LPC11U35](http://mbed.org/platforms/EA-LPC11U35/) (Cortex-M0)
28+
* [mbed LPC1768](http://developer.mbed.org/platforms/mbed-LPC1768/) (Cortex-M3)
29+
* [u-blox C027 LPC1768](http://developer.mbed.org/platforms/u-blox-C027/) (Cortex-M3)
30+
* [mbed LPC11U24](http://developer.mbed.org/platforms/mbed-LPC11U24/) (Cortex-M0)
31+
* [EA LPC11U35](http://developer.mbed.org/platforms/EA-LPC11U35/) (Cortex-M0)
3232
* mbed LPC2368 (ARM7TDMI-S)
3333
* LPC810 (Cortex-M0+)
34-
* [LPC812](http://mbed.org/platforms/NXP-LPC800-MAX/) (Cortex-M0+)
35-
* [EA LPC4088](http://mbed.org/platforms/EA-LPC4088/) (Cortex-M4F)
34+
* [LPC812](http://developer.mbed.org/platforms/NXP-LPC800-MAX/) (Cortex-M0+)
35+
* [EA LPC4088](http://developer.mbed.org/platforms/EA-LPC4088/) (Cortex-M4F)
3636
* LPC4330 (Cortex-M4F + Cortex-M0)
37-
* [LPC1347](http://mbed.org/platforms/DipCortex-M3/) (Cortex-M3)
38-
* [LPC1114](http://mbed.org/platforms/LPC1114FN28/) (Cortex-M0)
37+
* [LPC1347](http://developer.mbed.org/platforms/DipCortex-M3/) (Cortex-M3)
38+
* [LPC1114](http://developer.mbed.org/platforms/LPC1114FN28/) (Cortex-M0)
3939
* LPC11C24 (Cortex-M0)
40-
* [LPC1549](https://mbed.org/platforms/LPCXpresso1549/) (Cortex-M3)
41-
* [LPC800-MAX](https://mbed.org/platforms/NXP-LPC800-MAX/) (Cortex-M0+)
42-
* [DipCortex-M0](https://mbed.org/platforms/DipCortex-M0/) (Cortex-M0)
43-
* [DipCortex-M3](https://mbed.org/platforms/DipCortex-M3/) (Cortex-M3)
44-
* [BlueBoard-LPC11U24](https://mbed.org/platforms/BlueBoard-LPC11U24/) (Cortex-M0)
40+
* [LPC1549](https://developer.mbed.org/platforms/LPCXpresso1549/) (Cortex-M3)
41+
* [LPC800-MAX](https://developer.mbed.org/platforms/NXP-LPC800-MAX/) (Cortex-M0+)
42+
* [DipCortex-M0](https://developer.mbed.org/platforms/DipCortex-M0/) (Cortex-M0)
43+
* [DipCortex-M3](https://developer.mbed.org/platforms/DipCortex-M3/) (Cortex-M3)
44+
* [BlueBoard-LPC11U24](https://developer.mbed.org/platforms/BlueBoard-LPC11U24/) (Cortex-M0)
4545
* LPCCAPPUCCINO (Cortex-M0)
46+
* [Arch](https://developer.mbed.org/platforms/Seeeduino-Arch/) (Cortex-M0)
47+
* [Arch GPRS](https://developer.mbed.org/platforms/Seeed-Arch-GPRS/) (Cortex-M0)
48+
* [Arch Pro](https://developer.mbed.org/platforms/Seeeduino-Arch-Pro/) (Cortex-M3)
4649

4750
Freescale:
48-
* FRDM-K20D50M (Cortex-M4)
49-
* [FRDM-KL05Z](https://mbed.org/platforms/FRDM-KL05Z/) (Cortex-M0+)
50-
* [FRDM-KL25Z](http://mbed.org/platforms/KL25Z/) (Cortex-M0+)
51-
* [FRDM-KL46Z](https://mbed.org/platforms/FRDM-KL46Z/) (Cortex-M0+)
52-
* [FRDM-K64F](https://mbed.org/platforms/FRDM-K64F/) (Cortex-M4F)
51+
* [FRDM-KL05Z](https://developer.mbed.org/platforms/FRDM-KL05Z/) (Cortex-M0+)
52+
* [FRDM-KL25Z](http://developer.mbed.org/platforms/KL25Z/) (Cortex-M0+)
53+
* [FRDM-KL46Z](https://developer.mbed.org/platforms/FRDM-KL46Z/) (Cortex-M0+)
54+
* [FRDM-K20D50M](https://developer.mbed.org/platforms/FRDM-K20D50M/) (Cortex-M4)
55+
* [FRDM-K22F](https://developer.mbed.org/platforms/FRDM-K22F/) (Cortex-M4F)
56+
* [FRDM-K64F](https://developer.mbed.org/platforms/FRDM-K64F/) (Cortex-M4F)
5357

5458
STMicroelectronics:
55-
* [Nucleo-F103RB](https://mbed.org/platforms/ST-Nucleo-F103RB/) (Cortex-M3)
56-
* [Nucleo-L152RE](https://mbed.org/platforms/ST-Nucleo-L152RE/) (Cortex-M3)
57-
* [Nucleo-F030R8](https://mbed.org/platforms/ST-Nucleo-F030R8/) (Cortex-M0)
58-
* [Nucleo-F401RE](https://mbed.org/platforms/ST-Nucleo-F401RE/) (Cortex-M4F)
59-
* [Nucleo-F411RE](https://mbed.org/platforms/ST-Nucleo-F411RE/) (Cortex-M4F)
60-
* [Nucleo-F302R8](https://mbed.org/platforms/ST-Nucleo-F302R8/) (Cortex-M4F)
59+
* [Nucleo-F030R8](https://developer.mbed.org/platforms/ST-Nucleo-F030R8/) (Cortex-M0)
60+
* [Nucleo-F072RB](https://developer.mbed.org/platforms/ST-Nucleo-F072RB/) (Cortex-M0)
61+
* [Nucleo-L053R8](https://developer.mbed.org/platforms/ST-Nucleo-L053R8/) (Cortex-M0+)
62+
* [Nucleo-F103RB](https://developer.mbed.org/platforms/ST-Nucleo-F103RB/) (Cortex-M3)
63+
* [Nucleo-L152RE](https://developer.mbed.org/platforms/ST-Nucleo-L152RE/) (Cortex-M3)
64+
* [Nucleo-F302R8](https://developer.mbed.org/platforms/ST-Nucleo-F302R8/) (Cortex-M4F)
65+
* [Nucleo-F334R8](https://developer.mbed.org/platforms/ST-Nucleo-F334R8/) (Cortex-M4F)
66+
* [Nucleo-F401RE](https://developer.mbed.org/platforms/ST-Nucleo-F401RE/) (Cortex-M4F)
67+
* [Nucleo-F411RE](https://developer.mbed.org/platforms/ST-Nucleo-F411RE/) (Cortex-M4F)
6168
* STM32F4XX (Cortex-M4F)
6269
* STM32F3XX (Cortex-M4F)
6370
* STM32F0-Discovery (Cortex-M0)
6471
* STM32VL-Discovery (Cortex-M3)
6572
* STM32F3-Discovery (Cortex-M4F)
6673
* STM32F4-Discovery (Cortex-M4F)
74+
* STM32F429-Discovery (Cortex-M4F)
75+
* [Arch Max](https://developer.mbed.org/platforms/Seeed-Arch-Max/) (Cortex-M4F)
6776

6877

6978
Nordic:
70-
* [nRF51822-mKIT](https://mbed.org/platforms/Nordic-nRF51822/) (Cortex-M0)
79+
* [nRF51822-mKIT](https://developer.mbed.org/platforms/Nordic-nRF51822/) (Cortex-M0)
80+
* [Arch BLE](https://developer.mbed.org/platforms/Seeed-Arch-BLE/) (Cortex-M0)
7181

7282
Supported Toolchains and IDEs
7383
-----------------------------
@@ -76,16 +86,18 @@ Supported Toolchains and IDEs
7686
* IAR: [IAR Embedded Workbench](http://www.iar.com/en/Products/IAR-Embedded-Workbench/ARM/)
7787
* GCC code_red: [Red Suite](http://www.code-red-tech.com/)
7888
* GCC CodeSourcery: [Sourcery CodeBench](http://www.mentor.com/embedded-software/codesourcery)
89+
* GCC ARM: [Em::Blocks](http://www.emblocks.org/web/)
90+
* GCC ARM: [CooCox CoIDE](http://www.coocox.org/)
7991

8092
API Documentation
8193
-----------------
82-
* [RTOS API](http://mbed.org/handbook/RTOS)
83-
* [TCP/IP Socket API](http://mbed.org/handbook/Socket) (Transports: Ethernet, WiFi, 3G)
84-
* [USB Device API](http://mbed.org/handbook/USBDevice)
85-
* [USB Host API](http://mbed.org/handbook/USBHost)
86-
* [DSP API](http://mbed.org/users/mbed_official/code/mbed-dsp/docs/tip/)
87-
* Flash File Systems: [SD](http://mbed.org/handbook/SDFileSystem), [USB MSD](http://mbed.org/handbook/USBHostMSD), [semihosted](http://mbed.org/handbook/LocalFileSystem)
88-
* [Peripheral Drivers API](http://mbed.org/handbook/Homepage)
94+
* [RTOS API](http://developer.mbed.org/handbook/RTOS)
95+
* [TCP/IP Socket API](http://developer.mbed.org/handbook/Socket) (Transports: Ethernet, WiFi, 3G)
96+
* [USB Device API](http://developer.mbed.org/handbook/USBDevice)
97+
* [USB Host API](http://developer.mbed.org/handbook/USBHost)
98+
* [DSP API](http://developer.mbed.org/users/mbed_official/code/mbed-dsp/docs/tip/)
99+
* Flash File Systems: [SD](http://developer.mbed.org/handbook/SDFileSystem), [USB MSD](http://developer.mbed.org/handbook/USBHostMSD), [semihosted](http://developer.mbed.org/handbook/LocalFileSystem)
100+
* [Peripheral Drivers API](http://developer.mbed.org/handbook/Homepage)
89101

90102
Community
91103
---------

libraries/USBDevice/USBDevice/USBEndpoints.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ typedef enum {
4343
#include "USBEndpoints_LPC11U.h"
4444
#elif defined(TARGET_KL25Z) | defined(TARGET_KL46Z) | defined(TARGET_K20D5M) | defined(TARGET_K64F)
4545
#include "USBEndpoints_KL25Z.h"
46-
#elif defined (TARGET_STM32F4XX)
46+
#elif defined (TARGET_STM32F4)
4747
#include "USBEndpoints_STM32F4.h"
4848
#else
4949
#error "Unknown target type"

libraries/USBDevice/USBDevice/USBHAL.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class USBHAL {
7777
#if !defined(TARGET_STM32F4)
7878
virtual bool EP4_OUT_callback(){return false;};
7979
virtual bool EP4_IN_callback(){return false;};
80-
#if !defined(TARGET_LPC11U24)
80+
#if !(defined(TARGET_LPC11UXX) || defined(TARGET_LPC11U6X) || defined(TARGET_LPC1347) || defined(TARGET_LPC1549))
8181
virtual bool EP5_OUT_callback(){return false;};
8282
virtual bool EP5_IN_callback(){return false;};
8383
virtual bool EP6_OUT_callback(){return false;};
@@ -108,9 +108,9 @@ class USBHAL {
108108
static void _usbisr(void);
109109
static USBHAL * instance;
110110

111-
#if defined(TARGET_LPC11U24)
111+
#if defined(TARGET_LPC11UXX) || defined(TARGET_LPC11U6X) || defined(TARGET_LPC1347) || defined(TARGET_LPC1549)
112112
bool (USBHAL::*epCallback[10 - 2])(void);
113-
#elif defined(TARGET_STM32F4XX)
113+
#elif defined(TARGET_STM32F4)
114114
bool (USBHAL::*epCallback[8 - 2])(void);
115115
#else
116116
bool (USBHAL::*epCallback[32 - 2])(void);

libraries/USBDevice/USBDevice/USBHAL_LPC11U.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1717
*/
1818

19-
#if defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC1347) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPC11U68) || defined(TARGET_LPC1549)
19+
#if defined(TARGET_LPC11UXX) || defined(TARGET_LPC11U6X) || defined(TARGET_LPC1347) || defined(TARGET_LPC1549)
2020

2121
#if defined(TARGET_LPC1347) || defined(TARGET_LPC1549)
2222
#define USB_IRQ USB_IRQ_IRQn
23-
#elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPC11U68)
23+
#else
2424
#define USB_IRQ USB_IRQn
2525
#endif
2626

@@ -167,7 +167,7 @@ USBHAL::USBHAL(void) {
167167
FCCO = FCLKOUT * 2 * P = 48MHz * 2 * 2 = 192MHz (within FCCO range) */
168168
LPC_SYSCON->USBPLLCTRL = (0x3 | (1UL << 6));
169169

170-
/* Powerup USB PLL */
170+
/* Powerup USB PLL */
171171
LPC_SYSCON->PDRUNCFG &= ~(CLK_USB);
172172

173173
/* Wait for PLL to lock */

libraries/USBDevice/USBDevice/USBHAL_STM32F4.cpp

Lines changed: 9 additions & 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_STM32F4XX)
19+
#if defined(TARGET_STM32F4)
2020

2121
#include "USBHAL.h"
2222
#include "USBRegs_STM32.h"
@@ -48,6 +48,13 @@ USBHAL::USBHAL(void) {
4848
// Enable power and clocking
4949
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
5050

51+
#if defined(TARGET_STM32F407VG)
52+
pin_function(PA_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS));
53+
pin_function(PA_9, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLDOWN, GPIO_AF10_OTG_FS));
54+
pin_function(PA_10, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS));
55+
pin_function(PA_11, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS));
56+
pin_function(PA_12, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS));
57+
#else
5158
pin_function(PA_8, STM_PIN_DATA(2, 10));
5259
pin_function(PA_9, STM_PIN_DATA(0, 0));
5360
pin_function(PA_10, STM_PIN_DATA(2, 10));
@@ -61,6 +68,7 @@ USBHAL::USBHAL(void) {
6168

6269
// Set VBUS pin to open drain
6370
pin_mode(PA_9, OpenDrain);
71+
#endif
6472

6573
RCC->AHB2ENR |= RCC_AHB2ENR_OTGFSEN;
6674

libraries/USBDevice/USBSerial/USBSerial.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ bool USBSerial::EP2_OUT_callback() {
5959
//call a potential handler
6060
rx.call();
6161

62-
// We reactivate the endpoint to receive next characters
63-
readStart(EPBULK_OUT, MAX_PACKET_SIZE_EPBULK);
6462
return true;
6563
}
6664

libraries/fs/fat/MemFileSystem.h

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/* mbed Microcontroller Library - MemFileSystem
2+
* Copyright (c) 2008, sford
3+
*/
4+
5+
6+
#ifndef MBED_MEMFILESYSTEM_H
7+
#define MBED_MEMFILESYSTEM_H
8+
9+
#include "FATFileSystem.h"
10+
11+
namespace mbed
12+
{
13+
14+
class MemFileSystem : public FATFileSystem
15+
{
16+
public:
17+
18+
// 2000 sectors, each 512 bytes (malloced as required)
19+
char *sectors[2000];
20+
21+
MemFileSystem(const char* name) : FATFileSystem(name) {
22+
memset(sectors, 0, sizeof(sectors));
23+
}
24+
25+
virtual ~MemFileSystem() {
26+
for(int i = 0; i < 2000; i++) {
27+
if(sectors[i]) {
28+
free(sectors[i]);
29+
}
30+
}
31+
}
32+
33+
// read a sector in to the buffer, return 0 if ok
34+
virtual int disk_read(char *buffer, int sector) {
35+
if(sectors[sector] == 0) {
36+
// nothing allocated means sector is empty
37+
memset(buffer, 0, 512);
38+
} else {
39+
memcpy(buffer, sectors[sector], 512);
40+
}
41+
return 0;
42+
}
43+
44+
// write a sector from the buffer, return 0 if ok
45+
virtual int disk_write(const char *buffer, int sector) {
46+
// if buffer is zero deallocate sector
47+
char zero[512];
48+
memset(zero, 0, 512);
49+
if(memcmp(zero, buffer, 512)==0) {
50+
if(sectors[sector] != 0) {
51+
free(sectors[sector]);
52+
sectors[sector] = 0;
53+
}
54+
return 0;
55+
}
56+
// else allocate a sector if needed, and write
57+
if(sectors[sector] == 0) {
58+
char *sec = (char*)malloc(512);
59+
if(sec==0) {
60+
return 1; // out of memory
61+
}
62+
sectors[sector] = sec;
63+
}
64+
memcpy(sectors[sector], buffer, 512);
65+
return 0;
66+
}
67+
68+
// return the number of sectors
69+
virtual int disk_sectors() {
70+
return sizeof(sectors)/sizeof(sectors[0]);
71+
}
72+
73+
};
74+
75+
}
76+
77+
#endif

libraries/mbed/api/Ticker.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Ticker : public TimerEvent {
8383
* @param fptr pointer to the function to be called
8484
* @param t the time between calls in micro-seconds
8585
*/
86-
void attach_us(void (*fptr)(void), unsigned int t) {
86+
void attach_us(void (*fptr)(void), timestamp_t t) {
8787
_function.attach(fptr);
8888
setup(t);
8989
}
@@ -95,21 +95,26 @@ class Ticker : public TimerEvent {
9595
* @param t the time between calls in micro-seconds
9696
*/
9797
template<typename T>
98-
void attach_us(T* tptr, void (T::*mptr)(void), unsigned int t) {
98+
void attach_us(T* tptr, void (T::*mptr)(void), timestamp_t t) {
9999
_function.attach(tptr, mptr);
100100
setup(t);
101101
}
102102

103+
virtual ~Ticker() {
104+
detach();
105+
}
106+
103107
/** Detach the function
104108
*/
105109
void detach();
106110

107111
protected:
108-
void setup(unsigned int t);
112+
void setup(timestamp_t t);
109113
virtual void handler();
110114

111-
unsigned int _delay;
112-
FunctionPointer _function;
115+
protected:
116+
timestamp_t _delay; /**< Time delay (in microseconds) for re-setting the multi-shot callback. */
117+
FunctionPointer _function; /**< Callback. */
113118
};
114119

115120
} // namespace mbed

libraries/mbed/api/TimerEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TimerEvent {
3939
virtual void handler() = 0;
4040

4141
// insert in to linked list
42-
void insert(unsigned int timestamp);
42+
void insert(timestamp_t timestamp);
4343

4444
// remove from linked list, if in it
4545
void remove();

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 88
19+
#define MBED_LIBRARY_VERSION 89
2020

2121
#include "platform.h"
2222

0 commit comments

Comments
 (0)