Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: lpc1768-picotcp-demo ZeroMQ_PicoTCP_Publisher_demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test ... more
PicoTCP. Copyright (c) 2013 TASS Belgium NV.
Released under the GNU General Public License, version 2.
Different licensing models may exist, at the sole discretion of the Copyright holders.
Official homepage: http://www.picotcp.com
Bug tracker: https://github.com/tass-belgium/picotcp/issues
Development steps:
initial integration with mbed RTOSgeneric mbed Ethernet driverhigh performance NXP LPC1768 specific Ethernet driverMulti-threading support for mbed RTOSBerkeley sockets and integration with the New Socket APIFork of the apps running on top of the New Socket APIScheduling optimizations- Debugging/benchmarking/testing
Demo application (measuring TCP sender performance):
Import programlpc1768-picotcp-demo
A PicoTCP demo app testing the ethernet throughput on the lpc1768 mbed board.
include/arch/pico_mbed.h@3:b4047e8a0123, 2013-05-24 (annotated)
- Committer:
- daniele
- Date:
- Fri May 24 15:25:25 2013 +0000
- Revision:
- 3:b4047e8a0123
- Child:
- 25:d63125298eb3
- Child:
- 59:31f58acea595
- Child:
- 83:d4e1dcd97346
Updated from main repo + fixed Mutexes;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| daniele | 3:b4047e8a0123 | 1 | /********************************************************************* |
| daniele | 3:b4047e8a0123 | 2 | PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved. |
| daniele | 3:b4047e8a0123 | 3 | See LICENSE and COPYING for usage. |
| daniele | 3:b4047e8a0123 | 4 | Do not redistribute without a written permission by the Copyright |
| daniele | 3:b4047e8a0123 | 5 | holders. |
| daniele | 3:b4047e8a0123 | 6 | |
| daniele | 3:b4047e8a0123 | 7 | File: pico_mbed.h |
| daniele | 3:b4047e8a0123 | 8 | Author: Toon Peters |
| daniele | 3:b4047e8a0123 | 9 | *********************************************************************/ |
| daniele | 3:b4047e8a0123 | 10 | |
| daniele | 3:b4047e8a0123 | 11 | #ifndef PICO_SUPPORT_MBED |
| daniele | 3:b4047e8a0123 | 12 | #define PICO_SUPPORT_MBED |
| daniele | 3:b4047e8a0123 | 13 | |
| daniele | 3:b4047e8a0123 | 14 | //#include "mbed.h" |
| daniele | 3:b4047e8a0123 | 15 | //#include "serial_api.h" |
| daniele | 3:b4047e8a0123 | 16 | |
| daniele | 3:b4047e8a0123 | 17 | /* |
| daniele | 3:b4047e8a0123 | 18 | Debug needs initialization: |
| daniele | 3:b4047e8a0123 | 19 | * void serial_init (serial_t *obj, PinName tx, PinName rx); |
| daniele | 3:b4047e8a0123 | 20 | * void serial_baud (serial_t *obj, int baudrate); |
| daniele | 3:b4047e8a0123 | 21 | * void serial_format (serial_t *obj, int data_bits, SerialParity parity, int stop_bits); |
| daniele | 3:b4047e8a0123 | 22 | */ |
| daniele | 3:b4047e8a0123 | 23 | |
| daniele | 3:b4047e8a0123 | 24 | #define dbg(...) |
| daniele | 3:b4047e8a0123 | 25 | #define pico_zalloc(x) calloc(x, 1) |
| daniele | 3:b4047e8a0123 | 26 | #define pico_free(x) free(x) |
| daniele | 3:b4047e8a0123 | 27 | |
| daniele | 3:b4047e8a0123 | 28 | |
| daniele | 3:b4047e8a0123 | 29 | #define PICO_SUPPORT_MUTEX |
| daniele | 3:b4047e8a0123 | 30 | extern void *pico_mutex_init(void); |
| daniele | 3:b4047e8a0123 | 31 | extern void pico_mutex_lock(void*); |
| daniele | 3:b4047e8a0123 | 32 | extern void pico_mutex_unlock(void*); |
| daniele | 3:b4047e8a0123 | 33 | |
| daniele | 3:b4047e8a0123 | 34 | |
| daniele | 3:b4047e8a0123 | 35 | extern uint32_t os_time; |
| daniele | 3:b4047e8a0123 | 36 | |
| daniele | 3:b4047e8a0123 | 37 | static inline unsigned long PICO_TIME(void) |
| daniele | 3:b4047e8a0123 | 38 | { |
| daniele | 3:b4047e8a0123 | 39 | return (unsigned long)os_time / 1000; |
| daniele | 3:b4047e8a0123 | 40 | } |
| daniele | 3:b4047e8a0123 | 41 | |
| daniele | 3:b4047e8a0123 | 42 | static inline unsigned long PICO_TIME_MS(void) |
| daniele | 3:b4047e8a0123 | 43 | { |
| daniele | 3:b4047e8a0123 | 44 | return (unsigned long)os_time; |
| daniele | 3:b4047e8a0123 | 45 | } |
| daniele | 3:b4047e8a0123 | 46 | |
| daniele | 3:b4047e8a0123 | 47 | static inline void PICO_IDLE(void) |
| daniele | 3:b4047e8a0123 | 48 | { |
| daniele | 3:b4047e8a0123 | 49 | // TODO needs implementation |
| daniele | 3:b4047e8a0123 | 50 | } |
| daniele | 3:b4047e8a0123 | 51 | /* |
| daniele | 3:b4047e8a0123 | 52 | static inline void PICO_DEBUG(const char * formatter, ... ) |
| daniele | 3:b4047e8a0123 | 53 | { |
| daniele | 3:b4047e8a0123 | 54 | char buffer[256]; |
| daniele | 3:b4047e8a0123 | 55 | char *ptr; |
| daniele | 3:b4047e8a0123 | 56 | va_list args; |
| daniele | 3:b4047e8a0123 | 57 | va_start(args, formatter); |
| daniele | 3:b4047e8a0123 | 58 | vsnprintf(buffer, 256, formatter, args); |
| daniele | 3:b4047e8a0123 | 59 | ptr = buffer; |
| daniele | 3:b4047e8a0123 | 60 | while(*ptr != '\0') |
| daniele | 3:b4047e8a0123 | 61 | serial_putc(serial_t *obj, (int) (*(ptr++))); |
| daniele | 3:b4047e8a0123 | 62 | va_end(args); |
| daniele | 3:b4047e8a0123 | 63 | //TODO implement serial_t |
| daniele | 3:b4047e8a0123 | 64 | }*/ |
| daniele | 3:b4047e8a0123 | 65 | |
| daniele | 3:b4047e8a0123 | 66 | #endif |
