mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-25 12:04:47 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d9f8168b8 | ||
|
|
f1d0b451b1 | ||
|
|
ac921d4657 | ||
|
|
f046434f3b | ||
|
|
58b9ee41fa | ||
|
|
d28d7a67f2 | ||
|
|
20370e65d6 | ||
|
|
67626d49c9 | ||
|
|
cd9e179fcb | ||
|
|
0ba28e6153 | ||
|
|
de791765b2 | ||
|
|
e79121acb7 | ||
|
|
4bdec5c1c1 | ||
|
|
fa39d2f2fa | ||
|
|
c55d06ed57 | ||
|
|
3829873552 | ||
|
|
54ebcc5bd8 | ||
|
|
7782500dbb | ||
|
|
86ec6bb2f8 | ||
|
|
02499d672b | ||
|
|
8c2e641ed7 | ||
|
|
29c53082eb | ||
|
|
2fa988fc7b | ||
|
|
72f1d444d3 | ||
|
|
7dcc94202d | ||
|
|
a447ae5eab | ||
|
|
54ad1e4e47 | ||
|
|
39ea91cfc2 | ||
|
|
5ebff5d15e | ||
|
|
731512a947 | ||
|
|
304dbca63d | ||
|
|
18ff0fafe0 | ||
|
|
25de791424 | ||
|
|
6e88c9cfd1 | ||
|
|
9937e88985 | ||
|
|
57f964a139 | ||
|
|
cbd5835112 | ||
|
|
fba32acb73 | ||
|
|
2fdb1f78a2 | ||
|
|
ea2069df51 | ||
|
|
7267fc757d | ||
|
|
ea7d69060d | ||
|
|
6e5e2eb694 | ||
|
|
51466df7b9 | ||
|
|
d6259332d4 | ||
|
|
260229a4d1 | ||
|
|
7776df241c | ||
|
|
e17fdcb077 | ||
|
|
d96629cdf4 | ||
|
|
0c79fcfbd0 | ||
|
|
9125830de6 | ||
|
|
55963d0c9a | ||
|
|
44f7b91826 | ||
|
|
731ea5d50d | ||
|
|
9e517fde00 | ||
|
|
1ff61837ac | ||
|
|
3a8464e4b8 | ||
|
|
39b0b8e2fd | ||
|
|
3a61186491 | ||
|
|
2180e1786c | ||
|
|
8fb5e8ef19 | ||
|
|
a8f54d1851 | ||
|
|
c9721d4d7f | ||
|
|
c848372bbe | ||
|
|
a23daa1547 | ||
|
|
9dba6c806b | ||
|
|
fc635a9340 | ||
|
|
81f738af3f | ||
|
|
f6165d23e4 | ||
|
|
e4a4b6f260 | ||
|
|
0ceee1dc05 | ||
|
|
8a6cf95fad | ||
|
|
37a7031f4e | ||
|
|
8874f3de9d | ||
|
|
3c5d48ea13 | ||
|
|
a0d98b7a39 | ||
|
|
74b75899d3 | ||
|
|
240eca0b68 | ||
|
|
cd54b18de3 | ||
|
|
65e01dbabc | ||
|
|
62276ce63e | ||
|
|
f67fe352cf | ||
|
|
4805797752 | ||
|
|
4c038508f2 | ||
|
|
15db11c0e6 | ||
|
|
97fe505bb4 | ||
|
|
fd45a6d31b | ||
|
|
e1a9ad7f82 | ||
|
|
296affc6e4 | ||
|
|
1889e12b54 | ||
|
|
5e91d919e0 | ||
|
|
5934846852 | ||
|
|
5045dfab74 | ||
|
|
499a7d6a37 | ||
|
|
f72c3fa9a7 | ||
|
|
d0c50632cd | ||
|
|
fffb54e2c6 | ||
|
|
8bf3bd48a6 | ||
|
|
dbe976ad3e | ||
|
|
9a8a6b53ae | ||
|
|
84132b7b2a | ||
|
|
e69a7a1b25 | ||
|
|
7f2bdc217a | ||
|
|
76bb35d5db | ||
|
|
0187f297d1 | ||
|
|
6ff49dc196 | ||
|
|
cd778396ff | ||
|
|
0dcb50d39c | ||
|
|
fd763846e5 | ||
|
|
f4f310cf51 | ||
|
|
0798b72470 | ||
|
|
39a17f8a72 | ||
|
|
78454da3b3 | ||
|
|
e62dc8f3b2 | ||
|
|
e99088348d | ||
|
|
6a12bd7abc | ||
|
|
b39e30fb0c | ||
|
|
92b15395a4 | ||
|
|
7411ff1fca | ||
|
|
f2e7facbc3 | ||
|
|
f1b4f0c463 | ||
|
|
c04e3f80b9 | ||
|
|
717e872fdd | ||
|
|
dbff932d8b | ||
|
|
5c9f463cab | ||
|
|
3a8f47befd | ||
|
|
a3e2a41834 | ||
|
|
b667bd709d | ||
|
|
a4c668e37a | ||
|
|
900bbe724a | ||
|
|
f5a2857620 | ||
|
|
2ef6f7248d | ||
|
|
06b430e57f | ||
|
|
f061dcf8b6 | ||
|
|
99377bdd30 | ||
|
|
c6b5343c9b | ||
|
|
7f4e2a93d0 | ||
|
|
c151f9bc59 | ||
|
|
204bf9acec | ||
|
|
e3bac87016 | ||
|
|
1f09505248 | ||
|
|
7f99013179 | ||
|
|
8d72c2a7b2 | ||
|
|
c722cfec18 | ||
|
|
835af2cae1 | ||
|
|
bd2a4097b2 | ||
|
|
fcc75c6a3f | ||
|
|
e08b234326 | ||
|
|
5bd3df7a0f | ||
|
|
5bbf24bf41 | ||
|
|
ace1dc53b2 | ||
|
|
100480a1d5 | ||
|
|
a89a2df603 | ||
|
|
988ad66a12 | ||
|
|
85d6292b8f | ||
|
|
98ab0950c9 | ||
|
|
a7f9043072 | ||
|
|
6d8b747ff2 | ||
|
|
a17eae4142 | ||
|
|
7b05d70042 | ||
|
|
f328907da4 | ||
|
|
1cea7ba487 | ||
|
|
6848452149 | ||
|
|
f9a1d47f13 | ||
|
|
492dcdca8d | ||
|
|
4ef3a778c1 | ||
|
|
31c5ef1bc3 | ||
|
|
4656e7b0dd | ||
|
|
4216cf2ac1 | ||
|
|
37e4f51668 | ||
|
|
1dae0373c8 | ||
|
|
e928f36456 | ||
|
|
fcb94a1742 | ||
|
|
8ff010ca0f | ||
|
|
241090a82b | ||
|
|
618bef0eb2 | ||
|
|
3b69f5d500 | ||
|
|
b298d46a40 | ||
|
|
75059d1bdc | ||
|
|
15e9a92798 | ||
|
|
bafc30bec6 |
No files matched your search
@@ -5,33 +5,27 @@
|
||||
Mongoose is ideal for embedded environments. It has been designed
|
||||
for connecting devices and bringing them online. On the market since 2004,
|
||||
used by vast number of open source and
|
||||
commercial products - it even runs on space stations!
|
||||
commercial products - it even runs on the International Space station!
|
||||
Mongoose makes embedded network programming fast, robust, and easy.
|
||||
|
||||
If you're looking for a pre-compiled Windows or Mac binary,
|
||||
- [Download pre-compiled Mongoose web server binary](https://www.cesanta.com/products/binary)
|
||||
- [Download Mongoose Source Code here](https://www.cesanta.com)
|
||||
|
||||
Alternatively,
|
||||
Looking for a complete IoT firmware solution?
|
||||
|
||||
- [Download Mongoose Source Code here](http://hubs.ly/H01bWvx0)
|
||||
- [Check our latest releases] (https://github.com/cesanta/mongoose/releases)
|
||||
- [Read User Guide and API reference](https://docs.cesanta.com/mongoose/dev)
|
||||
- [Study mongoose example code](https://github.com/cesanta/mongoose/tree/master/examples)
|
||||
|
||||
If you are looking for a complete solution with firmware and cloud components, check out [Mongoose IoT Platform](https://github.com/cesanta/mongoose-iot).
|
||||
Check out [Mongoose OS](https://mongoose-iot.com) - open source embedded operating system for low-power connected microcontrollers. Secure, designed for Internet of Things, complete environment for prototyping, development and managing.
|
||||
|
||||
# Support
|
||||
- [Support Forum - Ask your technical questions here] (http://forum.cesanta.com/index.php?p=/categories/mongoose)
|
||||
- [Chat - Visit www.cesanta.com for our live chat] (http://www.cesanta.com)
|
||||
- [Commercial one-to-one support - Available to all commercial license holders] (https://www.cesanta.com/services-support)
|
||||
- [Study mongoose example code](https://github.com/cesanta/mongoose/tree/master/examples)
|
||||
- [Read User Guide and API reference](https://docs.cesanta.com/mongoose)
|
||||
- [Support Forum - ask your technical questions here] (http://forum.cesanta.com/index.php?p=/categories/mongoose)
|
||||
- [Commercial licensing and support available] (https://www.cesanta.com/services-support)
|
||||
- [Check our latest releases] (https://github.com/cesanta/mongoose/releases)
|
||||
|
||||
# Features
|
||||
|
||||
* Cross-platform: works on Linux/UNIX, MacOS, QNX, eCos, Windows, Android,
|
||||
iPhone, FreeRTOS (TI CC3200, ESP8266), etc
|
||||
* Single-threaded, asynchronous, non-blocking core with simple event-based API
|
||||
* Native support for [PicoTCP embedded TCP/IP stack](http://www.picotcp.com),
|
||||
[LWIP embedded TCP/IP stack](https://en.wikipedia.org/wiki/LwIP)
|
||||
* Supported hardware platforms: TI CC3200, TI MSP432, NRF52, STM32, PIC32, ESP8266, ESP32 and more
|
||||
* Builtin protocols:
|
||||
- plain TCP, plain UDP, SSL/TLS (over TCP, one-way or two-way)
|
||||
- HTTP client, HTTP server
|
||||
@@ -39,6 +33,9 @@ If you are looking for a complete solution with firmware and cloud components, c
|
||||
- MQTT client, MQTT broker
|
||||
- CoAP client, CoAP server
|
||||
- DNS client, DNS server, async DNS resolver
|
||||
* Single-threaded, asynchronous, non-blocking core with simple event-based API
|
||||
* Native support for [PicoTCP embedded TCP/IP stack](http://www.picotcp.com),
|
||||
[LWIP embedded TCP/IP stack](https://en.wikipedia.org/wiki/LwIP)
|
||||
* Tiny static and run-time footprint
|
||||
* Source code is both ISO C and ISO C++ compliant
|
||||
* Very easy to integrate: just copy
|
||||
@@ -48,13 +45,9 @@ If you are looking for a complete solution with firmware and cloud components, c
|
||||
|
||||
# Licensing
|
||||
|
||||
Mongoose is released under commercial and [GNU GPL v.2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) open source licenses.
|
||||
Mongoose is released under Commercial and [GNU GPL v.2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) open source licenses.
|
||||
|
||||
Commercial Projects:
|
||||
Once your project becomes commercialised GPLv2 licensing dictates that you need to either open your source fully or purchase a commercial license. Cesanta offer full, royalty-free commercial licenses without any GPL restrictions. If your needs require a custom license, we’d be happy to work on a solution with you. [Contact us for pricing.] (https://www.cesanta.com/contact)
|
||||
|
||||
Prototyping:
|
||||
While your project is still in prototyping stage and not for sale, you can use Mongoose’s open source code without license restrictions.
|
||||
Commercial Projects: [Contact us for commercial license.] (https://www.cesanta.com/contact)
|
||||
|
||||
# Dashboard Example
|
||||
|
||||
@@ -64,7 +57,7 @@ the functionality:
|
||||
|
||||

|
||||
|
||||
[Developing a new product? Contact us today to discuss how Mongoose can help
|
||||
[Developing a new product? Contact us today to discuss how Mongoose can help.
|
||||
](https://www.cesanta.com/contact)
|
||||
|
||||
# Contributions
|
||||
@@ -73,8 +66,7 @@ To submit contributions, sign
|
||||
[Cesanta CLA](https://docs.cesanta.com/contributors_la.shtml)
|
||||
and send GitHub pull request. You retain the copyright on your contributions.
|
||||
|
||||
## Working with the Source Code
|
||||
|
||||
See [tools](https://github.com/cesanta/mongoose/tree/master/tools) directory.
|
||||
# Looking for a pre-compiled Mongoose web server Windows or Mac binary?
|
||||
- [Download pre-compiled Mongoose web server binary.](https://www.cesanta.com/products/binary)
|
||||
|
||||
[](https://github.com/cesanta/mongoose)
|
||||
@@ -3,15 +3,15 @@ title: "CoAP API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "coap.h"
|
||||
items:
|
||||
- { name: mg_set_protocol_coap.md }
|
||||
- { name: mg_coap_add_option.md }
|
||||
- { name: mg_coap_free_options.md }
|
||||
- { name: mg_coap_send_message.md }
|
||||
- { name: mg_coap_send_ack.md }
|
||||
- { name: mg_coap_parse.md }
|
||||
- { name: mg_coap_compose.md }
|
||||
- { name: struct_mg_coap_option.md }
|
||||
- { name: mg_coap_free_options.md }
|
||||
- { name: mg_coap_parse.md }
|
||||
- { name: mg_coap_send_ack.md }
|
||||
- { name: mg_coap_send_message.md }
|
||||
- { name: mg_set_protocol_coap.md }
|
||||
- { name: struct_mg_coap_message.md }
|
||||
- { name: struct_mg_coap_option.md }
|
||||
---
|
||||
|
||||
CoAP message format:
|
||||
|
||||
@@ -9,5 +9,6 @@ signature: |
|
||||
---
|
||||
|
||||
Adds a new option to mg_coap_message structure.
|
||||
Returns pointer to the newly created option.
|
||||
Returns pointer to the newly created option.
|
||||
Note: options must be freed by using mg_coap_free_options
|
||||
|
||||
@@ -3,17 +3,17 @@ title: "DNS API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "dns.h"
|
||||
items:
|
||||
- { name: mg_dns_parse_record_data.md }
|
||||
- { name: mg_send_dns_query.md }
|
||||
- { name: mg_dns_insert_header.md }
|
||||
- { name: mg_dns_copy_questions.md }
|
||||
- { name: mg_dns_encode_record.md }
|
||||
- { name: mg_dns_encode_name.md }
|
||||
- { name: mg_parse_dns.md }
|
||||
- { name: mg_dns_encode_record.md }
|
||||
- { name: mg_dns_insert_header.md }
|
||||
- { name: mg_dns_parse_record_data.md }
|
||||
- { name: mg_dns_uncompress_name.md }
|
||||
- { name: mg_parse_dns.md }
|
||||
- { name: mg_send_dns_query.md }
|
||||
- { name: mg_set_protocol_dns.md }
|
||||
- { name: struct_mg_dns_resource_record.md }
|
||||
- { name: struct_mg_dns_message.md }
|
||||
- { name: struct_mg_dns_resource_record.md }
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -3,19 +3,20 @@ title: "Common API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "http.h"
|
||||
items:
|
||||
- { name: mg_set_protocol_http_websocket.md }
|
||||
- { name: mg_send_websocket_handshake.md }
|
||||
- { name: mg_send_websocket_handshake2.md }
|
||||
- { name: mg_connect_ws.md }
|
||||
- { name: mg_connect_ws_opt.md }
|
||||
- { name: mg_printf_websocket_frame.md }
|
||||
- { name: mg_send_websocket_frame.md }
|
||||
- { name: mg_send_websocket_framev.md }
|
||||
- { name: mg_printf_websocket_frame.md }
|
||||
- { name: mg_send_websocket_handshake.md }
|
||||
- { name: mg_send_websocket_handshake2.md }
|
||||
- { name: mg_send_websocket_handshake3.md }
|
||||
- { name: mg_set_protocol_http_websocket.md }
|
||||
- { name: mg_url_decode.md }
|
||||
- { name: struct_http_message.md }
|
||||
- { name: struct_websocket_message.md }
|
||||
- { name: struct_mg_http_multipart_part.md }
|
||||
- { name: struct_mg_ssi_call_ctx.md }
|
||||
- { name: struct_websocket_message.md }
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "mg_send_websocket_handshake3()"
|
||||
decl_name: "mg_send_websocket_handshake3"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_send_websocket_handshake3(struct mg_connection *nc, const char *path,
|
||||
const char *host, const char *protocol,
|
||||
const char *extra_headers, const char *user,
|
||||
const char *pass);
|
||||
---
|
||||
|
||||
Like mg_send_websocket_handshake2 but also passes basic auth header
|
||||
|
||||
@@ -12,11 +12,6 @@ The user-defined event handler will receive following extra events:
|
||||
- MG_EV_HTTP_REQUEST: HTTP request has arrived. Parsed HTTP request
|
||||
is passed as
|
||||
`struct http_message` through the handler's `void *ev_data` pointer.
|
||||
- MG_EV_HTTP_MULTIPART_REQUEST: A multipart POST request has received.
|
||||
This event is sent before body is parsed. After this, the user
|
||||
should expect a sequence of MG_EV_HTTP_PART_BEGIN/DATA/END requests.
|
||||
This is also the last time when headers and other request fields are
|
||||
accessible.
|
||||
- MG_EV_HTTP_REPLY: The HTTP reply has arrived. The parsed HTTP reply is
|
||||
passed as `struct http_message` through the handler's `void *ev_data`
|
||||
pointer.
|
||||
@@ -38,14 +33,27 @@ The user-defined event handler will receive following extra events:
|
||||
handshake. `ev_data` is `NULL`.
|
||||
- MG_EV_WEBSOCKET_FRAME: new WebSocket frame has arrived. `ev_data` is
|
||||
`struct websocket_message *`
|
||||
- MG_EV_HTTP_PART_BEGIN: new part of multipart message is started,
|
||||
extra parameters are passed in mg_http_multipart_part
|
||||
- MG_EV_HTTP_PART_DATA: new portion of data from the multiparted message
|
||||
no additional headers are available, only data and data size
|
||||
- MG_EV_HTTP_PART_END: final boundary received, analogue to maybe used to
|
||||
find the end of packet
|
||||
Note: Mongoose should be compiled with MG_ENABLE_HTTP_STREAMING_MULTIPART
|
||||
to enable MG_EV_HTTP_MULTIPART_REQUEST, MG_EV_HTTP_REQUEST_END,
|
||||
MG_EV_HTTP_REQUEST_CANCEL, MG_EV_HTTP_PART_BEGIN, MG_EV_HTTP_PART_DATA,
|
||||
MG_EV_HTTP_PART_END constants
|
||||
|
||||
When compiled with MG_ENABLE_HTTP_STREAMING_MULTIPART, Mongoose parses
|
||||
multipart requests and splits them into separate events:
|
||||
- MG_EV_HTTP_MULTIPART_REQUEST: Start of the request.
|
||||
This event is sent before body is parsed. After this, the user
|
||||
should expect a sequence of PART_BEGIN/DATA/END requests.
|
||||
This is also the last time when headers and other request fields are
|
||||
accessible.
|
||||
- MG_EV_HTTP_PART_BEGIN: Start of a part of a multipart message.
|
||||
Argument: mg_http_multipart_part with var_name and file_name set
|
||||
(if present). No data is passed in this message.
|
||||
- MG_EV_HTTP_PART_DATA: new portion of data from the multipart message.
|
||||
Argument: mg_http_multipart_part. var_name and file_name are preserved,
|
||||
data is available in mg_http_multipart_part.data.
|
||||
- MG_EV_HTTP_PART_END: End of the current part. var_name, file_name are
|
||||
the same, no data in the message. If status is 0, then the part is
|
||||
properly terminated with a boundary, status < 0 means that connection
|
||||
was terminated.
|
||||
- MG_EV_HTTP_MULTIPART_REQUEST_END: End of the multipart request.
|
||||
Argument: mg_http_multipart_part, var_name and file_name are NULL,
|
||||
status = 0 means request was properly closed, < 0 means connection
|
||||
was terminated (note: in this case both PART_END and REQUEST_END are
|
||||
delivered).
|
||||
|
||||
@@ -3,22 +3,26 @@ title: "Server API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "http_server.h"
|
||||
items:
|
||||
- { name: mg_parse_http.md }
|
||||
- { name: mg_get_http_header.md }
|
||||
- { name: mg_http_parse_header.md }
|
||||
- { name: mg_parse_multipart.md }
|
||||
- { name: mg_get_http_var.md }
|
||||
- { name: mg_serve_http.md }
|
||||
- { name: mg_http_serve_file.md }
|
||||
- { name: mg_register_http_endpoint.md }
|
||||
- { name: mg_file_upload_handler.md }
|
||||
- { name: mg_get_http_basic_auth.md }
|
||||
- { name: mg_get_http_header.md }
|
||||
- { name: mg_get_http_var.md }
|
||||
- { name: mg_http_check_digest_auth.md }
|
||||
- { name: mg_send_http_chunk.md }
|
||||
- { name: mg_printf_http_chunk.md }
|
||||
- { name: mg_send_response_line.md }
|
||||
- { name: mg_http_parse_header.md }
|
||||
- { name: mg_http_reverse_proxy.md }
|
||||
- { name: mg_http_send_error.md }
|
||||
- { name: mg_http_send_redirect.md }
|
||||
- { name: mg_send_head.md }
|
||||
- { name: mg_http_serve_file.md }
|
||||
- { name: mg_parse_http.md }
|
||||
- { name: mg_parse_http_basic_auth.md }
|
||||
- { name: mg_parse_multipart.md }
|
||||
- { name: mg_printf_html_escape.md }
|
||||
- { name: mg_printf_http_chunk.md }
|
||||
- { name: mg_register_http_endpoint.md }
|
||||
- { name: mg_send_head.md }
|
||||
- { name: mg_send_http_chunk.md }
|
||||
- { name: mg_send_response_line.md }
|
||||
- { name: mg_serve_http.md }
|
||||
- { name: mg_fu_fname_fn.md }
|
||||
- { name: struct_mg_serve_http_opts.md }
|
||||
---
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "mg_get_http_basic_auth()"
|
||||
decl_name: "mg_get_http_basic_auth"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_get_http_basic_auth(struct http_message *hm, char *user, size_t user_len,
|
||||
char *pass, size_t pass_len);
|
||||
---
|
||||
|
||||
Gets and parses the Authorization: Basic header
|
||||
Returns -1 if no Authorization header is found, or if
|
||||
mg_parse_http_basic_auth
|
||||
fails parsing the resulting header.
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "mg_http_reverse_proxy()"
|
||||
decl_name: "mg_http_reverse_proxy"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_http_reverse_proxy(struct mg_connection *nc,
|
||||
const struct http_message *hm, struct mg_str mount,
|
||||
struct mg_str upstream);
|
||||
---
|
||||
|
||||
Proxies a given request to a given upstream http server. The path prefix
|
||||
in `mount` will be stripped of the path requested to the upstream server,
|
||||
e.g. if mount is /api and upstream is http://localhost:8001/foo
|
||||
then an incoming request to /api/bar will cause a request to
|
||||
http://localhost:8001/foo/bar
|
||||
|
||||
EXPERIMENTAL API. Please use http_serve_http + url_rewrites if a static
|
||||
mapping is good enough.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: "mg_http_send_error()"
|
||||
decl_name: "mg_http_send_error"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_http_send_error(struct mg_connection *nc, int code, const char *reason);
|
||||
---
|
||||
|
||||
Sends an error response. If reason is NULL, the message will be inferred
|
||||
from the error code (if supported).
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "mg_parse_http_basic_auth()"
|
||||
decl_name: "mg_parse_http_basic_auth"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_parse_http_basic_auth(struct mg_str *hdr, char *user, size_t user_len,
|
||||
char *pass, size_t pass_len);
|
||||
---
|
||||
|
||||
Parses the Authorization: Basic header
|
||||
Returns -1 iif the authorization type is not "Basic" or any other error such
|
||||
as incorrectly encoded base64 user password pair.
|
||||
|
||||
@@ -100,16 +100,19 @@ signature: |
|
||||
/* IP ACL. By default, NULL, meaning all IPs are allowed to connect */
|
||||
const char *ip_acl;
|
||||
|
||||
#if MG_ENABLE_HTTP_URL_REWRITES
|
||||
/* URL rewrites.
|
||||
*
|
||||
* Comma-separated list of `uri_pattern=file_or_directory_path` rewrites.
|
||||
* Comma-separated list of `uri_pattern=url_file_or_directory_path` rewrites.
|
||||
* When HTTP request is received, Mongoose constructs a file name from the
|
||||
* requested URI by combining `document_root` and the URI. However, if the
|
||||
* rewrite option is used and `uri_pattern` matches requested URI, then
|
||||
* `document_root` is ignored. Instead, `file_or_directory_path` is used,
|
||||
* `document_root` is ignored. Instead, `url_file_or_directory_path` is used,
|
||||
* which should be a full path name or a path relative to the web server's
|
||||
* current working directory. Note that `uri_pattern`, as all Mongoose
|
||||
* patterns, is a prefix pattern.
|
||||
* current working directory. It can also be an URI (http:// or https://)
|
||||
* in which case mongoose will behave as a reverse proxy for that destination.
|
||||
*
|
||||
* Note that `uri_pattern`, as all Mongoose patterns, is a prefix pattern.
|
||||
*
|
||||
* If uri_pattern starts with `@` symbol, then Mongoose compares it with the
|
||||
* HOST header of the request. If they are equal, Mongoose sets document root
|
||||
@@ -123,6 +126,7 @@ signature: |
|
||||
* automatically appended to the redirect location.
|
||||
*/
|
||||
const char *url_rewrites;
|
||||
#endif
|
||||
|
||||
/* DAV document root. If NULL, DAV requests are going to fail. */
|
||||
const char *dav_document_root;
|
||||
|
||||
@@ -3,9 +3,9 @@ title: "Memory Buffers"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "mbuf.h"
|
||||
items:
|
||||
- { name: mbuf_init.md }
|
||||
- { name: mbuf_free.md }
|
||||
- { name: mbuf_append.md }
|
||||
- { name: mbuf_free.md }
|
||||
- { name: mbuf_init.md }
|
||||
- { name: mbuf_insert.md }
|
||||
- { name: mbuf_remove.md }
|
||||
- { name: mbuf_resize.md }
|
||||
|
||||
+15
-15
@@ -3,24 +3,24 @@ title: "MQTT API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "mqtt.h"
|
||||
items:
|
||||
- { name: mg_set_protocol_mqtt.md }
|
||||
- { name: mg_send_mqtt_handshake.md }
|
||||
- { name: mg_send_mqtt_handshake_opt.md }
|
||||
- { name: mg_mqtt_publish.md }
|
||||
- { name: mg_mqtt_subscribe.md }
|
||||
- { name: mg_mqtt_unsubscribe.md }
|
||||
- { name: mg_mqtt_disconnect.md }
|
||||
- { name: mg_mqtt_connack.md }
|
||||
- { name: mg_mqtt_puback.md }
|
||||
- { name: mg_mqtt_pubrec.md }
|
||||
- { name: mg_mqtt_pubrel.md }
|
||||
- { name: mg_mqtt_pubcomp.md }
|
||||
- { name: mg_mqtt_suback.md }
|
||||
- { name: mg_mqtt_unsuback.md }
|
||||
- { name: mg_mqtt_disconnect.md }
|
||||
- { name: mg_mqtt_next_subscribe_topic.md }
|
||||
- { name: mg_mqtt_ping.md }
|
||||
- { name: mg_mqtt_pong.md }
|
||||
- { name: mg_mqtt_next_subscribe_topic.md }
|
||||
- { name: struct_mg_mqtt_topic_expression.md }
|
||||
- { name: mg_mqtt_puback.md }
|
||||
- { name: mg_mqtt_pubcomp.md }
|
||||
- { name: mg_mqtt_publish.md }
|
||||
- { name: mg_mqtt_pubrec.md }
|
||||
- { name: mg_mqtt_pubrel.md }
|
||||
- { name: mg_mqtt_suback.md }
|
||||
- { name: mg_mqtt_subscribe.md }
|
||||
- { name: mg_mqtt_unsuback.md }
|
||||
- { name: mg_mqtt_unsubscribe.md }
|
||||
- { name: mg_send_mqtt_handshake.md }
|
||||
- { name: mg_send_mqtt_handshake_opt.md }
|
||||
- { name: mg_set_protocol_mqtt.md }
|
||||
- { name: struct_mg_mqtt_proto_data.md }
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "struct mg_mqtt_proto_data"
|
||||
decl_name: "struct mg_mqtt_proto_data"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_mqtt_proto_data {
|
||||
uint16_t keep_alive;
|
||||
};
|
||||
---
|
||||
|
||||
mg_mqtt_proto_data should be in header to allow external access to it
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
title: "struct mg_mqtt_topic_expression"
|
||||
decl_name: "struct mg_mqtt_topic_expression"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_mqtt_topic_expression {
|
||||
const char *topic;
|
||||
uint8_t qos;
|
||||
};
|
||||
---
|
||||
|
||||
puback
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "LIST_ENTRY()"
|
||||
decl_name: "LIST_ENTRY"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
LIST_ENTRY(mg_mqtt_session);
|
||||
---
|
||||
|
||||
Broker
|
||||
|
||||
@@ -3,11 +3,9 @@ title: "MQTT Server API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "mqtt_server.h"
|
||||
items:
|
||||
- { name: mg_mqtt_broker_init.md }
|
||||
- { name: mg_mqtt_broker.md }
|
||||
- { name: mg_mqtt_next.md }
|
||||
- { name: struct_mg_mqtt_session.md }
|
||||
- { name: LIST_ENTRY.md }
|
||||
- { name: struct_mg_mqtt_broker.md }
|
||||
- { name: struct_mg_mqtt_session.md }
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
title: "mg_mqtt_broker()"
|
||||
decl_name: "mg_mqtt_broker"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_mqtt_broker(struct mg_connection *brk, int ev, void *data);
|
||||
---
|
||||
|
||||
Processes a MQTT broker message.
|
||||
|
||||
The listening connection expects a pointer to an initialised
|
||||
`mg_mqtt_broker` structure in the `user_data` field.
|
||||
|
||||
Basic usage:
|
||||
|
||||
```c
|
||||
mg_mqtt_broker_init(&brk, NULL);
|
||||
|
||||
if ((nc = mg_bind(&mgr, address, mg_mqtt_broker)) == NULL) {
|
||||
// fail;
|
||||
}
|
||||
nc->user_data = &brk;
|
||||
```
|
||||
|
||||
New incoming connections will receive a `mg_mqtt_session` structure
|
||||
in the connection `user_data`. The original `user_data` will be stored
|
||||
in the `user_data` field of the session structure. This allows the user
|
||||
handler to store user data before `mg_mqtt_broker` creates the session.
|
||||
|
||||
Since only the MG_EV_ACCEPT message is processed by the listening socket,
|
||||
for most events the `user_data` will thus point to a `mg_mqtt_session`.
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: "mg_mqtt_broker_init()"
|
||||
decl_name: "mg_mqtt_broker_init"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_mqtt_broker_init(struct mg_mqtt_broker *brk, void *user_data);
|
||||
---
|
||||
|
||||
Initialises a MQTT broker.
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
title: "mg_mqtt_next()"
|
||||
decl_name: "mg_mqtt_next"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
struct mg_mqtt_session *mg_mqtt_next(struct mg_mqtt_broker *brk,
|
||||
struct mg_mqtt_session *s);
|
||||
---
|
||||
|
||||
Iterates over all MQTT session connections. Example:
|
||||
|
||||
```c
|
||||
struct mg_mqtt_session *s;
|
||||
for (s = mg_mqtt_next(brk, NULL); s != NULL; s = mg_mqtt_next(brk, s)) {
|
||||
// Do something
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,8 +4,8 @@ decl_name: "struct mg_mqtt_broker"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_mqtt_broker {
|
||||
struct mg_mqtt_session *sessions; /* Session list */
|
||||
void *user_data; /* User data */
|
||||
LIST_HEAD(_mg_sesshead, mg_mqtt_session) sessions; /* Session list */
|
||||
void *user_data; /* User data */
|
||||
};
|
||||
---
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ decl_name: "struct mg_mqtt_session"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_mqtt_session {
|
||||
struct mg_mqtt_broker *brk; /* Broker */
|
||||
struct mg_mqtt_session *next, *prev; /* mg_mqtt_broker::sessions linkage */
|
||||
struct mg_connection *nc; /* Connection with the client */
|
||||
size_t num_subscriptions; /* Size of `subscriptions` array */
|
||||
struct mg_mqtt_broker *brk; /* Broker */
|
||||
LIST_ENTRY(mg_mqtt_session) link; /* mg_mqtt_broker::sessions linkage */
|
||||
struct mg_connection *nc; /* Connection with the client */
|
||||
size_t num_subscriptions; /* Size of `subscriptions` array */
|
||||
void *user_data; /* User data */
|
||||
struct mg_mqtt_topic_expression *subscriptions;
|
||||
void *user_data; /* User data */
|
||||
};
|
||||
---
|
||||
|
||||
|
||||
+17
-14
@@ -3,33 +3,36 @@ title: "Core API: TCP/UDP/SSL"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "net.h"
|
||||
items:
|
||||
- { name: mg_mgr_init.md }
|
||||
- { name: mg_mgr_free.md }
|
||||
- { name: mg_mgr_poll.md }
|
||||
- { name: mg_broadcast.md }
|
||||
- { name: mg_next.md }
|
||||
- { name: mg_add_sock.md }
|
||||
- { name: mg_add_sock_opt.md }
|
||||
- { name: mg_bind.md }
|
||||
- { name: mg_bind_opt.md }
|
||||
- { name: mg_broadcast.md }
|
||||
- { name: mg_check_ip_acl.md }
|
||||
- { name: mg_connect.md }
|
||||
- { name: mg_connect_opt.md }
|
||||
- { name: mg_set_ssl.md }
|
||||
- { name: mg_send.md }
|
||||
- { name: mg_printf.md }
|
||||
- { name: mg_vprintf.md }
|
||||
- { name: mg_socketpair.md }
|
||||
- { name: mg_check_ip_acl.md }
|
||||
- { name: mg_enable_multithreading.md }
|
||||
- { name: mg_enable_javascript.md }
|
||||
- { name: mg_enable_multithreading.md }
|
||||
- { name: mg_mgr_free.md }
|
||||
- { name: mg_mgr_init.md }
|
||||
- { name: mg_mgr_init_opt.md }
|
||||
- { name: mg_mgr_poll.md }
|
||||
- { name: mg_next.md }
|
||||
- { name: mg_printf.md }
|
||||
- { name: mg_resolve.md }
|
||||
- { name: mg_send.md }
|
||||
- { name: mg_set_ssl.md }
|
||||
- { name: mg_set_timer.md }
|
||||
- { name: mg_socketpair.md }
|
||||
- { name: mg_time.md }
|
||||
- { name: mg_vprintf.md }
|
||||
- { name: mg_event_handler_t.md }
|
||||
- { name: struct_mg_mgr.md }
|
||||
- { name: struct_mg_connection.md }
|
||||
- { name: struct_mg_add_sock_opts.md }
|
||||
- { name: struct_mg_bind_opts.md }
|
||||
- { name: struct_mg_connect_opts.md }
|
||||
- { name: struct_mg_connection.md }
|
||||
- { name: struct_mg_mgr.md }
|
||||
- { name: struct_mg_mgr_init_opts.md }
|
||||
- { name: struct_mg_multithreading_opts.md }
|
||||
---
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ title: "mg_event_handler_t"
|
||||
decl_name: "mg_event_handler_t"
|
||||
symbol_kind: "typedef"
|
||||
signature: |
|
||||
typedef void (*mg_event_handler_t)(struct mg_connection *, int ev, void *);
|
||||
typedef void (*mg_event_handler_t)(struct mg_connection *nc, int ev,
|
||||
void *ev_data);
|
||||
---
|
||||
|
||||
Callback function (event handler) prototype. Must be defined by the user.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "mg_mgr_init_opt()"
|
||||
decl_name: "mg_mgr_init_opt"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_mgr_init_opt(struct mg_mgr *mgr, void *user_data,
|
||||
struct mg_mgr_init_opts opts);
|
||||
---
|
||||
|
||||
Like `mg_mgr_init` but with more options.
|
||||
|
||||
Notably, this allows you to create a manger and choose
|
||||
dynamically which networking interface implementation to use.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "mg_resolve()"
|
||||
decl_name: "mg_resolve"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_resolve(const char *domain_name, char *ip_addr_buf, size_t buf_len);
|
||||
---
|
||||
|
||||
Convert domain name into IP address.
|
||||
|
||||
This is a utility function. If compilation flags have
|
||||
`-DMG_ENABLE_GETADDRINFO`, then `getaddrinfo()` call is used for name
|
||||
resolution. Otherwise, `gethostbyname()` is used.
|
||||
|
||||
CAUTION: this function can block.
|
||||
Return 1 on success, 0 on failure.
|
||||
|
||||
@@ -7,6 +7,7 @@ signature: |
|
||||
void *user_data; /* Initial value for connection's user_data */
|
||||
unsigned int flags; /* Initial connection flags */
|
||||
const char **error_string; /* Placeholder for the error string */
|
||||
struct mg_iface *iface; /* Interface instance */
|
||||
};
|
||||
---
|
||||
|
||||
|
||||
@@ -7,13 +7,32 @@ signature: |
|
||||
void *user_data; /* Initial value for connection's user_data */
|
||||
unsigned int flags; /* Extra connection flags */
|
||||
const char **error_string; /* Placeholder for the error string */
|
||||
#ifdef MG_ENABLE_SSL
|
||||
/* SSL settings. */
|
||||
const char *ssl_cert; /* Server certificate to present to clients */
|
||||
const char *ssl_key; /* Private key corresponding to the certificate.
|
||||
If ssl_cert is set but ssl_key is not, ssl_cert
|
||||
is used. */
|
||||
const char *ssl_ca_cert; /* Verify client certificates with this CA bundle */
|
||||
struct mg_iface *iface; /* Interface instance */
|
||||
#if MG_ENABLE_SSL
|
||||
/*
|
||||
* SSL settings.
|
||||
*
|
||||
* Server certificate to present to clients or client certificate to
|
||||
* present to tunnel dispatcher (for tunneled connections).
|
||||
*/
|
||||
const char *ssl_cert;
|
||||
/* Private key corresponding to the certificate. If ssl_cert is set but
|
||||
* ssl_key is not, ssl_cert is used. */
|
||||
const char *ssl_key;
|
||||
/* CA bundle used to verify client certificates or tunnel dispatchers. */
|
||||
const char *ssl_ca_cert;
|
||||
/* Colon-delimited list of acceptable cipher suites.
|
||||
* Names depend on the library used, for example:
|
||||
*
|
||||
* ECDH-ECDSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256 (OpenSSL)
|
||||
* TLS-ECDH-ECDSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256
|
||||
* (mbedTLS)
|
||||
*
|
||||
* For OpenSSL the list can be obtained by running "openssl ciphers".
|
||||
* For mbedTLS, names can be found in library/ssl_ciphersuites.c
|
||||
* If NULL, a reasonable default is used.
|
||||
*/
|
||||
const char *ssl_cipher_suites;
|
||||
#endif
|
||||
};
|
||||
---
|
||||
|
||||
@@ -7,16 +7,35 @@ signature: |
|
||||
void *user_data; /* Initial value for connection's user_data */
|
||||
unsigned int flags; /* Extra connection flags */
|
||||
const char **error_string; /* Placeholder for the error string */
|
||||
#ifdef MG_ENABLE_SSL
|
||||
/* SSL settings. */
|
||||
const char *ssl_cert; /* Client certificate to present to the server */
|
||||
const char *ssl_key; /* Private key corresponding to the certificate.
|
||||
If ssl_cert is set but ssl_key is not, ssl_cert
|
||||
is used. */
|
||||
const char *ssl_ca_cert; /* Verify server certificate using this CA bundle.
|
||||
If set to "*", then SSL is enabled but no cert
|
||||
verification is performed. */
|
||||
|
||||
struct mg_iface *iface; /* Interface instance */
|
||||
#if MG_ENABLE_SSL
|
||||
/*
|
||||
* SSL settings.
|
||||
* Client certificate to present to the server.
|
||||
*/
|
||||
const char *ssl_cert;
|
||||
/*
|
||||
* Private key corresponding to the certificate.
|
||||
* If ssl_cert is set but ssl_key is not, ssl_cert is used.
|
||||
*/
|
||||
const char *ssl_key;
|
||||
/*
|
||||
* Verify server certificate using this CA bundle. If set to "*", then SSL
|
||||
* is enabled but no cert verification is performed.
|
||||
*/
|
||||
const char *ssl_ca_cert;
|
||||
/* Colon-delimited list of acceptable cipher suites.
|
||||
* Names depend on the library used, for example:
|
||||
*
|
||||
* ECDH-ECDSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256 (OpenSSL)
|
||||
* TLS-ECDH-ECDSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256
|
||||
* (mbedTLS)
|
||||
*
|
||||
* For OpenSSL the list can be obtained by running "openssl ciphers".
|
||||
* For mbedTLS, names can be found in library/ssl_ciphersuites.c
|
||||
* If NULL, a reasonable default is used.
|
||||
*/
|
||||
const char *ssl_cipher_suites;
|
||||
/*
|
||||
* Server name verification. If ssl_ca_cert is set and the certificate has
|
||||
* passed verification, its subject will be verified against this string.
|
||||
|
||||
@@ -14,19 +14,11 @@ signature: |
|
||||
size_t recv_mbuf_limit; /* Max size of recv buffer */
|
||||
struct mbuf recv_mbuf; /* Received data */
|
||||
struct mbuf send_mbuf; /* Data scheduled for sending */
|
||||
#if defined(MG_ENABLE_SSL)
|
||||
#if !defined(MG_SOCKET_SIMPLELINK)
|
||||
SSL *ssl;
|
||||
SSL_CTX *ssl_ctx;
|
||||
#else
|
||||
char *ssl_cert;
|
||||
char *ssl_key;
|
||||
char *ssl_ca_cert;
|
||||
char *ssl_server_name;
|
||||
time_t last_io_time; /* Timestamp of the last socket IO */
|
||||
double ev_timer_time; /* Timestamp of the future MG_EV_TIMER */
|
||||
#if MG_ENABLE_SSL
|
||||
void *ssl_if_data; /* SSL library data. */
|
||||
#endif
|
||||
#endif
|
||||
time_t last_io_time; /* Timestamp of the last socket IO */
|
||||
double ev_timer_time; /* Timestamp of the future MG_EV_TIMER */
|
||||
mg_event_handler_t proto_handler; /* Protocol-specific event handler */
|
||||
void *proto_data; /* Protocol-specific data */
|
||||
void (*proto_data_destructor)(void *proto_data);
|
||||
@@ -42,6 +34,7 @@ signature: |
|
||||
} priv_1; /* Used by mg_enable_multithreading() */
|
||||
void *priv_2; /* Used by mg_enable_multithreading() */
|
||||
void *mgr_data; /* Implementation-specific event manager's data. */
|
||||
struct mg_iface *iface;
|
||||
unsigned long flags;
|
||||
/* Flags set by Mongoose */
|
||||
#define MG_F_LISTENING (1 << 0) /* This connection is listening */
|
||||
@@ -55,11 +48,12 @@ signature: |
|
||||
#define MG_F_IS_WEBSOCKET (1 << 8) /* Websocket specific */
|
||||
|
||||
/* Flags that are settable by user */
|
||||
#define MG_F_SEND_AND_CLOSE (1 << 10) /* Push remaining data and close */
|
||||
#define MG_F_CLOSE_IMMEDIATELY (1 << 11) /* Disconnect */
|
||||
#define MG_F_WEBSOCKET_NO_DEFRAG (1 << 12) /* Websocket specific */
|
||||
#define MG_F_DELETE_CHUNK (1 << 13) /* HTTP specific */
|
||||
#define MG_F_ENABLE_BROADCAST (1 << 14) /* Allow broadcast address usage */
|
||||
#define MG_F_SEND_AND_CLOSE (1 << 10) /* Push remaining data and close */
|
||||
#define MG_F_CLOSE_IMMEDIATELY (1 << 11) /* Disconnect */
|
||||
#define MG_F_WEBSOCKET_NO_DEFRAG (1 << 12) /* Websocket specific */
|
||||
#define MG_F_DELETE_CHUNK (1 << 13) /* HTTP specific */
|
||||
#define MG_F_ENABLE_BROADCAST (1 << 14) /* Allow broadcast address usage */
|
||||
#define MG_F_TUN_DO_NOT_RECONNECT (1 << 15) /* Don't reconnect tunnel */
|
||||
|
||||
#define MG_F_USER_1 (1 << 20) /* Flags left for application */
|
||||
#define MG_F_USER_2 (1 << 21)
|
||||
|
||||
@@ -5,13 +5,16 @@ symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_mgr {
|
||||
struct mg_connection *active_connections;
|
||||
#if MG_ENABLE_HEXDUMP
|
||||
const char *hexdump_file; /* Debug hexdump file path */
|
||||
#ifndef MG_DISABLE_SOCKETPAIR
|
||||
#endif
|
||||
#if MG_ENABLE_BROADCAST
|
||||
sock_t ctl[2]; /* Socketpair for mg_broadcast() */
|
||||
#endif
|
||||
void *user_data; /* User data */
|
||||
void *mgr_data; /* Implementation-specific event manager's data. */
|
||||
#ifdef MG_ENABLE_JAVASCRIPT
|
||||
int num_ifaces;
|
||||
struct mg_iface **ifaces; /* network interfaces */
|
||||
#if MG_ENABLE_JAVASCRIPT
|
||||
struct v7 *v7;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
title: "struct mg_mgr_init_opts"
|
||||
decl_name: "struct mg_mgr_init_opts"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_mgr_init_opts {
|
||||
struct mg_iface_vtable *main_iface;
|
||||
int num_ifaces;
|
||||
struct mg_iface_vtable **ifaces;
|
||||
};
|
||||
---
|
||||
|
||||
Optional parameters to `mg_mgr_init_opt()`.
|
||||
|
||||
If `main_iface` is not NULL, it will be used as the main interface in the
|
||||
default interface set. The pointer will be free'd by `mg_mgr_free`.
|
||||
Otherwise, the main interface will be autodetected based on the current
|
||||
platform.
|
||||
|
||||
If `num_ifaces` is 0 and `ifaces` is NULL, the default interface set will be
|
||||
used.
|
||||
This is an advanced option, as it requires you to construct a full interface
|
||||
set, including special networking interfaces required by some optional
|
||||
features such as TCP tunneling. Memory backing `ifaces` and each of the
|
||||
`num_ifaces` pointers it contains will be reclaimed by `mg_mgr_free`.
|
||||
|
||||
+11
-12
@@ -3,25 +3,24 @@ title: "Utility API"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "util.h"
|
||||
items:
|
||||
- { name: mg_skip.md }
|
||||
- { name: mg_ncasecmp.md }
|
||||
- { name: mg_casecmp.md }
|
||||
- { name: mg_base64_decode.md }
|
||||
- { name: mg_base64_encode.md }
|
||||
- { name: mg_stat.md }
|
||||
- { name: mg_fopen.md }
|
||||
- { name: mg_open.md }
|
||||
- { name: mg_start_thread.md }
|
||||
- { name: mg_basic_auth_header.md }
|
||||
- { name: mg_conn_addr_to_str.md }
|
||||
- { name: mg_sock_to_str.md }
|
||||
- { name: mg_sock_addr_to_str.md }
|
||||
- { name: mg_fopen.md }
|
||||
- { name: mg_hexdump.md }
|
||||
- { name: mg_hexdump_connection.md }
|
||||
- { name: mg_asprintf.md }
|
||||
- { name: mg_avprintf.md }
|
||||
- { name: mg_is_big_endian.md }
|
||||
- { name: mg_next_comma_list_entry.md }
|
||||
- { name: mg_match_prefix.md }
|
||||
- { name: mg_mbuf_append_base64.md }
|
||||
- { name: mg_mbuf_append_base64_putc.md }
|
||||
- { name: mg_next_comma_list_entry.md }
|
||||
- { name: mg_open.md }
|
||||
- { name: mg_skip.md }
|
||||
- { name: mg_sock_addr_to_str.md }
|
||||
- { name: mg_sock_to_str.md }
|
||||
- { name: mg_start_thread.md }
|
||||
- { name: mg_stat.md }
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
title: "mg_asprintf()"
|
||||
decl_name: "mg_asprintf"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_asprintf(char **buf, size_t size, const char *fmt, ...);
|
||||
---
|
||||
|
||||
Prints message to the buffer. If the buffer is large enough to hold the
|
||||
message, it returns buffer. If buffer is to small, it allocates a large
|
||||
enough buffer on heap and returns allocated buffer.
|
||||
This is a supposed use case:
|
||||
|
||||
char buf[5], *p = buf;
|
||||
mg_avprintf(&p, sizeof(buf), "%s", "hi there");
|
||||
use_p_somehow(p);
|
||||
if (p != buf) {
|
||||
free(p);
|
||||
}
|
||||
|
||||
The purpose of this is to avoid malloc-ing if generated strings are small.
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: "mg_avprintf()"
|
||||
decl_name: "mg_avprintf"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_avprintf(char **buf, size_t size, const char *fmt, va_list ap);
|
||||
---
|
||||
|
||||
Same as mg_asprintf, but takes varargs list.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "mg_basic_auth_header()"
|
||||
decl_name: "mg_basic_auth_header"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_basic_auth_header(const char *user, const char *pass, struct mbuf *buf);
|
||||
---
|
||||
|
||||
Generate a Basic Auth header and appends it to buf.
|
||||
If pass is NULL, then user is expected to contain the credentials pair
|
||||
already encoded as `user:pass`.
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: "mg_casecmp()"
|
||||
decl_name: "mg_casecmp"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_casecmp(const char *s1, const char *s2);
|
||||
---
|
||||
|
||||
Cross-platform version of `strcasecmp()`.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "mg_mbuf_append_base64()"
|
||||
decl_name: "mg_mbuf_append_base64"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_mbuf_append_base64(struct mbuf *mbuf, const void *data, size_t len);
|
||||
---
|
||||
|
||||
Encode `len` bytes starting at `data` as base64 and append them to an mbuf.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "mg_mbuf_append_base64_putc()"
|
||||
decl_name: "mg_mbuf_append_base64_putc"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_mbuf_append_base64_putc(char ch, void *user_data);
|
||||
---
|
||||
|
||||
Use with cs_base64_init/update/finish in order to write out base64 in chunks.
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: "mg_ncasecmp()"
|
||||
decl_name: "mg_ncasecmp"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_ncasecmp(const char *s1, const char *s2, size_t len);
|
||||
---
|
||||
|
||||
Cross-platform version of `strncasecmp()`.
|
||||
|
||||
@@ -7,10 +7,10 @@ To create a CoAP client, follow this pattern:
|
||||
1. Create an outbound connection by calling `mg_connect`
|
||||
2. Call `mg_set_protocol_coap` for created connection
|
||||
3. Create an event handler function that handles the following events:
|
||||
- `MG_EV_COAP_CON`
|
||||
- `MG_EV_COAP_NOC`
|
||||
- `MG_EV_COAP_ACK`
|
||||
- `MG_EV_COAP_RST`
|
||||
- `MG_EV_COAP_CON`
|
||||
- `MG_EV_COAP_NOC`
|
||||
- `MG_EV_COAP_ACK`
|
||||
- `MG_EV_COAP_RST`
|
||||
|
||||
Here's an example of the simplest CoAP client.
|
||||
Error checking is omitted for the sake of clarity:
|
||||
@@ -39,6 +39,13 @@ static void coap_handler(struct mg_connection *nc, int ev, void *p) {
|
||||
s_time_to_exit = 1;
|
||||
break;
|
||||
}
|
||||
case MG_EV_CLOSE: {
|
||||
if (s_time_to_exit == 0) {
|
||||
printf("Server closed connection\n");
|
||||
s_time_to_exit = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,9 @@ static void ev_handler(struct mg_connection *c, int ev, void *p) {
|
||||
fwrite(hm->message.p, 1, hm->message.len, stdout);
|
||||
putchar('\n');
|
||||
exit_flag = 1;
|
||||
}
|
||||
} else if (ev == MG_EV_CLOSE) {
|
||||
exit_flag = 1;
|
||||
};
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
@@ -41,4 +43,4 @@ int main(void) {
|
||||
}
|
||||
```
|
||||
|
||||
See full source code at [HTTP client example](https://github.com/cesanta/dev/tree/master/mongoose/examples/http_client).
|
||||
See full source code at [HTTP client example](https://github.com/cesanta/mongoose/tree/master/examples/http_client).
|
||||
@@ -2,10 +2,7 @@
|
||||
title: Disabling flags
|
||||
---
|
||||
|
||||
- `MG_DISABLE_HTTP_WEBSOCKET` disable HTTP + WebSocket protocol support
|
||||
- `MG_DISABLE_HTTP_DIGEST_AUTH` disable HTTP Digest (MD5) authorisation support
|
||||
- `MG_DISABLE_MQTT` disable MQTT support
|
||||
- `MG_DISABLE_SHA1` disable SHA1 support (used by WebSocket)
|
||||
- `MG_DISABLE_MD5` disable MD5 support (used by HTTP auth)
|
||||
- `MG_DISABLE_SOCKETPAIR` disable `mg_broadcast()` API
|
||||
- `MG_DISABLE_HTTP_KEEP_ALIVE` useful for embedded systems to save resources
|
||||
@@ -2,10 +2,18 @@
|
||||
title: Enabling flags
|
||||
---
|
||||
|
||||
- `MG_ENABLE_SSL` Enable OpenSSL support
|
||||
- `MG_ENABLE_IPV6` Enable IPV6 support
|
||||
- `MG_ENABLE_THREADS` enable `mg_start_thread()` API
|
||||
- `MG_ENABLE_MQTT_BROKER` enable MQTT broker
|
||||
- `MG_ENABLE_SSL` Enable [SSL/TLS support](https://docs.cesanta.com/mongoose/master/#/http/ssl.md/) (OpenSSL API)
|
||||
- `MG_ENABLE_IPV6` Enable IPv6 support
|
||||
- `MG_ENABLE_MQTT` enable [MQTT client](https://docs.cesanta.com/mongoose/master/#/mqtt/client_example.md/) (on by default, set to 0 to disable)
|
||||
- `MG_ENABLE_MQTT_BROKER` enable [MQTT broker](https://docs.cesanta.com/mongoose/master/#/mqtt/server_example.md/)
|
||||
- `MG_ENABLE_DNS_SERVER` enable DNS server
|
||||
- `MG_ENABLE_COAP` enable CoAP protocol
|
||||
- `MG_ENABLE_HTTP` Enable HTTP protocol support (on by default, set to 0 to disable)
|
||||
- `MG_ENABLE_HTTP_CGI` Enable [CGI](https://docs.cesanta.com/mongoose/master/#/http/cgi.md/) support
|
||||
- `MG_ENABLE_HTTP_SSI` Enable [Server Side Includes](https://docs.cesanta.com/mongoose/master/#/http/ssi.md/) support
|
||||
- `MG_ENABLE_HTTP_SSI_EXEC` Enable SSI `exec` operator
|
||||
- `MG_ENABLE_HTTP_WEBDAV` enable WebDAV extensions to HTTP
|
||||
- `MG_ENABLE_HTTP_WEBSOCKET` enable WebSocket extension to HTTP (on by default, =0 to disable)
|
||||
- `MG_ENABLE_BROADCAST` enable `mg_broadcast()` API
|
||||
- `MG_ENABLE_GETADDRINFO` enable `getaddrinfo()` in `mg_resolve2()`
|
||||
- `MG_ENABLE_THREADS` enable `mg_start_thread()` API
|
||||
@@ -5,6 +5,5 @@ title: Platform specific
|
||||
Mongoose tries to detect the target platform whenever possible, but in some cases you have
|
||||
to explicitly declare some peculiarities of your target, such as:
|
||||
|
||||
- `MG_LWIP`: use LWIP networking stack
|
||||
- `MG_CC3200`: enable workarounds for the TI CC3200 target.
|
||||
- `MG_ESP8266`: enable workarounds for the ESP8266 target, add `RTOS_SDK` to specify the RTOS SDK flavour.
|
||||
@@ -1,7 +1,7 @@
|
||||
/*****************************************************************************
|
||||
* app.ld
|
||||
*
|
||||
* GCC Linker script for Mongoose IoT. Based on TI's example "blinky.ld".
|
||||
* GCC Linker script for Mongoose OS. Based on TI's example "blinky.ld".
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
@@ -42,9 +42,8 @@ HEAP_SIZE = 0xB000;
|
||||
MEMORY
|
||||
{
|
||||
/* SRAM size of 240KB (0x3C000) for cc3200 ES 1.33 device onward,
|
||||
* 176KB (0x2C000) for XCC3200HZ (pre-release device).
|
||||
* We use the latter for maximum compatibility. */
|
||||
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 0x2C000
|
||||
* 176KB (0x2C000) for XCC3200HZ (pre-release device). */
|
||||
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 0x3C000
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.324606890" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.7" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.324606890" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug.1595303251" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug.664577987" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug.239238133" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.1334773591" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
@@ -123,11 +124,12 @@
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.541661556" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.7" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.541661556" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease.1731528219" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease.1517621311" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease.1511107079" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.709446512" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// #define WIFI_STA_SSID "YourWiFi"
|
||||
// #define WIFI_STA_PASS "YourPass"
|
||||
|
||||
#define MG_TASK_PRIORITY 3
|
||||
#define MGOS_TASK_PRIORITY 3
|
||||
#define MG_TASK_STACK_SIZE 8192
|
||||
|
||||
#include <stdbool.h>
|
||||
@@ -214,7 +214,7 @@ int main(void) {
|
||||
LOG(LL_ERROR, ("Failed to create SL task"));
|
||||
}
|
||||
|
||||
if (!mg_start_task(MG_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
|
||||
if (!mg_start_task(MGOS_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
|
||||
LOG(LL_ERROR, ("Failed to create MG task"));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.324606890" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.7" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.324606890" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug.1595303251" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug.664577987" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug.239238133" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.1334773591" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
@@ -123,11 +124,12 @@
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.541661556" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.7" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.541661556" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease.1731528219" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease.1517621311" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease.1511107079" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.709446512" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
|
||||
@@ -22,11 +22,12 @@
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1832131686" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.7" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1832131686" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformDebug.299496807" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderDebug.120381516" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerDebug.272902152" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.2068422510" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
@@ -90,11 +91,12 @@
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1385252318" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.7" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1385252318" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.8" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformRelease.1983840374" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformRelease"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderRelease.1696443488" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderRelease"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerRelease.1871833554" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.1633469996" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
|
||||
@@ -6,10 +6,18 @@
|
||||
#ifndef CS_COMMON_CS_DBG_H_
|
||||
#define CS_COMMON_CS_DBG_H_
|
||||
|
||||
#ifndef CS_DISABLE_STDIO
|
||||
#if CS_ENABLE_STDIO
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifndef CS_ENABLE_DEBUG
|
||||
#define CS_ENABLE_DEBUG 0
|
||||
#endif
|
||||
|
||||
#ifndef CS_LOG_ENABLE_TS_DIFF
|
||||
#define CS_LOG_ENABLE_TS_DIFF 0
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
@@ -28,7 +36,7 @@ enum cs_log_level {
|
||||
|
||||
void cs_log_set_level(enum cs_log_level level);
|
||||
|
||||
#ifndef CS_DISABLE_STDIO
|
||||
#if CS_ENABLE_STDIO
|
||||
|
||||
void cs_log_set_file(FILE *file);
|
||||
|
||||
@@ -56,7 +64,7 @@ void cs_log_printf(const char *fmt, ...);
|
||||
|
||||
#endif
|
||||
|
||||
#else /* CS_DISABLE_STDIO */
|
||||
#else /* CS_ENABLE_STDIO */
|
||||
|
||||
#define LOG(l, x)
|
||||
#define DBG(x)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#define CONSOLE_BAUD_RATE 115200
|
||||
#define CONSOLE_UART UARTA0_BASE
|
||||
#define CONSOLE_UART_PERIPH PRCM_UARTA0
|
||||
#define MG_TASK_PRIORITY 3
|
||||
#define MGOS_TASK_PRIORITY 3
|
||||
#define MG_TASK_STACK_SIZE 8192
|
||||
|
||||
#define BM222_ADDR 0x18
|
||||
@@ -264,7 +264,7 @@ int main(void) {
|
||||
LOG(LL_ERROR, ("Failed to create SL task"));
|
||||
}
|
||||
|
||||
if (!mg_start_task(MG_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
|
||||
if (!mg_start_task(MGOS_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
|
||||
LOG(LL_ERROR, ("Failed to create MG task"));
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ TARGET = eagle
|
||||
#FLAVOR = release
|
||||
FLAVOR = debug
|
||||
|
||||
EXTRA_CCFLAGS += -Wall -Werror
|
||||
EXTRA_CCFLAGS += -Wall -Werror -DRTOS_SDK
|
||||
|
||||
ifndef PDIR # {
|
||||
GEN_IMAGES= eagle.app.v6.out
|
||||
@@ -27,7 +27,7 @@ endif # } PDIR
|
||||
|
||||
LDDIR = $(SDK_PATH)/ld
|
||||
|
||||
CCFLAGS += -Os
|
||||
CCFLAGS += -Os -Wno-undef
|
||||
|
||||
TARGET_LDFLAGS = \
|
||||
-nostdlib \
|
||||
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker run \
|
||||
--rm -i -v $(realpath ${PWD}/../..):/src \
|
||||
--entrypoint=/bin/bash $(cat sdk.version) -l -c -x '
|
||||
export SDK_PATH=/opt/Espressif/ESP8266_SDK;
|
||||
export BIN_PATH=./bin;
|
||||
cd /src/examples/ESP8266_RTOS &&
|
||||
mkdir -p ./bin && make clean &&
|
||||
make BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=qio SPI_SIZE_MAP=0'
|
||||
@@ -0,0 +1 @@
|
||||
docker.cesanta.com/esp8266-build-rtos:1.4.0-r2
|
||||
@@ -23,11 +23,7 @@ endif
|
||||
# makefile at its root level - these are then overridden
|
||||
# for a subtree within the makefile rooted therein
|
||||
#
|
||||
DEFINES += -DCS_PLATFORM=3 \
|
||||
-DMG_NO_BSD_SOCKETS \
|
||||
-DMG_DISABLE_FILESYSTEM \
|
||||
-DRTOS_SDK -DMG_LWIP -DLWIP_TIMEVAL_PRIVATE=0 \
|
||||
-DMG_INTERNAL=
|
||||
DEFINES +=
|
||||
|
||||
#############################################################
|
||||
# Recursion Magic - Don't touch this!!
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
./../../../../common/cs_dbg.h
|
||||
@@ -29,7 +29,7 @@ _ssize_t _write_r(struct _reent *r, int fd, void *buf, size_t len) {
|
||||
|
||||
/*
|
||||
* You'll need to implement _open_r and friends if you want file operations. See
|
||||
* https://github.com/cesanta/mongoose-iot/blob/master/fw/platforms/esp8266/user/esp_fs.c
|
||||
* https://github.com/cesanta/mongoose-os/blob/master/fw/platforms/esp8266/user/esp_fs.c
|
||||
* for SPIFFS-based implementation.
|
||||
*/
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "esp_common.h"
|
||||
|
||||
#include "mongoose.h"
|
||||
#include "cs_dbg.h"
|
||||
|
||||
#define AP_SSID "Mongoose"
|
||||
#define AP_PASS "Mongoose"
|
||||
@@ -14,7 +13,7 @@
|
||||
#define MG_LISTEN_ADDR "80"
|
||||
|
||||
#define MG_TASK_STACK_SIZE 4096
|
||||
#define MG_TASK_PRIORITY 1
|
||||
#define MGOS_TASK_PRIORITY 1
|
||||
|
||||
void uart_div_modify(int uart_no, unsigned int freq);
|
||||
|
||||
@@ -25,14 +24,13 @@ void ev_handler(struct mg_connection *nc, int ev, void *p) {
|
||||
"Content-Type: text/plain\r\n"
|
||||
"\r\n"
|
||||
"Hello %s\n";
|
||||
LOG(LL_DEBUG, ("conn %p ev %d", nc, ev));
|
||||
|
||||
switch (ev) {
|
||||
case MG_EV_ACCEPT: {
|
||||
char addr[32];
|
||||
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
|
||||
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
|
||||
LOG(LL_INFO, ("Connection %p from %s", nc, addr));
|
||||
printf("Connection %p from %s\n", nc, addr);
|
||||
break;
|
||||
}
|
||||
case MG_EV_HTTP_REQUEST: {
|
||||
@@ -40,15 +38,14 @@ void ev_handler(struct mg_connection *nc, int ev, void *p) {
|
||||
struct http_message *hm = (struct http_message *) p;
|
||||
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
|
||||
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
|
||||
LOG(LL_INFO,
|
||||
("HTTP request from %s: %.*s %.*s", addr, (int) hm->method.len,
|
||||
hm->method.p, (int) hm->uri.len, hm->uri.p));
|
||||
printf("HTTP request from %s: %.*s %.*s\n", addr, (int) hm->method.len,
|
||||
hm->method.p, (int) hm->uri.len, hm->uri.p);
|
||||
mg_printf(nc, reply_fmt, addr);
|
||||
nc->flags |= MG_F_SEND_AND_CLOSE;
|
||||
break;
|
||||
}
|
||||
case MG_EV_CLOSE: {
|
||||
LOG(LL_INFO, ("Connection %p closed", nc));
|
||||
printf("Connection %p closed\n", nc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -71,30 +68,28 @@ void setup_ap(void) {
|
||||
cfg.max_connection = 10;
|
||||
cfg.beacon_interval = 100; /* ms */
|
||||
|
||||
LOG(LL_INFO, ("Setting up AP '%s' on channel %d", cfg.ssid, cfg.channel));
|
||||
printf("Setting up AP '%s' on channel %d\n", cfg.ssid, cfg.channel);
|
||||
wifi_softap_set_config_current(&cfg);
|
||||
wifi_softap_dhcps_stop();
|
||||
wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &off);
|
||||
wifi_softap_dhcps_start();
|
||||
wifi_get_ip_info(SOFTAP_IF, &info);
|
||||
LOG(LL_INFO, ("WiFi AP: SSID %s, channel %d, IP " IPSTR "", cfg.ssid,
|
||||
cfg.channel, IP2STR(&info.ip)));
|
||||
printf("WiFi AP: SSID %s, channel %d, IP " IPSTR "\n", cfg.ssid, cfg.channel,
|
||||
IP2STR(&info.ip));
|
||||
}
|
||||
|
||||
static void mg_task(void *arg) {
|
||||
struct mg_mgr mgr;
|
||||
struct mg_connection *nc;
|
||||
|
||||
cs_log_set_level(LL_INFO);
|
||||
|
||||
LOG(LL_INFO, ("SDK version: %s", system_get_sdk_version()));
|
||||
printf("SDK version: %s\n", system_get_sdk_version());
|
||||
setup_ap();
|
||||
|
||||
mg_mgr_init(&mgr, NULL);
|
||||
|
||||
nc = mg_bind(&mgr, MG_LISTEN_ADDR, ev_handler);
|
||||
if (nc == NULL) {
|
||||
LOG(LL_ERROR, ("Error setting up listener!"));
|
||||
printf("Error setting up listener!\n");
|
||||
return;
|
||||
}
|
||||
mg_set_protocol_http_websocket(nc);
|
||||
@@ -110,5 +105,5 @@ void user_init(void) {
|
||||
uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
|
||||
xTaskCreate(mg_task, (const signed char *) "mongoose", MG_TASK_STACK_SIZE,
|
||||
NULL, MG_TASK_PRIORITY, &s_mg_task_handle);
|
||||
NULL, MGOS_TASK_PRIORITY, &s_mg_task_handle);
|
||||
}
|
||||
@@ -42,6 +42,7 @@
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_MSP432P4XX"/>
|
||||
<listOptionValue builtIn="false" value="MSP432WARE"/>
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
</option>
|
||||
@@ -168,6 +169,7 @@
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_MSP432P4XX"/>
|
||||
<listOptionValue builtIn="false" value="MSP432WARE"/>
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
</option>
|
||||
|
||||
@@ -6,10 +6,18 @@
|
||||
#ifndef CS_COMMON_CS_DBG_H_
|
||||
#define CS_COMMON_CS_DBG_H_
|
||||
|
||||
#ifndef CS_DISABLE_STDIO
|
||||
#if CS_ENABLE_STDIO
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifndef CS_ENABLE_DEBUG
|
||||
#define CS_ENABLE_DEBUG 0
|
||||
#endif
|
||||
|
||||
#ifndef CS_LOG_ENABLE_TS_DIFF
|
||||
#define CS_LOG_ENABLE_TS_DIFF 0
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
@@ -28,7 +36,7 @@ enum cs_log_level {
|
||||
|
||||
void cs_log_set_level(enum cs_log_level level);
|
||||
|
||||
#ifndef CS_DISABLE_STDIO
|
||||
#if CS_ENABLE_STDIO
|
||||
|
||||
void cs_log_set_file(FILE *file);
|
||||
|
||||
@@ -56,7 +64,7 @@ void cs_log_printf(const char *fmt, ...);
|
||||
|
||||
#endif
|
||||
|
||||
#else /* CS_DISABLE_STDIO */
|
||||
#else /* CS_ENABLE_STDIO */
|
||||
|
||||
#define LOG(l, x)
|
||||
#define DBG(x)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// #define WIFI_STA_SSID "YourWiFi"
|
||||
// #define WIFI_STA_PASS "YourPass"
|
||||
|
||||
#define MG_TASK_PRIORITY 3
|
||||
#define MGOS_TASK_PRIORITY 3
|
||||
#define MG_TASK_STACK_SIZE 8192
|
||||
|
||||
#include <stdbool.h>
|
||||
@@ -163,7 +163,7 @@ int main(void) {
|
||||
cs_log_set_level(LL_INFO);
|
||||
cs_log_set_file(stdout);
|
||||
|
||||
if (!mg_start_task(MG_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
|
||||
if (!mg_start_task(MGOS_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
|
||||
LOG(LL_ERROR, ("Error starting Mongoose task"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
<listOptionValue builtIn="false" value="__MSP432P401R__"/>
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_MSP432P4XX"/>
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
</option>
|
||||
@@ -128,6 +129,7 @@
|
||||
<listOptionValue builtIn="false" value="__MSP432P401R__"/>
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_MSP432P4XX"/>
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_FILESYSTEM=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_ENABLE_HTTP_STREAMING_MULTIPART=1"/>
|
||||
<listOptionValue builtIn="false" value="MG_FS_SLFS=1"/>
|
||||
</option>
|
||||
|
||||
+2
-2
@@ -3,10 +3,10 @@
|
||||
|
||||
# `wildcard ./*/` works in both linux and linux/wine, while `wildcard */` enumerates nothing under wine
|
||||
SUBDIRS = $(sort $(dir $(wildcard ./*/)))
|
||||
SUBDIRS:=$(filter-out ./ ./CC3200/ ./ESP8266_RTOS/ ./MSP432/ ./PIC32/ ./STM32F4_CC3100/, $(SUBDIRS))
|
||||
SUBDIRS:=$(filter-out ./ ./CC3200/ ./ESP8266_RTOS/ ./mbed/ ./MSP432/ ./nRF51/ ./nRF52/ ./NXP_K64/ ./NXP_LPC4088/ ./PIC32/ ./STM32F4_CC3100/ ./TM4C129/ ./WinCE/, $(SUBDIRS))
|
||||
|
||||
ifeq ($(OS), Windows_NT)
|
||||
SUBDIRS:=$(filter-out ./load_balancer/ ./netcat/ ./raspberry_pi_mjpeg_led/ ./captive_dns_server/, $(SUBDIRS))
|
||||
SUBDIRS:=$(filter-out ./netcat/ ./raspberry_pi_mjpeg_led/ ./captive_dns_server/, $(SUBDIRS))
|
||||
endif
|
||||
|
||||
.PHONY: $(SUBDIRS)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* Copyright (c) 2015, Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* o Redistributions of source code must retain the above copyright notice, this list
|
||||
* of conditions and the following disclaimer.
|
||||
*
|
||||
* o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "fsl_common.h"
|
||||
#include "fsl_debug_console.h"
|
||||
#include "board.h"
|
||||
|
||||
/* Initialize debug console. */
|
||||
void BOARD_InitDebugConsole(void)
|
||||
{
|
||||
uint32_t uartClkSrcFreq = BOARD_DEBUG_UART_CLK_FREQ;
|
||||
DbgConsole_Init(BOARD_DEBUG_UART_BASEADDR, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq);
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* Copyright (c) 2015, Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* o Redistributions of source code must retain the above copyright notice, this list
|
||||
* of conditions and the following disclaimer.
|
||||
*
|
||||
* o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _BOARD_H_
|
||||
#define _BOARD_H_
|
||||
|
||||
#include "clock_config.h"
|
||||
#include "fsl_gpio.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Definitions
|
||||
******************************************************************************/
|
||||
|
||||
/* The board name */
|
||||
#define BOARD_NAME "FRDM-K64F"
|
||||
|
||||
/* The UART to use for debug messages. */
|
||||
#define BOARD_DEBUG_UART_TYPE DEBUG_CONSOLE_DEVICE_TYPE_UART
|
||||
#define BOARD_DEBUG_UART_BASEADDR (uint32_t) UART0
|
||||
#define BOARD_DEBUG_UART_CLKSRC SYS_CLK
|
||||
#define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetCoreSysClkFreq()
|
||||
#define BOARD_UART_IRQ UART0_RX_TX_IRQn
|
||||
#define BOARD_UART_IRQ_HANDLER UART0_RX_TX_IRQHandler
|
||||
|
||||
#ifndef BOARD_DEBUG_UART_BAUDRATE
|
||||
#define BOARD_DEBUG_UART_BAUDRATE 115200
|
||||
#endif /* BOARD_DEBUG_UART_BAUDRATE */
|
||||
|
||||
/* Define the port interrupt number for the board switches */
|
||||
#define BOARD_SW2_GPIO GPIOC
|
||||
#define BOARD_SW2_PORT PORTC
|
||||
#define BOARD_SW2_GPIO_PIN 6U
|
||||
#define BOARD_SW2_IRQ PORTC_IRQn
|
||||
#define BOARD_SW2_IRQ_HANDLER PORTC_IRQHandler
|
||||
#define BOARD_SW2_NAME "SW2"
|
||||
|
||||
#define BOARD_SW3_GPIO GPIOA
|
||||
#define BOARD_SW3_PORT PORTA
|
||||
#define BOARD_SW3_GPIO_PIN 4U
|
||||
#define BOARD_SW3_IRQ PORTA_IRQn
|
||||
#define BOARD_SW3_IRQ_HANDLER PORTA_IRQHandler
|
||||
#define BOARD_SW3_NAME "SW3"
|
||||
|
||||
/* Board led color mapping */
|
||||
#define LOGIC_LED_ON 0U
|
||||
#define LOGIC_LED_OFF 1U
|
||||
#define BOARD_LED_RED_GPIO GPIOB
|
||||
#define BOARD_LED_RED_GPIO_PORT PORTB
|
||||
#define BOARD_LED_RED_GPIO_PIN 22U
|
||||
#define BOARD_LED_GREEN_GPIO GPIOE
|
||||
#define BOARD_LED_GREEN_GPIO_PORT PORTE
|
||||
#define BOARD_LED_GREEN_GPIO_PIN 26U
|
||||
#define BOARD_LED_BLUE_GPIO GPIOB
|
||||
#define BOARD_LED_BLUE_GPIO_PORT PORTB
|
||||
#define BOARD_LED_BLUE_GPIO_PIN 21U
|
||||
|
||||
#define LED_RED_INIT(output) \
|
||||
GPIO_PinInit(BOARD_LED_RED_GPIO, BOARD_LED_RED_GPIO_PIN, \
|
||||
&(gpio_pin_config_t){kGPIO_DigitalOutput, (output)}) /*!< Enable target LED_RED */
|
||||
#define LED_RED_ON() \
|
||||
GPIO_ClearPinsOutput(BOARD_LED_RED_GPIO, 1U << BOARD_LED_RED_GPIO_PIN) /*!< Turn on target LED_RED */
|
||||
#define LED_RED_OFF() \
|
||||
GPIO_SetPinsOutput(BOARD_LED_RED_GPIO, 1U << BOARD_LED_RED_GPIO_PIN) /*!< Turn off target LED_RED */
|
||||
#define LED_RED_TOGGLE() \
|
||||
GPIO_TogglePinsOutput(BOARD_LED_RED_GPIO, 1U << BOARD_LED_RED_GPIO_PIN) /*!< Toggle on target LED_RED */
|
||||
|
||||
#define LED_GREEN_INIT(output) \
|
||||
GPIO_PinInit(BOARD_LED_GREEN_GPIO, BOARD_LED_GREEN_GPIO_PIN, \
|
||||
&(gpio_pin_config_t){kGPIO_DigitalOutput, (output)}) /*!< Enable target LED_GREEN */
|
||||
#define LED_GREEN_ON() \
|
||||
GPIO_ClearPinsOutput(BOARD_LED_GREEN_GPIO, 1U << BOARD_LED_GREEN_GPIO_PIN) /*!< Turn on target LED_GREEN */
|
||||
#define LED_GREEN_OFF() \
|
||||
GPIO_SetPinsOutput(BOARD_LED_GREEN_GPIO, 1U << BOARD_LED_GREEN_GPIO_PIN) /*!< Turn off target LED_GREEN */
|
||||
#define LED_GREEN_TOGGLE() \
|
||||
GPIO_TogglePinsOutput(BOARD_LED_GREEN_GPIO, 1U << BOARD_LED_GREEN_GPIO_PIN) /*!< Toggle on target LED_GREEN */
|
||||
|
||||
#define LED_BLUE_INIT(output) \
|
||||
GPIO_PinInit(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PIN, \
|
||||
&(gpio_pin_config_t){kGPIO_DigitalOutput, (output)}) /*!< Enable target LED_BLUE */
|
||||
#define LED_BLUE_ON() \
|
||||
GPIO_ClearPinsOutput(BOARD_LED_BLUE_GPIO, 1U << BOARD_LED_BLUE_GPIO_PIN) /*!< Turn on target LED_BLUE */
|
||||
#define LED_BLUE_OFF() \
|
||||
GPIO_SetPinsOutput(BOARD_LED_BLUE_GPIO, 1U << BOARD_LED_BLUE_GPIO_PIN) /*!< Turn off target LED_BLUE */
|
||||
#define LED_BLUE_TOGGLE() \
|
||||
GPIO_TogglePinsOutput(BOARD_LED_BLUE_GPIO, 1U << BOARD_LED_BLUE_GPIO_PIN) /*!< Toggle on target LED_BLUE */
|
||||
|
||||
/* The SDHC instance/channel used for board */
|
||||
#define BOARD_SDHC_CD_GPIO_IRQ_HANDLER PORTB_IRQHandler
|
||||
|
||||
/* SDHC base address, clock and card detection pin */
|
||||
#define BOARD_SDHC_BASEADDR SDHC
|
||||
#define BOARD_SDHC_CLKSRC kCLOCK_CoreSysClk
|
||||
#define BOARD_SDHC_IRQ SDHC_IRQn
|
||||
#define BOARD_SDHC_CD_GPIO_BASE GPIOE
|
||||
#define BOARD_SDHC_CD_GPIO_PIN 6U
|
||||
#define BOARD_SDHC_CD_PORT_BASE PORTE
|
||||
#define BOARD_SDHC_CD_PORT_IRQ PORTE_IRQn
|
||||
#define BOARD_SDHC_CD_PORT_IRQ_HANDLER PORTE_IRQHandler
|
||||
#define BOARD_SDHC_CD_LOGIC_RISING
|
||||
|
||||
#define BOARD_ACCEL_I2C_BASEADDR I2C0
|
||||
|
||||
/* @brief FreeRTOS tickless timer configuration. */
|
||||
#define vPortLptmrIsr LPTMR0_IRQHandler /*!< Timer IRQ handler. */
|
||||
#define TICKLESS_LPTMR_BASE_PTR LPTMR0 /*!< Tickless timer base address. */
|
||||
#define TICKLESS_LPTMR_IRQn LPTMR0_IRQn /*!< Tickless timer IRQ number. */
|
||||
|
||||
/* @brief pit IRQ configuration for lwip demo */
|
||||
#define LWIP_TIME_ISR PIT0_IRQHandler
|
||||
#define LWIP_PIT_IRQ_ID PIT0_IRQn
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*******************************************************************************
|
||||
* API
|
||||
******************************************************************************/
|
||||
void BOARD_InitDebugConsole(void);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _BOARD_H_ */
|
||||
@@ -0,0 +1,197 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* Copyright (c) 2015, Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* o Redistributions of source code must retain the above copyright notice, this list
|
||||
* of conditions and the following disclaimer.
|
||||
*
|
||||
* o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "fsl_common.h"
|
||||
#include "fsl_smc.h"
|
||||
#include "clock_config.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Definitions
|
||||
******************************************************************************/
|
||||
/*! @brief Clock configuration structure. */
|
||||
typedef struct _clock_config
|
||||
{
|
||||
mcg_config_t mcgConfig; /*!< MCG configuration. */
|
||||
sim_clock_config_t simConfig; /*!< SIM configuration. */
|
||||
osc_config_t oscConfig; /*!< OSC configuration. */
|
||||
uint32_t coreClock; /*!< core clock frequency. */
|
||||
} clock_config_t;
|
||||
|
||||
/*******************************************************************************
|
||||
* Variables
|
||||
******************************************************************************/
|
||||
/* System clock frequency. */
|
||||
extern uint32_t SystemCoreClock;
|
||||
|
||||
/* Configuration for enter VLPR mode. Core clock = 4MHz. */
|
||||
const clock_config_t g_defaultClockConfigVlpr = {
|
||||
.mcgConfig =
|
||||
{
|
||||
.mcgMode = kMCG_ModeBLPI, /* Work in BLPI mode. */
|
||||
.irclkEnableMode = kMCG_IrclkEnable, /* MCGIRCLK enable. */
|
||||
.ircs = kMCG_IrcFast, /* Select IRC4M. */
|
||||
.fcrdiv = 0U, /* FCRDIV is 0. */
|
||||
|
||||
.frdiv = 0U,
|
||||
.drs = kMCG_DrsLow, /* Low frequency range. */
|
||||
.dmx32 = kMCG_Dmx32Default, /* DCO has a default range of 25%. */
|
||||
.oscsel = kMCG_OscselOsc, /* Select OSC. */
|
||||
|
||||
.pll0Config =
|
||||
{
|
||||
.enableMode = 0U, /* Don't eanble PLL. */
|
||||
.prdiv = 0U,
|
||||
.vdiv = 0U,
|
||||
},
|
||||
},
|
||||
.simConfig =
|
||||
{
|
||||
.pllFllSel = 3U, /* PLLFLLSEL select IRC48MCLK. */
|
||||
.er32kSrc = 2U, /* ERCLK32K selection, use RTC. */
|
||||
.clkdiv1 = 0x00040000U, /* SIM_CLKDIV1. */
|
||||
},
|
||||
.oscConfig = {.freq = BOARD_XTAL0_CLK_HZ,
|
||||
.capLoad = 0,
|
||||
.workMode = kOSC_ModeExt,
|
||||
.oscerConfig =
|
||||
{
|
||||
.enableMode = kOSC_ErClkEnable,
|
||||
#if (defined(FSL_FEATURE_OSC_HAS_EXT_REF_CLOCK_DIVIDER) && FSL_FEATURE_OSC_HAS_EXT_REF_CLOCK_DIVIDER)
|
||||
.erclkDiv = 0U,
|
||||
#endif
|
||||
}},
|
||||
.coreClock = 4000000U, /* Core clock frequency */
|
||||
};
|
||||
|
||||
/* Configuration for enter RUN mode. Core clock = 120MHz. */
|
||||
const clock_config_t g_defaultClockConfigRun = {
|
||||
.mcgConfig =
|
||||
{
|
||||
.mcgMode = kMCG_ModePEE, /* Work in PEE mode. */
|
||||
.irclkEnableMode = kMCG_IrclkEnable, /* MCGIRCLK enable. */
|
||||
.ircs = kMCG_IrcSlow, /* Select IRC32k. */
|
||||
.fcrdiv = 0U, /* FCRDIV is 0. */
|
||||
|
||||
.frdiv = 7U,
|
||||
.drs = kMCG_DrsLow, /* Low frequency range. */
|
||||
.dmx32 = kMCG_Dmx32Default, /* DCO has a default range of 25%. */
|
||||
.oscsel = kMCG_OscselOsc, /* Select OSC. */
|
||||
|
||||
.pll0Config =
|
||||
{
|
||||
.enableMode = 0U, .prdiv = 0x13U, .vdiv = 0x18U,
|
||||
},
|
||||
},
|
||||
.simConfig =
|
||||
{
|
||||
.pllFllSel = 1U, /* PLLFLLSEL select PLL. */
|
||||
.er32kSrc = 2U, /* ERCLK32K selection, use RTC. */
|
||||
.clkdiv1 = 0x01140000U, /* SIM_CLKDIV1. */
|
||||
},
|
||||
.oscConfig = {.freq = BOARD_XTAL0_CLK_HZ,
|
||||
.capLoad = 0,
|
||||
.workMode = kOSC_ModeExt,
|
||||
.oscerConfig =
|
||||
{
|
||||
.enableMode = kOSC_ErClkEnable,
|
||||
#if (defined(FSL_FEATURE_OSC_HAS_EXT_REF_CLOCK_DIVIDER) && FSL_FEATURE_OSC_HAS_EXT_REF_CLOCK_DIVIDER)
|
||||
.erclkDiv = 0U,
|
||||
#endif
|
||||
}},
|
||||
.coreClock = 120000000U, /* Core clock frequency */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
* Code
|
||||
******************************************************************************/
|
||||
/*
|
||||
* How to setup clock using clock driver functions:
|
||||
*
|
||||
* 1. CLOCK_SetSimSafeDivs, to make sure core clock, bus clock, flexbus clock
|
||||
* and flash clock are in allowed range during clock mode switch.
|
||||
*
|
||||
* 2. Call CLOCK_Osc0Init to setup OSC clock, if it is used in target mode.
|
||||
*
|
||||
* 3. Set MCG configuration, MCG includes three parts: FLL clock, PLL clock and
|
||||
* internal reference clock(MCGIRCLK). Follow the steps to setup:
|
||||
*
|
||||
* 1). Call CLOCK_BootToXxxMode to set MCG to target mode.
|
||||
*
|
||||
* 2). If target mode is FBI/BLPI/PBI mode, the MCGIRCLK has been configured
|
||||
* correctly. For other modes, need to call CLOCK_SetInternalRefClkConfig
|
||||
* explicitly to setup MCGIRCLK.
|
||||
*
|
||||
* 3). Don't need to configure FLL explicitly, because if target mode is FLL
|
||||
* mode, then FLL has been configured by the function CLOCK_BootToXxxMode,
|
||||
* if the target mode is not FLL mode, the FLL is disabled.
|
||||
*
|
||||
* 4). If target mode is PEE/PBE/PEI/PBI mode, then the related PLL has been
|
||||
* setup by CLOCK_BootToXxxMode. In FBE/FBI/FEE/FBE mode, the PLL could
|
||||
* be enabled independently, call CLOCK_EnablePll0 explicitly in this case.
|
||||
*
|
||||
* 4. Call CLOCK_SetSimConfig to set the clock configuration in SIM.
|
||||
*/
|
||||
|
||||
void BOARD_BootClockVLPR(void)
|
||||
{
|
||||
CLOCK_SetSimSafeDivs();
|
||||
|
||||
CLOCK_BootToBlpiMode(g_defaultClockConfigVlpr.mcgConfig.fcrdiv, g_defaultClockConfigVlpr.mcgConfig.ircs,
|
||||
g_defaultClockConfigVlpr.mcgConfig.irclkEnableMode);
|
||||
|
||||
CLOCK_SetSimConfig(&g_defaultClockConfigVlpr.simConfig);
|
||||
|
||||
SystemCoreClock = g_defaultClockConfigVlpr.coreClock;
|
||||
|
||||
SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll);
|
||||
SMC_SetPowerModeVlpr(SMC, false);
|
||||
while (SMC_GetPowerModeState(SMC) != kSMC_PowerStateVlpr)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void BOARD_BootClockRUN(void)
|
||||
{
|
||||
CLOCK_SetSimSafeDivs();
|
||||
|
||||
CLOCK_InitOsc0(&g_defaultClockConfigRun.oscConfig);
|
||||
CLOCK_SetXtal0Freq(BOARD_XTAL0_CLK_HZ);
|
||||
|
||||
CLOCK_BootToPeeMode(g_defaultClockConfigRun.mcgConfig.oscsel, kMCG_PllClkSelPll0,
|
||||
&g_defaultClockConfigRun.mcgConfig.pll0Config);
|
||||
|
||||
CLOCK_SetInternalRefClkConfig(g_defaultClockConfigRun.mcgConfig.irclkEnableMode,
|
||||
g_defaultClockConfigRun.mcgConfig.ircs, g_defaultClockConfigRun.mcgConfig.fcrdiv);
|
||||
|
||||
CLOCK_SetSimConfig(&g_defaultClockConfigRun.simConfig);
|
||||
|
||||
SystemCoreClock = g_defaultClockConfigRun.coreClock;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* Copyright (c) 2015, Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* o Redistributions of source code must retain the above copyright notice, this list
|
||||
* of conditions and the following disclaimer.
|
||||
*
|
||||
* o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef _CLOCK_CONFIG_H_
|
||||
#define _CLOCK_CONFIG_H_
|
||||
|
||||
/*******************************************************************************
|
||||
* DEFINITION
|
||||
******************************************************************************/
|
||||
#define BOARD_XTAL0_CLK_HZ 50000000U
|
||||
#define BOARD_XTAL32K_CLK_HZ 32768U
|
||||
|
||||
/*******************************************************************************
|
||||
* API
|
||||
******************************************************************************/
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif /* __cplusplus*/
|
||||
|
||||
void BOARD_BootClockVLPR(void);
|
||||
void BOARD_BootClockRUN(void);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif /* __cplusplus*/
|
||||
|
||||
#endif /* _CLOCK_CONFIG_H_ */
|
||||
@@ -0,0 +1,293 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* Copyright (c) 2015, Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* o Redistributions of source code must retain the above copyright notice, this list
|
||||
* of conditions and the following disclaimer.
|
||||
*
|
||||
* o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "fsl_phy.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Definitions
|
||||
******************************************************************************/
|
||||
|
||||
/*! @brief Defines the timeout macro. */
|
||||
#define PHY_TIMEOUT_COUNT 0xFFFFFU
|
||||
|
||||
/*******************************************************************************
|
||||
* Prototypes
|
||||
******************************************************************************/
|
||||
|
||||
/*!
|
||||
* @brief Get the ENET instance from peripheral base address.
|
||||
*
|
||||
* @param base ENET peripheral base address.
|
||||
* @return ENET instance.
|
||||
*/
|
||||
extern uint32_t ENET_GetInstance(ENET_Type *base);
|
||||
|
||||
/*******************************************************************************
|
||||
* Variables
|
||||
******************************************************************************/
|
||||
|
||||
/*! @brief Pointers to enet clocks for each instance. */
|
||||
extern clock_ip_name_t s_enetClock[FSL_FEATURE_SOC_ENET_COUNT];
|
||||
|
||||
/*******************************************************************************
|
||||
* Code
|
||||
******************************************************************************/
|
||||
|
||||
status_t PHY_Init(ENET_Type *base, uint32_t phyAddr, uint32_t srcClock_Hz)
|
||||
{
|
||||
uint32_t bssReg;
|
||||
uint32_t counter = PHY_TIMEOUT_COUNT;
|
||||
status_t result = kStatus_Success;
|
||||
uint32_t instance = ENET_GetInstance(base);
|
||||
|
||||
/* Set SMI first. */
|
||||
CLOCK_EnableClock(s_enetClock[instance]);
|
||||
ENET_SetSMI(base, srcClock_Hz, false);
|
||||
|
||||
/* Reset PHY. */
|
||||
result = PHY_Write(base, phyAddr, PHY_BASICCONTROL_REG, PHY_BCTL_RESET_MASK);
|
||||
if (result == kStatus_Success)
|
||||
{
|
||||
/* Set the negotiation. */
|
||||
result = PHY_Write(base, phyAddr, PHY_AUTONEG_ADVERTISE_REG,
|
||||
(PHY_100BASETX_FULLDUPLEX_MASK | PHY_100BASETX_HALFDUPLEX_MASK |
|
||||
PHY_10BASETX_FULLDUPLEX_MASK | PHY_10BASETX_HALFDUPLEX_MASK | 0x1U));
|
||||
if (result == kStatus_Success)
|
||||
{
|
||||
result = PHY_Write(base, phyAddr, PHY_BASICCONTROL_REG,
|
||||
(PHY_BCTL_AUTONEG_MASK | PHY_BCTL_RESTART_AUTONEG_MASK));
|
||||
if (result == kStatus_Success)
|
||||
{
|
||||
/* Check auto negotiation complete. */
|
||||
while (counter --)
|
||||
{
|
||||
result = PHY_Read(base, phyAddr, PHY_BASICSTATUS_REG, &bssReg);
|
||||
if ( result == kStatus_Success)
|
||||
{
|
||||
if ((bssReg & PHY_BSTATUS_AUTONEGCOMP_MASK) != 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!counter)
|
||||
{
|
||||
return kStatus_PHY_AutoNegotiateFail;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
status_t PHY_Write(ENET_Type *base, uint32_t phyAddr, uint32_t phyReg, uint32_t data)
|
||||
{
|
||||
uint32_t counter;
|
||||
|
||||
/* Clear the SMI interrupt event. */
|
||||
ENET_ClearInterruptStatus(base, ENET_EIR_MII_MASK);
|
||||
|
||||
/* Starts a SMI write command. */
|
||||
ENET_StartSMIWrite(base, phyAddr, phyReg, kENET_MiiWriteValidFrame, data);
|
||||
|
||||
/* Wait for SMI complete. */
|
||||
for (counter = PHY_TIMEOUT_COUNT; counter > 0; counter--)
|
||||
{
|
||||
if (ENET_GetInterruptStatus(base) & ENET_EIR_MII_MASK)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for timeout. */
|
||||
if (!counter)
|
||||
{
|
||||
return kStatus_PHY_SMIVisitTimeout;
|
||||
}
|
||||
|
||||
/* Clear MII interrupt event. */
|
||||
ENET_ClearInterruptStatus(base, ENET_EIR_MII_MASK);
|
||||
|
||||
return kStatus_Success;
|
||||
}
|
||||
|
||||
status_t PHY_Read(ENET_Type *base, uint32_t phyAddr, uint32_t phyReg, uint32_t *dataPtr)
|
||||
{
|
||||
assert(dataPtr);
|
||||
|
||||
uint32_t counter;
|
||||
|
||||
/* Clear the MII interrupt event. */
|
||||
ENET_ClearInterruptStatus(base, ENET_EIR_MII_MASK);
|
||||
|
||||
/* Starts a SMI read command operation. */
|
||||
ENET_StartSMIRead(base, phyAddr, phyReg, kENET_MiiReadValidFrame);
|
||||
|
||||
/* Wait for MII complete. */
|
||||
for (counter = PHY_TIMEOUT_COUNT; counter > 0; counter--)
|
||||
{
|
||||
if (ENET_GetInterruptStatus(base) & ENET_EIR_MII_MASK)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for timeout. */
|
||||
if (!counter)
|
||||
{
|
||||
return kStatus_PHY_SMIVisitTimeout;
|
||||
}
|
||||
|
||||
/* Get data from MII register. */
|
||||
*dataPtr = ENET_ReadSMIData(base);
|
||||
|
||||
/* Clear MII interrupt event. */
|
||||
ENET_ClearInterruptStatus(base, ENET_EIR_MII_MASK);
|
||||
|
||||
return kStatus_Success;
|
||||
}
|
||||
|
||||
status_t PHY_EnableLoopback(ENET_Type *base, uint32_t phyAddr, phy_loop_t mode, bool enable)
|
||||
{
|
||||
status_t result;
|
||||
uint32_t data = 0;
|
||||
|
||||
/* Set the loop mode. */
|
||||
if (enable)
|
||||
{
|
||||
if (mode == kPHY_LocalLoop)
|
||||
{
|
||||
/* First read the current status in control register. */
|
||||
result = PHY_Read(base, phyAddr, PHY_BASICCONTROL_REG, &data);
|
||||
if (result == kStatus_Success)
|
||||
{
|
||||
return PHY_Write(base, phyAddr, PHY_BASICCONTROL_REG, (data | PHY_BCTL_LOOP_MASK));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* First read the current status in control register. */
|
||||
result = PHY_Read(base, phyAddr, PHY_CONTROL2_REG, &data);
|
||||
if (result == kStatus_Success)
|
||||
{
|
||||
return PHY_Write(base, phyAddr, PHY_CONTROL2_REG, (data | PHY_CTL2_REMOTELOOP_MASK));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Disable the loop mode. */
|
||||
if (mode == kPHY_LocalLoop)
|
||||
{
|
||||
/* First read the current status in the basic control register. */
|
||||
result = PHY_Read(base, phyAddr, PHY_BASICCONTROL_REG, &data);
|
||||
if (result == kStatus_Success)
|
||||
{
|
||||
return PHY_Write(base, phyAddr, PHY_BASICCONTROL_REG, (data & ~PHY_BCTL_LOOP_MASK));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* First read the current status in control one register. */
|
||||
result = PHY_Read(base, phyAddr, PHY_CONTROL2_REG, &data);
|
||||
if (result == kStatus_Success)
|
||||
{
|
||||
return PHY_Write(base, phyAddr, PHY_CONTROL2_REG, (data & ~PHY_CTL2_REMOTELOOP_MASK));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
status_t PHY_GetLinkStatus(ENET_Type *base, uint32_t phyAddr, bool *status)
|
||||
{
|
||||
assert(status);
|
||||
|
||||
status_t result = kStatus_Success;
|
||||
uint32_t data;
|
||||
|
||||
/* Read the basic status register. */
|
||||
result = PHY_Read(base, phyAddr, PHY_BASICSTATUS_REG, &data);
|
||||
if (result == kStatus_Success)
|
||||
{
|
||||
if (!(PHY_BSTATUS_LINKSTATUS_MASK & data))
|
||||
{
|
||||
/* link down. */
|
||||
*status = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* link up. */
|
||||
*status = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
status_t PHY_GetLinkSpeedDuplex(ENET_Type *base, uint32_t phyAddr, phy_speed_t *speed, phy_duplex_t *duplex)
|
||||
{
|
||||
assert(duplex);
|
||||
|
||||
status_t result = kStatus_Success;
|
||||
uint32_t data, ctlReg;
|
||||
|
||||
/* Read the control two register. */
|
||||
result = PHY_Read(base, phyAddr, PHY_CONTROL1_REG, &ctlReg);
|
||||
if (result == kStatus_Success)
|
||||
{
|
||||
data = ctlReg & PHY_CTL1_SPEEDUPLX_MASK;
|
||||
if ((PHY_CTL1_10FULLDUPLEX_MASK == data) || (PHY_CTL1_100FULLDUPLEX_MASK == data))
|
||||
{
|
||||
/* Full duplex. */
|
||||
*duplex = kPHY_FullDuplex;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Half duplex. */
|
||||
*duplex = kPHY_HalfDuplex;
|
||||
}
|
||||
|
||||
data = ctlReg & PHY_CTL1_SPEEDUPLX_MASK;
|
||||
if ((PHY_CTL1_100HALFDUPLEX_MASK == data) || (PHY_CTL1_100FULLDUPLEX_MASK == data))
|
||||
{
|
||||
/* 100M speed. */
|
||||
*speed = kPHY_Speed100M;
|
||||
}
|
||||
else
|
||||
{ /* 10M speed. */
|
||||
*speed = kPHY_Speed10M;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* Copyright (c) 2015, Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* o Redistributions of source code must retain the above copyright notice, this list
|
||||
* of conditions and the following disclaimer.
|
||||
*
|
||||
* o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef _FSL_PHY_H_
|
||||
#define _FSL_PHY_H_
|
||||
|
||||
#include "fsl_enet.h"
|
||||
|
||||
/*!
|
||||
* @addtogroup phy_driver
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* Definitions
|
||||
******************************************************************************/
|
||||
|
||||
/*! @brief PHY driver version */
|
||||
#define FSL_PHY_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) /*!< Version 2.0.0. */
|
||||
|
||||
/*! @brief Defines the PHY registers. */
|
||||
#define PHY_BASICCONTROL_REG 0x00U /*!< The PHY basic control register. */
|
||||
#define PHY_BASICSTATUS_REG 0x01U /*!< The PHY basic status register. */
|
||||
#define PHY_ID1_REG 0x02U /*!< The PHY ID one register. */
|
||||
#define PHY_ID2_REG 0x03U /*!< The PHY ID two register. */
|
||||
#define PHY_AUTONEG_ADVERTISE_REG 0x04U /*!< The PHY auto-negotiate advertise register. */
|
||||
#define PHY_CONTROL1_REG 0x1EU /*!< The PHY control one register. */
|
||||
#define PHY_CONTROL2_REG 0x1FU /*!< The PHY control two register. */
|
||||
|
||||
#define PHY_CONTROL_ID1 0x22U /*!< The PHY ID1*/
|
||||
|
||||
/*! @brief Defines the mask flag in basic control register. */
|
||||
#define PHY_BCTL_DUPLEX_MASK 0x0100U /*!< The PHY duplex bit mask. */
|
||||
#define PHY_BCTL_RESTART_AUTONEG_MASK 0x0200U /*!< The PHY restart auto negotiation mask. */
|
||||
#define PHY_BCTL_AUTONEG_MASK 0x1000U /*!< The PHY auto negotiation bit mask. */
|
||||
#define PHY_BCTL_SPEED_MASK 0x2000U /*!< The PHY speed bit mask. */
|
||||
#define PHY_BCTL_LOOP_MASK 0x4000U /*!< The PHY loop bit mask. */
|
||||
#define PHY_BCTL_RESET_MASK 0x8000U /*!< The PHY reset bit mask. */
|
||||
|
||||
/*!@brief Defines the mask flag of operation mode in control two register*/
|
||||
#define PHY_CTL2_REMOTELOOP_MASK 0x0004U /*!< The PHY remote loopback mask. */
|
||||
#define PHY_CTL1_10HALFDUPLEX_MASK 0x0001U /*!< The PHY 10M half duplex mask. */
|
||||
#define PHY_CTL1_100HALFDUPLEX_MASK 0x0002U /*!< The PHY 100M half duplex mask. */
|
||||
#define PHY_CTL1_10FULLDUPLEX_MASK 0x0005U /*!< The PHY 10M full duplex mask. */
|
||||
#define PHY_CTL1_100FULLDUPLEX_MASK 0x0006U /*!< The PHY 100M full duplex mask. */
|
||||
#define PHY_CTL1_SPEEDUPLX_MASK 0x0007U /*!< The PHY speed and duplex mask. */
|
||||
|
||||
/*! @brief Defines the mask flag in basic status register. */
|
||||
#define PHY_BSTATUS_LINKSTATUS_MASK 0x0004U /*!< The PHY link status mask. */
|
||||
#define PHY_BSTATUS_AUTONEGABLE_MASK 0x0008U /*!< The PHY auto-negotiation ability mask. */
|
||||
#define PHY_BSTATUS_AUTONEGCOMP_MASK 0x0020U /*!< The PHY auto-negotiation complete mask. */
|
||||
|
||||
/*! @brief Defines the mask flag in PHY auto-negotiation advertise register. */
|
||||
#define PHY_100BaseT4_ABILITY_MASK 0x200U /*!< The PHY have the T4 ability. */
|
||||
#define PHY_100BASETX_FULLDUPLEX_MASK 0x100U /*!< The PHY has the 100M full duplex ability.*/
|
||||
#define PHY_100BASETX_HALFDUPLEX_MASK 0x080U /*!< The PHY has the 100M full duplex ability.*/
|
||||
#define PHY_10BASETX_FULLDUPLEX_MASK 0x040U /*!< The PHY has the 10M full duplex ability.*/
|
||||
#define PHY_10BASETX_HALFDUPLEX_MASK 0x020U /*!< The PHY has the 10M full duplex ability.*/
|
||||
|
||||
/*! @brief Defines the PHY status. */
|
||||
enum _phy_status
|
||||
{
|
||||
kStatus_PHY_SMIVisitTimeout = MAKE_STATUS(kStatusGroup_PHY, 1), /*!< ENET PHY SMI visit timeout. */
|
||||
kStatus_PHY_AutoNegotiateFail = MAKE_STATUS(kStatusGroup_PHY, 2) /*!< ENET PHY AutoNegotiate Fail. */
|
||||
};
|
||||
|
||||
/*! @brief Defines the PHY link speed. This is align with the speed for ENET MAC. */
|
||||
typedef enum _phy_speed
|
||||
{
|
||||
kPHY_Speed10M = 0U, /*!< ENET PHY 10M speed. */
|
||||
kPHY_Speed100M /*!< ENET PHY 100M speed. */
|
||||
} phy_speed_t;
|
||||
|
||||
/*! @brief Defines the PHY link duplex. */
|
||||
typedef enum _phy_duplex
|
||||
{
|
||||
kPHY_HalfDuplex = 0U, /*!< ENET PHY half duplex. */
|
||||
kPHY_FullDuplex /*!< ENET PHY full duplex. */
|
||||
} phy_duplex_t;
|
||||
|
||||
/*! @brief Defines the PHY loopback mode. */
|
||||
typedef enum _phy_loop
|
||||
{
|
||||
kPHY_LocalLoop = 0U, /*!< ENET PHY local loopback. */
|
||||
kPHY_RemoteLoop /*!< ENET PHY remote loopback. */
|
||||
} phy_loop_t;
|
||||
|
||||
/*******************************************************************************
|
||||
* API
|
||||
******************************************************************************/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* @name PHY Driver
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @brief Initializes PHY.
|
||||
*
|
||||
* This function initialize the SMI interface and initialize PHY.
|
||||
* The SMI is the MII management interface between PHY and MAC, which should be
|
||||
* firstly initialized before any other operation for PHY.
|
||||
*
|
||||
* @param base ENET peripheral base address.
|
||||
* @param phyAddr The PHY address.
|
||||
* @param srcClock_Hz The module clock frequency - system clock for MII management interface - SMI.
|
||||
* @retval kStatus_Success PHY initialize success
|
||||
* @retval kStatus_PHY_SMIVisitTimeout PHY SMI visit time out
|
||||
* @retval kStatus_PHY_AutoNegotiateFail PHY auto negotiate fail
|
||||
*/
|
||||
status_t PHY_Init(ENET_Type *base, uint32_t phyAddr, uint32_t srcClock_Hz);
|
||||
|
||||
/*!
|
||||
* @brief PHY Write function. This function write data over the SMI to
|
||||
* the specified PHY register. This function is called by all PHY interfaces.
|
||||
*
|
||||
* @param base ENET peripheral base address.
|
||||
* @param phyAddr The PHY address.
|
||||
* @param phyReg The PHY register.
|
||||
* @param data The data written to the PHY register.
|
||||
* @retval kStatus_Success PHY write success
|
||||
* @retval kStatus_PHY_SMIVisitTimeout PHY SMI visit time out
|
||||
*/
|
||||
status_t PHY_Write(ENET_Type *base, uint32_t phyAddr, uint32_t phyReg, uint32_t data);
|
||||
|
||||
/*!
|
||||
* @brief PHY Read function. This interface read data over the SMI from the
|
||||
* specified PHY register. This function is called by all PHY interfaces.
|
||||
*
|
||||
* @param base ENET peripheral base address.
|
||||
* @param phyAddr The PHY address.
|
||||
* @param phyReg The PHY register.
|
||||
* @param dataPtr The address to store the data read from the PHY register.
|
||||
* @retval kStatus_Success PHY read success
|
||||
* @retval kStatus_PHY_SMIVisitTimeout PHY SMI visit time out
|
||||
*/
|
||||
status_t PHY_Read(ENET_Type *base, uint32_t phyAddr, uint32_t phyReg, uint32_t *dataPtr);
|
||||
|
||||
/*!
|
||||
* @brief Enables/disables PHY loopback.
|
||||
*
|
||||
* @param base ENET peripheral base address.
|
||||
* @param phyAddr The PHY address.
|
||||
* @param mode The loopback mode to be enabled, please see "phy_loop_t".
|
||||
* the two loopback mode should not be both set. when one loopback mode is set
|
||||
* the other one should be disabled.
|
||||
* @param enable True to enable, false to disable.
|
||||
* @retval kStatus_Success PHY loopback success
|
||||
* @retval kStatus_PHY_SMIVisitTimeout PHY SMI visit time out
|
||||
*/
|
||||
status_t PHY_EnableLoopback(ENET_Type *base, uint32_t phyAddr, phy_loop_t mode, bool enable);
|
||||
|
||||
/*!
|
||||
* @brief Gets the PHY link status.
|
||||
*
|
||||
* @param base ENET peripheral base address.
|
||||
* @param phyAddr The PHY address.
|
||||
* @param status The link up or down status of the PHY.
|
||||
* - true the link is up.
|
||||
* - false the link is down.
|
||||
* @retval kStatus_Success PHY get link status success
|
||||
* @retval kStatus_PHY_SMIVisitTimeout PHY SMI visit time out
|
||||
*/
|
||||
status_t PHY_GetLinkStatus(ENET_Type *base, uint32_t phyAddr, bool *status);
|
||||
|
||||
/*!
|
||||
* @brief Gets the PHY link speed and duplex.
|
||||
*
|
||||
* @param base ENET peripheral base address.
|
||||
* @param phyAddr The PHY address.
|
||||
* @param speed The address of PHY link speed.
|
||||
* @param duplex The link duplex of PHY.
|
||||
* @retval kStatus_Success PHY get link speed and duplex success
|
||||
* @retval kStatus_PHY_SMIVisitTimeout PHY SMI visit time out
|
||||
*/
|
||||
status_t PHY_GetLinkSpeedDuplex(ENET_Type *base, uint32_t phyAddr, phy_speed_t *speed, phy_duplex_t *duplex);
|
||||
|
||||
/* @} */
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*! @}*/
|
||||
|
||||
#endif /* _FSL_PHY_H_ */
|
||||
@@ -0,0 +1,317 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861" moduleId="org.eclipse.cdt.core.settings" name="debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861" name="debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
|
||||
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.439601044" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.780228407" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1547417078" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.765602671" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.910567930" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.243581182" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn.416266830" name="Enable all common warnings (-Wall)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.1613409592" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.default" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.556186202" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.default" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.873832382" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="Custom" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1923839154" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.292907889" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-m4" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.1510156849" name="Instruction set" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.thumb" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.1110645397" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" value="arm-none-eabi-" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1996567256" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" value="gcc" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.2014665560" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" value="g++" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.867581768" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" value="objcopy" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.315789427" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" value="objdump" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.348642956" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" value="size" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.670689833" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" value="make" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.654501139" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" value="rm" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.967248865" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.1390211406" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.useglobalpath.228343129" name="Use global path" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.useglobalpath" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.1173170148" name="FPU Type" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.1949324826" name="Float ABI" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.hard" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.1370140886" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" value="ar" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.nowarn.6567419856" name="Inhibit all warnings (-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.nowarn" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn.3969248588" name="Enable extra warnings (-Wextra)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.conversion.4957269161" name="Warn on implicit conversions (-Wconversion)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.conversion" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.unitialized.4254045974" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.unitialized" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.floatequal.8315143005" name="Warn if floats are compared as equal (-Wfloat-equal)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.floatequal" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.shadow.9628505687" name="Warn if shadowed variable (-Wshadow)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.shadow" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pointerarith.3110311092" name="Warn if pointer arithmetic (-Wpointer-arith)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pointerarith" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.badfunctioncast.400008492" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.badfunctioncast" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.logicalop.3403474516" name="Warn if suspicious logical ops (-Wlogical-op)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.logicalop" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.agreggatereturn.8519421725" name="Warn if struct is returned (-Wagreggate-return)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.agreggatereturn" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.missingdeclaration.1088551177" name="Warn on undeclared global function (-Wmissing-declaration)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.missingdeclaration" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors.2131497280" name="Generate errors instead of warnings (-Werror)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.7593408494" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" value="false" valueType="boolean"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.1777290613" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||
<builder buildPath="${workspace_loc:/k64f}/debug" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1406291427" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.2007968129" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1246588554" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths.2122094274" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="../.."/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs.7681400262" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__STARTUP_CLEAR_BSS"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.nostdinc.9824417859" name="Do not search system directories (-nostdinc)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.nostdinc" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other.9404802095" name="Other assembler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other" value=" -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs " valueType="string"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.2014783385" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1397207158" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.336878990" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""../..""/>
|
||||
<listOptionValue builtIn="false" value=""../../../../""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/drivers}/..""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/drivers}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/utilities}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/lwip/port}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/lwip/src/include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/lwip/src/include/ipv4}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/CMSIS_Include}""/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.933718024" name="Language standard" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.gnu99" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.7076831363" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="CPU_MK64FN1M0VMD12"/>
|
||||
<listOptionValue builtIn="false" value="FRDM_K64F"/>
|
||||
<listOptionValue builtIn="false" value="FREEDOM"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc.5577125920" name="Do not search system directories (-nostdinc)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.5582550651" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value=" -fno-common -ffreestanding -fno-builtin -mapcs " valueType="string"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1895544709" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.435207489" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler"/>
|
||||
<tool commandLinePattern="${COMMAND} ${cross_toolchain_flags} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} -Xlinker --start-group ${INPUTS} -Xlinker --end-group" id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.1681324840" name="Cross ARM C Linker" outputPrefix="" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.1850945755" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile.1573832003" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="../MK64FN1M0xxx12_flash.ld"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.libs.2061142742" name="Libraries (-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="m"/>
|
||||
<listOptionValue builtIn="false" value="g"/>
|
||||
<listOptionValue builtIn="false" value="gcc"/>
|
||||
<listOptionValue builtIn="false" value="nosys"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.otherobjs.5528601638" name="Other objects" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.otherobjs"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nostart.7690269218" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nostart" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nodeflibs.4386474319" name="Do not use default libraries (-nodefaultlibs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nodeflibs" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref.4665561700" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.printgcsections.7636536715" name="Print removed sections (-Xlinker --print-gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.printgcsections" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.strip.223955170" name="Omit all symbol information (-s)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.strip" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other.1597332713" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other" value=" -Wall --specs=nano.specs -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -Xlinker -static -Xlinker -z -Xlinker muldefs -Xlinker --defsym=__ram_vector_table__=1 " valueType="string"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input.1168552163" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.1475612095" name="Cross ARM C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.42905068" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" value="true" valueType="boolean"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.717958418" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver"/>
|
||||
<tool command="${cross_prefix}${cross_objcopy}${cross_suffix}" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT}" id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.1498748442" name="Cross ARM GNU Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.396105459" name="Output file format (-O)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice" value="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.binary" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.1921141825" name="Cross ARM GNU Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.1147761851" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.326654770" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.2012585764" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.1639985926" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.795915960" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" value="true" valueType="boolean"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.204256629" name="Cross ARM GNU Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.48990078" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="drivers/fsl_uart_freertos.c|drivers/fsl_i2c_freertos.c|drivers/fsl_dspi_freertos.c|lwip/src/netif/ppp|lwip/src/core/snmp|lwip/src/core/ipv6" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834" moduleId="org.eclipse.cdt.core.settings" name="release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834" name="release" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
|
||||
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release.338803166" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1916499380" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.size" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1460543599" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.177322323" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.356292453" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.666658360" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn.1018775359" name="Enable all common warnings (-Wall)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.597989734" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.none" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.773110826" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.default" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.28437861" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="Custom" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1461080496" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.1124565964" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-m4" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.1600158089" name="Instruction set" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.thumb" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.1115996221" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" value="arm-none-eabi-" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1677262447" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" value="gcc" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.1626484215" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" value="g++" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.634682233" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" value="objcopy" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.361919006" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" value="objdump" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.279076886" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" value="size" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.1573227602" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" value="make" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.1269834234" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" value="rm" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.286942610" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.992362786" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.useglobalpath.1682061124" name="Use global path" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.useglobalpath" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.43762243" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" value="ar" valueType="string"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.1631437179" name="Float ABI" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.hard" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.977377894" name="FPU Type" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.nowarn.9812480522" name="Inhibit all warnings (-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.nowarn" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn.6099870842" name="Enable extra warnings (-Wextra)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.conversion.9882524396" name="Warn on implicit conversions (-Wconversion)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.conversion" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.unitialized.2606229498" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.unitialized" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.floatequal.42789858" name="Warn if floats are compared as equal (-Wfloat-equal)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.floatequal" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.shadow.3530540211" name="Warn if shadowed variable (-Wshadow)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.shadow" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pointerarith.9307654893" name="Warn if pointer arithmetic (-Wpointer-arith)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pointerarith" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.badfunctioncast.6258034364" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.badfunctioncast" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.logicalop.3900312088" name="Warn if suspicious logical ops (-Wlogical-op)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.logicalop" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.agreggatereturn.8356362713" name="Warn if struct is returned (-Wagreggate-return)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.agreggatereturn" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.missingdeclaration.6547268175" name="Warn on undeclared global function (-Wmissing-declaration)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.missingdeclaration" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors.4066775435" name="Generate errors instead of warnings (-Werror)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.4668208574" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" value="false" valueType="boolean"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.1508624923" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||
<builder buildPath="${workspace_loc:/k64f}/release" id="ilg.gnuarmeclipse.managedbuild.cross.builder.506636371" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.142183468" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.260968363" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths.2659987684" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="../.."/>
|
||||
<listOptionValue builtIn="false" value="../../../../../../../../devices/MK64F12/drivers"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs.9065992226" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__STARTUP_CLEAR_BSS"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.nostdinc.7407691783" name="Do not search system directories (-nostdinc)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.nostdinc" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other.4185642263" name="Other assembler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other" value=" -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs " valueType="string"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.871599837" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.955273220" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.767758500" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""../..""/>
|
||||
<listOptionValue builtIn="false" value=""../../../../""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/drivers}/..""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/drivers}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/utilities}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/lwip/port}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/lwip/src/include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/lwip/src/include/ipv4}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/Mongoose_FRDMK64F_BM/CMSIS_Include}""/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.997197032" name="Language standard" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.gnu99" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.6830536915" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="NDEBUG"/>
|
||||
<listOptionValue builtIn="false" value="CPU_MK64FN1M0VMD12"/>
|
||||
<listOptionValue builtIn="false" value="FRDM_K64F"/>
|
||||
<listOptionValue builtIn="false" value="FREEDOM"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc.9102863623" name="Do not search system directories (-nostdinc)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.9524876677" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value=" -fno-common -ffreestanding -fno-builtin -mapcs " valueType="string"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1711058916" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.270191615" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler"/>
|
||||
<tool commandLinePattern="${COMMAND} ${cross_toolchain_flags} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} -Xlinker --start-group ${INPUTS} -Xlinker --end-group" id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.1286541465" name="Cross ARM C Linker" outputPrefix="" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.1012325190" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.otherobjs.3003655888" name="Other objects" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.otherobjs"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile.1938135444" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="../MK64FN1M0xxx12_flash.ld"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nostart.7190303728" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nostart" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nodeflibs.2673291920" name="Do not use default libraries (-nodefaultlibs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.nodeflibs" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.libs.7037434604" name="Libraries (-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="m"/>
|
||||
<listOptionValue builtIn="false" value="g"/>
|
||||
<listOptionValue builtIn="false" value="gcc"/>
|
||||
<listOptionValue builtIn="false" value="nosys"/>
|
||||
</option>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref.6043148641" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.cref" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.printgcsections.4277279969" name="Print removed sections (-Xlinker --print-gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.printgcsections" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.strip.2164842634" name="Omit all symbol information (-s)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.strip" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other.4493069774" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other" value=" -Wall --specs=nano.specs -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -Xlinker -static -Xlinker -z -Xlinker muldefs -Xlinker --defsym=__ram_vector_table__=1 " valueType="string"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input.1297163151" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.1288631479" name="Cross ARM C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.1722094624" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" value="true" valueType="boolean"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.571275503" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.815118717" name="Cross ARM GNU Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.338690695" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice" value="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.binary" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.254728314" name="Cross ARM GNU Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.1925404631" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.167640084" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.1474313123" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.1969680589" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.240541858" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" value="true" valueType="boolean"/>
|
||||
</tool>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.572718337" name="Cross ARM GNU Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.1162591107" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="drivers/fsl_uart_freertos.c|drivers/fsl_i2c_freertos.c|drivers/fsl_dspi_freertos.c|lwip/src/core/snmp|lwip/src/core/ipv6" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="k64f.ilg.gnuarmeclipse.managedbuild.cross.target.elf.1537007018" name="Executable" projectType="ilg.gnuarmeclipse.managedbuild.cross.target.elf"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Multiple configurations">
|
||||
<resource resourceType="PROJECT" workspacePath="/FRDM-K64F_Demo"/>
|
||||
</configuration>
|
||||
<configuration configurationName="debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/Mongoose_FRDMK64F_BM"/>
|
||||
</configuration>
|
||||
<configuration configurationName="release">
|
||||
<resource resourceType="PROJECT" workspacePath="/Mongoose_FRDMK64F_BM"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834;ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.955273220;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1711058916">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1397207158;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1895544709">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Mongoose_FRDMK64F_BM</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.freescale.processorexpert.core.expertprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.freescale.processorexpert.core.expertprojectnature</nature>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>CMSIS_Include</name>
|
||||
<type>2</type>
|
||||
<locationURI>$%7BSDK_PATH%7D/CMSIS/Include</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>drivers</name>
|
||||
<type>2</type>
|
||||
<locationURI>SDK_PATH/devices/MK64F12/drivers</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>lwip</name>
|
||||
<type>2</type>
|
||||
<locationURI>LWIP_PATH</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source</name>
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>startup</name>
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>utilities</name>
|
||||
<type>2</type>
|
||||
<locationURI>SDK_PATH/devices/MK64F12/utilities</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/board.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/board.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/board.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/board.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/clock_config.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/clock_config.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/clock_config.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/clock_config.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/fsl_phy.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/fsl_phy.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/fsl_phy.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/fsl_phy.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/main.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/main.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/mongoose.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/mongoose.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/mongoose.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/mongoose.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/pin_mux.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/pin_mux.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>source/pin_mux.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/pin_mux.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>startup/startup_MK64F12.S</name>
|
||||
<type>1</type>
|
||||
<locationURI>SDK_PATH/devices/MK64F12/gcc/startup_MK64F12.S</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>startup/system_MK64F12.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>SDK_PATH/devices/MK64F12/system_MK64F12.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>startup/system_MK64F12.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>SDK_PATH/devices/MK64F12/system_MK64F12.h</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>LWIP_PATH</name>
|
||||
<value>$%7BSDK_PATH%7D/middleware/lwip_1.4.1</value>
|
||||
</variable>
|
||||
<variable>
|
||||
<name>SDK_PATH</name>
|
||||
<value>$%7BPARENT-1-PROJECT_LOC%7D/SDK_2.0_FRDM-K64F</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,261 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MK64FN1M0VDC12
|
||||
** MK64FN1M0VLL12
|
||||
** MK64FN1M0VLQ12
|
||||
** MK64FN1M0VMD12
|
||||
**
|
||||
** Compiler: GNU C Compiler
|
||||
** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
|
||||
** Version: rev. 2.8, 2015-02-19
|
||||
** Build: b151217
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the GNU C Compiler
|
||||
**
|
||||
** Copyright (c) 2015 Freescale Semiconductor, Inc.
|
||||
** All rights reserved.
|
||||
**
|
||||
** Redistribution and use in source and binary forms, with or without modification,
|
||||
** are permitted provided that the following conditions are met:
|
||||
**
|
||||
** o Redistributions of source code must retain the above copyright notice, this list
|
||||
** of conditions and the following disclaimer.
|
||||
**
|
||||
** o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
** list of conditions and the following disclaimer in the documentation and/or
|
||||
** other materials provided with the distribution.
|
||||
**
|
||||
** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
** contributors may be used to endorse or promote products derived from this
|
||||
** software without specific prior written permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
**
|
||||
** http: www.freescale.com
|
||||
** mail: support@freescale.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/* Entry Point */
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x1000;
|
||||
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
|
||||
M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0400 : 0x0;
|
||||
|
||||
/* Specify the memory areas */
|
||||
MEMORY
|
||||
{
|
||||
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
|
||||
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
|
||||
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0
|
||||
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
|
||||
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00030000
|
||||
}
|
||||
|
||||
/* Define output sections */
|
||||
SECTIONS
|
||||
{
|
||||
/* The startup code goes first into internal flash */
|
||||
.interrupts :
|
||||
{
|
||||
__VECTOR_TABLE = .;
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} > m_interrupts
|
||||
|
||||
.flash_config :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */
|
||||
. = ALIGN(4);
|
||||
} > m_flash_config
|
||||
|
||||
/* The program code and other data goes into internal flash */
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
*(.text) /* .text sections (code) */
|
||||
*(.text*) /* .text* sections (code) */
|
||||
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||
*(.glue_7) /* glue arm to thumb code */
|
||||
*(.glue_7t) /* glue thumb to arm code */
|
||||
*(.eh_frame)
|
||||
KEEP (*(.init))
|
||||
KEEP (*(.fini))
|
||||
. = ALIGN(4);
|
||||
} > m_text
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > m_text
|
||||
|
||||
.ARM :
|
||||
{
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = .;
|
||||
} > m_text
|
||||
|
||||
.ctors :
|
||||
{
|
||||
__CTOR_LIST__ = .;
|
||||
/* gcc uses crtbegin.o to find the start of
|
||||
the constructors, so we make sure it is
|
||||
first. Because this is a wildcard, it
|
||||
doesn't matter if the user does not
|
||||
actually link against crtbegin.o; the
|
||||
linker won't look for a file to match a
|
||||
wildcard. The wildcard also means that it
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
KEEP (*crtbegin?.o(.ctors))
|
||||
/* We don't want to include the .ctor section from
|
||||
from the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
__CTOR_END__ = .;
|
||||
} > m_text
|
||||
|
||||
.dtors :
|
||||
{
|
||||
__DTOR_LIST__ = .;
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*crtbegin?.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
__DTOR_END__ = .;
|
||||
} > m_text
|
||||
|
||||
.preinit_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP (*(.preinit_array*))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
} > m_text
|
||||
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array*))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
} > m_text
|
||||
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
KEEP (*(.fini_array*))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
} > m_text
|
||||
|
||||
__etext = .; /* define a global symbol at end of code */
|
||||
__DATA_ROM = .; /* Symbol is used by startup for data initialization */
|
||||
|
||||
.interrupts_ram :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__VECTOR_RAM__ = .;
|
||||
__interrupts_ram_start__ = .; /* Create a global symbol at data start */
|
||||
*(.m_interrupts_ram) /* This is a user defined section */
|
||||
. += M_VECTOR_RAM_SIZE;
|
||||
. = ALIGN(4);
|
||||
__interrupts_ram_end__ = .; /* Define a global symbol at data end */
|
||||
} > m_data
|
||||
|
||||
__VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts);
|
||||
__RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
|
||||
|
||||
.data : AT(__DATA_ROM)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__DATA_RAM = .;
|
||||
__data_start__ = .; /* create a global symbol at data start */
|
||||
*(.data) /* .data sections */
|
||||
*(.data*) /* .data* sections */
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
__data_end__ = .; /* define a global symbol at data end */
|
||||
} > m_data
|
||||
|
||||
__DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
|
||||
text_end = ORIGIN(m_text) + LENGTH(m_text);
|
||||
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
|
||||
|
||||
USB_RAM_GAP = DEFINED(__usb_ram_size__) ? __usb_ram_size__ : 0x800;
|
||||
/* Uninitialized data section */
|
||||
.bss :
|
||||
{
|
||||
/* This is used by the startup in order to initialize the .bss section */
|
||||
. = ALIGN(4);
|
||||
__START_BSS = .;
|
||||
__bss_start__ = .;
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
. = ALIGN(512);
|
||||
USB_RAM_START = .;
|
||||
. += USB_RAM_GAP;
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
__END_BSS = .;
|
||||
} > m_data
|
||||
|
||||
.heap :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
__HeapBase = .;
|
||||
. += HEAP_SIZE;
|
||||
__HeapLimit = .;
|
||||
__heap_limit = .; /* Add for _sbrk */
|
||||
} > m_data_2
|
||||
|
||||
.stack :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
. += STACK_SIZE;
|
||||
} > m_data_2
|
||||
|
||||
m_usb_bdt USB_RAM_START (NOLOAD) :
|
||||
{
|
||||
*(m_usb_bdt)
|
||||
USB_RAM_BDT_END = .;
|
||||
}
|
||||
|
||||
m_usb_global USB_RAM_BDT_END (NOLOAD) :
|
||||
{
|
||||
*(m_usb_global)
|
||||
}
|
||||
|
||||
/* Initializes stack on the end of block */
|
||||
__StackTop = ORIGIN(m_data_2) + LENGTH(m_data_2);
|
||||
__StackLimit = __StackTop - STACK_SIZE;
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region m_data_2 overflowed with stack and heap")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="ilg.gnuarmeclipse.debug.gdbjtag.openocd.launchConfigurationType">
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doConnectToRunning" value="false"/>
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doContinue" value="true"/>
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/>
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doFirstReset" value="true"/>
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/>
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/>
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doSecondReset" value="true"/>
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/>
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.enableSemihosting" value="true"/>
|
||||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.enableSemihostingIoclientTelnet" value="false"/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.firstResetType" value="init"/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbClientOtherCommands" value="set mem inaccessible-by-default off"/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbClientOtherOptions" value=""/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerConnectionAddress" value=""/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="/opt/Freescale/KDS_v3/openocd/bin/openocd"/>
|
||||
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerOther" value="-f kinetis.cfg"/>
|
||||
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.otherRunCommands" value=""/>
|
||||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.openocd.secondResetType" value="halt"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU ARM OpenOCD"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard (Windows)"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
|
||||
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${cross_prefix}gdb${cross_suffix}"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="debug/Mongoose_FRDMK64F_BM.elf"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="Mongoose_FRDMK64F_BM"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Mongoose_FRDMK64F_BM"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="Context string"/> "/>
|
||||
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||
</launchConfiguration>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<workspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="workingsets.xsd">
|
||||
<projects>
|
||||
<project><name>Mongoose_FRDMK64F_BM</name><path>.</path><open>true</open><activeconfig>debug</activeconfig><buildreferences config="debug">false</buildreferences><activeconfig>release</activeconfig><buildreferences config="release">false</buildreferences></project></projects>
|
||||
<workingsets>
|
||||
<workingSet editPageId="org.eclipse.cdt.ui.CElementWorkingSetPage" id="1323268527287_1" label="Mongoose_FRDMK64F_BM" name="Mongoose_FRDMK64F_BM"><item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/Mongoose_FRDMK64F_BM" type="4"/></workingSet></workingsets>
|
||||
<cdtconfigurations>
|
||||
<workingSet name="Mongoose_FRDMK64F_BM"><config name="debug"><project config="com.freescale.arm.cdt.toolchain.config.arm.release.695495605" name="Mongoose_FRDMK64F_BM" configName="debug"/></config><config name="release"><project config="com.freescale.arm.cdt.toolchain.config.arm.release.695495605" name="Mongoose_FRDMK64F_BM" configName="release"/></config></workingSet></cdtconfigurations>
|
||||
</workspace>
|
||||
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#include "mongoose.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "lwip/dhcp.h"
|
||||
#include "lwip/init.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/timers.h"
|
||||
#include "netif/etharp.h"
|
||||
|
||||
#include "ethernetif.h"
|
||||
#include "board.h"
|
||||
#include "fsl_gpio.h"
|
||||
#include "fsl_port.h"
|
||||
|
||||
#include "pin_mux.h"
|
||||
|
||||
/* IP address configuration. */
|
||||
#define USE_DHCP 1 /* For static IP, set to 0 and configure options below */
|
||||
#if !USE_DHCP
|
||||
#define STATIC_IP "192.168.0.111"
|
||||
#define STATIC_NM "255.255.255.0"
|
||||
#define STATIC_GW "192.168.0.1"
|
||||
#endif
|
||||
|
||||
void gpio_init() {
|
||||
CLOCK_EnableClock(kCLOCK_PortA);
|
||||
CLOCK_EnableClock(kCLOCK_PortB);
|
||||
CLOCK_EnableClock(kCLOCK_PortE);
|
||||
PORT_SetPinMux(BOARD_LED_RED_GPIO_PORT, BOARD_LED_RED_GPIO_PIN,
|
||||
kPORT_MuxAsGpio);
|
||||
LED_RED_INIT(0);
|
||||
PORT_SetPinMux(BOARD_LED_GREEN_GPIO_PORT, BOARD_LED_GREEN_GPIO_PIN,
|
||||
kPORT_MuxAsGpio);
|
||||
LED_GREEN_INIT(0);
|
||||
PORT_SetPinMux(BOARD_LED_BLUE_GPIO_PORT, BOARD_LED_BLUE_GPIO_PIN,
|
||||
kPORT_MuxAsGpio);
|
||||
LED_BLUE_INIT(0);
|
||||
LED_BLUE_OFF();
|
||||
}
|
||||
|
||||
void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
if (ev == MG_EV_POLL) return;
|
||||
/* printf("ev %d\r\n", ev); */
|
||||
switch (ev) {
|
||||
case MG_EV_ACCEPT: {
|
||||
char addr[32];
|
||||
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
|
||||
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
|
||||
printf("%p: Connection from %s\r\n", nc, addr);
|
||||
break;
|
||||
}
|
||||
case MG_EV_HTTP_REQUEST: {
|
||||
struct http_message *hm = (struct http_message *) ev_data;
|
||||
char addr[32];
|
||||
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
|
||||
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
|
||||
printf("%p: %.*s %.*s\r\n", nc, (int) hm->method.len, hm->method.p,
|
||||
(int) hm->uri.len, hm->uri.p);
|
||||
mg_send_response_line(nc, 200,
|
||||
"Content-Type: text/html\r\n"
|
||||
"Connection: close");
|
||||
mg_printf(nc,
|
||||
"\r\n<h1>Hello, %s!</h1>\r\n"
|
||||
"You asked for %.*s\r\n",
|
||||
addr, (int) hm->uri.len, hm->uri.p);
|
||||
nc->flags |= MG_F_SEND_AND_CLOSE;
|
||||
LED_BLUE_TOGGLE();
|
||||
break;
|
||||
}
|
||||
case MG_EV_CLOSE: {
|
||||
printf("%p: Connection closed\r\n", nc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a callback invoked by Mongoose to signal that a poll is needed soon.
|
||||
* Since we're in a tight polling loop anyway (see below), we don't need to do
|
||||
* anything.
|
||||
*/
|
||||
void mg_lwip_mgr_schedule_poll(struct mg_mgr *mgr) {
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
struct netif eth0;
|
||||
MPU_Type *base = MPU;
|
||||
BOARD_InitPins();
|
||||
BOARD_BootClockRUN();
|
||||
BOARD_InitDebugConsole();
|
||||
/* Disable MPU. */
|
||||
base->CESR &= ~MPU_CESR_VLD_MASK;
|
||||
lwip_init();
|
||||
gpio_init();
|
||||
LED_RED_ON();
|
||||
printf("Waiting for link...\r\n");
|
||||
#if USE_DHCP
|
||||
netif_add(ð0, NULL, NULL, NULL, NULL, ethernetif_init, ethernet_input);
|
||||
printf("Waiting for DHCP...\r\n");
|
||||
LED_GREEN_ON();
|
||||
dhcp_start(ð0);
|
||||
u8_t os = 0xff, ds;
|
||||
do {
|
||||
ds = eth0.dhcp->state;
|
||||
if (ds != os) {
|
||||
printf(" DHCP state: %d\r\n", ds);
|
||||
os = ds;
|
||||
}
|
||||
sys_check_timeouts();
|
||||
} while (ds != DHCP_BOUND);
|
||||
printf("DHCP bound.\r\n");
|
||||
#else
|
||||
ip_addr_t ip, nm, gw;
|
||||
if (!ipaddr_aton(STATIC_IP, &ip) || !ipaddr_aton(STATIC_NM, &nm) ||
|
||||
!ipaddr_aton(STATIC_GW, &gw)) {
|
||||
printf("Invalid static IP configuration.\r\n");
|
||||
return 1;
|
||||
} else {
|
||||
netif_add(ð0, &ip, &nm, &gw, NULL, ethernetif_init, ethernet_input);
|
||||
netif_set_up(ð0);
|
||||
}
|
||||
#endif
|
||||
netif_set_default(ð0);
|
||||
printf("Setting up HTTP server...\r\n");
|
||||
|
||||
struct mg_mgr mgr;
|
||||
mg_mgr_init(&mgr, NULL);
|
||||
|
||||
const char *err;
|
||||
struct mg_bind_opts opts = {};
|
||||
opts.error_string = &err;
|
||||
struct mg_connection *nc = mg_bind_opt(&mgr, "80", ev_handler, opts);
|
||||
if (nc == NULL) {
|
||||
printf("Failed to create listener: %s\r\n", err);
|
||||
LED_RED_ON();
|
||||
LED_GREEN_OFF();
|
||||
return 1;
|
||||
}
|
||||
mg_set_protocol_http_websocket(nc);
|
||||
printf("Server address: http://%s/\r\n", ipaddr_ntoa(ð0.ip_addr));
|
||||
LED_RED_OFF();
|
||||
LED_GREEN_ON();
|
||||
|
||||
while (1) {
|
||||
sys_check_timeouts();
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* Copyright (c) 2015, Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* o Redistributions of source code must retain the above copyright notice, this list
|
||||
* of conditions and the following disclaimer.
|
||||
*
|
||||
* o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "fsl_device_registers.h"
|
||||
#include "fsl_common.h"
|
||||
#include "fsl_port.h"
|
||||
#include "pin_mux.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Code
|
||||
******************************************************************************/
|
||||
void BOARD_InitPins(void)
|
||||
{
|
||||
port_pin_config_t configENET = {0};
|
||||
|
||||
/* Initialize UART0 pins below */
|
||||
/* Ungate the port clock */
|
||||
/* Ungate the port clock */
|
||||
CLOCK_EnableClock(kCLOCK_PortB);
|
||||
/* Affects PORTB_PCR16 register */
|
||||
PORT_SetPinMux(PORTB, 16u, kPORT_MuxAlt3);
|
||||
/* Affects PORTB_PCR17 register */
|
||||
PORT_SetPinMux(PORTB, 17u, kPORT_MuxAlt3);
|
||||
|
||||
CLOCK_EnableClock(kCLOCK_PortC);
|
||||
/* Affects PORTC_PCR16 register */
|
||||
PORT_SetPinMux(PORTC, 16u, kPORT_MuxAlt4);
|
||||
/* Affects PORTC_PCR17 register */
|
||||
PORT_SetPinMux(PORTC, 17u, kPORT_MuxAlt4);
|
||||
/* Affects PORTC_PCR18 register */
|
||||
PORT_SetPinMux(PORTC, 18u, kPORT_MuxAlt4);
|
||||
/* Affects PORTC_PCR19 register */
|
||||
PORT_SetPinMux(PORTC, 19u, kPORT_MuxAlt4);
|
||||
/* Affects PORTB_PCR1 register */
|
||||
PORT_SetPinMux(PORTB, 1u, kPORT_MuxAlt4);
|
||||
|
||||
configENET.openDrainEnable = kPORT_OpenDrainEnable;
|
||||
configENET.mux = kPORT_MuxAlt4;
|
||||
configENET.pullSelect = kPORT_PullUp;
|
||||
/* Ungate the port clock */
|
||||
CLOCK_EnableClock(kCLOCK_PortA);
|
||||
/* Affects PORTB_PCR0 register */
|
||||
PORT_SetPinConfig(PORTB, 0u, &configENET);
|
||||
|
||||
/* Affects PORTA_PCR13 register */
|
||||
PORT_SetPinMux(PORTA, 13u, kPORT_MuxAlt4);
|
||||
/* Affects PORTA_PCR12 register */
|
||||
PORT_SetPinMux(PORTA, 12u, kPORT_MuxAlt4);
|
||||
/* Affects PORTA_PCR14 register */
|
||||
PORT_SetPinMux(PORTA, 14u, kPORT_MuxAlt4);
|
||||
/* Affects PORTA_PCR5 register */
|
||||
PORT_SetPinMux(PORTA, 5u, kPORT_MuxAlt4);
|
||||
/* Affects PORTA_PCR16 register */
|
||||
PORT_SetPinMux(PORTA, 16u, kPORT_MuxAlt4);
|
||||
/* Affects PORTA_PCR17 register */
|
||||
PORT_SetPinMux(PORTA, 17u, kPORT_MuxAlt4);
|
||||
/* Affects PORTA_PCR15 register */
|
||||
PORT_SetPinMux(PORTA, 15u, kPORT_MuxAlt4);
|
||||
/* Affects PORTA_PCR28 register */
|
||||
PORT_SetPinMux(PORTA, 28u, kPORT_MuxAlt4);
|
||||
|
||||
/* Enable SW port clock */
|
||||
CLOCK_EnableClock(kCLOCK_PortA);
|
||||
/* Affects PORTA_PCR4 register */
|
||||
port_pin_config_t config = {0};
|
||||
config.pullSelect = kPORT_PullUp;
|
||||
config.mux = kPORT_MuxAsGpio;
|
||||
PORT_SetPinConfig(PORTA, 4U, &config);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* Copyright (c) 2015, Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* o Redistributions of source code must retain the above copyright notice, this list
|
||||
* of conditions and the following disclaimer.
|
||||
*
|
||||
* o Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _PIN_MUX_H_
|
||||
#define _PIN_MUX_H_
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*!
|
||||
* @brief configure all pins for this demo/example
|
||||
*
|
||||
*/
|
||||
void BOARD_InitPins(void);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _PIN_MUX_H_ */
|
||||
@@ -0,0 +1 @@
|
||||
Please download the [LPCOpen QSB SDK](https://www.embeddedartists.com/sites/default/files/support/qsb/lpc4088/lpcopen_2_10_lpcxpresso_arm_university_4088qsb.zip) and unpack it into this directory.
|
||||
@@ -0,0 +1,275 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.crt.advproject.config.exe.debug.1882216153">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.exe.debug.1882216153" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="axf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="Debug build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.exe.debug.1882216153" name="Debug" parent="com.crt.advproject.config.exe.debug" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size "${BuildArtifactFileName}"; # arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" ; # checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin"; ">
|
||||
<folderInfo id="com.crt.advproject.config.exe.debug.1882216153." name="/" resourcePath="">
|
||||
<toolChain id="com.crt.advproject.toolchain.exe.debug.2128201970" name="Code Red MCU Tools" superClass="com.crt.advproject.toolchain.exe.debug">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.exe.debug.912746979" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.exe.debug"/>
|
||||
<builder buildPath="${workspace_loc:/Mongoose_LPC4088_QSB_BM}/Debug" id="com.crt.advproject.builder.exe.debug.1371321473" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.exe.debug"/>
|
||||
<tool id="com.crt.advproject.cpp.exe.debug.1514969325" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug"/>
|
||||
<tool id="com.crt.advproject.gcc.exe.debug.458215824" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug">
|
||||
<option id="com.crt.advproject.gcc.arch.10015788" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.thumb.71629009" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1023083765" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
||||
<listOptionValue builtIn="false" value="CORE_M4"/>
|
||||
<listOptionValue builtIn="false" value="__REDLIB__"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.misc.other.1666010095" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fsingle-precision-constant" valueType="string"/>
|
||||
<option id="com.crt.advproject.gcc.hdrlib.2136945501" name="Library headers" superClass="com.crt.advproject.gcc.hdrlib" value="com.crt.advproject.gcc.hdrlib.codered" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.include.paths.916170407" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="../../../../.."/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_40xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_ea_devkit_4088/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/example/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_40xx}/../webserver/lwip/inc""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_40xx}/../webserver/lwip/inc/ipv4""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.gcc.fpu.933161555" name="Floating point" superClass="com.crt.advproject.gcc.fpu" value="com.crt.advproject.gcc.fpu.fpv4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.specs.2021862892" name="Specs" superClass="com.crt.advproject.gcc.specs" value="com.crt.advproject.gcc.specs.codered" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.misc.verbose.1004080197" name="Verbose (-v)" superClass="gnu.c.compiler.option.misc.verbose" value="false" valueType="boolean"/>
|
||||
<inputType id="com.crt.advproject.compiler.input.354631257" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gas.exe.debug.501973529" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
|
||||
<option id="com.crt.advproject.gas.arch.837659505" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.thumb.1720687740" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.656053338" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DDEBUG -D__CODE_RED -D__REDLIB__" valueType="string"/>
|
||||
<option id="com.crt.advproject.gas.hdrlib.1160701072" name="Library headers" superClass="com.crt.advproject.gas.hdrlib" value="com.crt.advproject.gas.hdrlib.codered" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.fpu.1925065374" name="Floating point" superClass="com.crt.advproject.gas.fpu" value="com.crt.advproject.gas.fpu.fpv4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.specs.2073510237" name="Specs" superClass="com.crt.advproject.gas.specs" value="com.crt.advproject.gas.specs.codered" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.115546582" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.916650704" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.link.cpp.exe.debug.810235917" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug"/>
|
||||
<tool id="com.crt.advproject.link.exe.debug.324492678" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">
|
||||
<option id="com.crt.advproject.link.arch.829579535" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.thumb.510266819" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.link.script.350895421" name="Linker script" superClass="com.crt.advproject.link.script" value=""Mongoose_LPC4088_QSB_BM_Debug.ld"" valueType="string"/>
|
||||
<option id="com.crt.advproject.link.manage.889427171" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.link.option.nostdlibs.1159445202" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.link.option.other.1069741234" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-Map="${BuildArtifactFileBaseName}.map""/>
|
||||
<listOptionValue builtIn="false" value="--gc-sections"/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.link.gcc.hdrlib.413287865" name="Library" superClass="com.crt.advproject.link.gcc.hdrlib" value="com.crt.advproject.gcc.link.hdrlib.codered.nohost" valueType="enumerated"/>
|
||||
<option id="gnu.c.link.option.libs.1297855852" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="lpc_board_ea_devkit_4088"/>
|
||||
<listOptionValue builtIn="false" value="lpc_chip_40xx"/>
|
||||
</option>
|
||||
<option id="gnu.c.link.option.paths.1003376581" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_40xx/Debug}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_ea_devkit_4088/Debug}""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.link.fpu.486337035" name="Floating point" superClass="com.crt.advproject.link.fpu" value="com.crt.advproject.link.fpu.fpv4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.1571517241" name="Multicore master" superClass="com.crt.advproject.link.gcc.multicore.master"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.userobjs.1142489770" name="Slave Objects (not visible)" superClass="com.crt.advproject.link.gcc.multicore.master.userobjs" valueType="userObjs"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.slave.1330923807" name="Multicore configuration" superClass="com.crt.advproject.link.gcc.multicore.slave"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1357197797" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="example"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="lwip"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.crt.advproject.config.exe.release.426518678">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.exe.release.426518678" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="axf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="Release build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.exe.release.426518678" name="Release" parent="com.crt.advproject.config.exe.release" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size "${BuildArtifactFileName}"; # arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" ; # checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin"; ">
|
||||
<folderInfo id="com.crt.advproject.config.exe.release.426518678." name="/" resourcePath="">
|
||||
<toolChain id="com.crt.advproject.toolchain.exe.release.1501144192" name="Code Red MCU Tools" superClass="com.crt.advproject.toolchain.exe.release">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.exe.release.1220404691" name="ARM-based MCU (Release)" superClass="com.crt.advproject.platform.exe.release"/>
|
||||
<builder buildPath="${workspace_loc:/Mongoose_LPC4088_QSB_BM}/Release" id="com.crt.advproject.builder.exe.release.703435662" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.exe.release"/>
|
||||
<tool id="com.crt.advproject.cpp.exe.release.1433389026" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.release"/>
|
||||
<tool id="com.crt.advproject.gcc.exe.release.1793760672" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.release">
|
||||
<option id="com.crt.advproject.gcc.arch.854315106" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.thumb.1298723970" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.368676434" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__REDLIB__"/>
|
||||
<listOptionValue builtIn="false" value="NDEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
||||
<listOptionValue builtIn="false" value="CORE_M4"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.misc.other.244918570" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fsingle-precision-constant" valueType="string"/>
|
||||
<option id="com.crt.advproject.gcc.hdrlib.1263825310" name="Library headers" superClass="com.crt.advproject.gcc.hdrlib" value="Redlib" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.include.paths.818921239" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_40xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_ea_devkit_4088/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/example/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lwip/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lwip/inc/ipv4}""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.gcc.fpu.341412753" name="Floating point" superClass="com.crt.advproject.gcc.fpu" value="com.crt.advproject.gcc.fpu.fpv4" valueType="enumerated"/>
|
||||
<inputType id="com.crt.advproject.compiler.input.1964857851" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gas.exe.release.1465855843" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.release">
|
||||
<option id="com.crt.advproject.gas.arch.156615847" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.thumb.304046670" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.580261315" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__REDLIB__ -DNDEBUG -D__CODE_RED" valueType="string"/>
|
||||
<option id="com.crt.advproject.gas.hdrlib.979107554" name="Library headers" superClass="com.crt.advproject.gas.hdrlib" value="Redlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.fpu.1853399316" name="Floating point" superClass="com.crt.advproject.gas.fpu" value="com.crt.advproject.gas.fpu.fpv4" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.984433225" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.1403737014" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.link.cpp.exe.release.1738219118" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.release"/>
|
||||
<tool id="com.crt.advproject.link.exe.release.561786138" name="MCU Linker" superClass="com.crt.advproject.link.exe.release">
|
||||
<option id="com.crt.advproject.link.arch.88583324" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.thumb.207282575" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.link.script.1400827349" name="Linker script" superClass="com.crt.advproject.link.script" value=""Mongoose_LPC4088_QSB_BM_Release.ld"" valueType="string"/>
|
||||
<option id="com.crt.advproject.link.manage.895977836" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.link.option.nostdlibs.764101758" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.link.option.other.1098097611" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-Map="${BuildArtifactFileBaseName}.map""/>
|
||||
<listOptionValue builtIn="false" value="--gc-sections"/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.link.gcc.hdrlib.1949931706" name="Library" superClass="com.crt.advproject.link.gcc.hdrlib" value="com.crt.advproject.gcc.link.hdrlib.codered.nohost" valueType="enumerated"/>
|
||||
<option id="gnu.c.link.option.libs.70665694" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="lpc_board_ea_devkit_4088"/>
|
||||
<listOptionValue builtIn="false" value="lpc_chip_40xx"/>
|
||||
</option>
|
||||
<option id="gnu.c.link.option.paths.102053364" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_40xx/Release}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_ea_devkit_4088/Release}""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.link.fpu.1502244730" name="Floating point" superClass="com.crt.advproject.link.fpu" value="com.crt.advproject.link.fpu.fpv4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.2040292131" name="Multicore master" superClass="com.crt.advproject.link.gcc.multicore.master"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.userobjs.1141078308" name="Slave Objects (not visible)" superClass="com.crt.advproject.link.gcc.multicore.master.userobjs" valueType="userObjs"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1927031931" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="example"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="lwip"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="Mongoose_LPC4088_QSB_BM.com.crt.advproject.projecttype.exe.319794849" name="Executable" projectType="com.crt.advproject.projecttype.exe"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="com.crt.config">
|
||||
<projectStorage><?xml version="1.0" encoding="UTF-8"?>
|
||||
<TargetConfig>
|
||||
<Properties property_0="None" property_2="LPC177x_8x_407x_8x_512.cfx" property_3="NXP" property_4="LPC4088" property_count="5" version="70200"/>
|
||||
<infoList vendor="NXP"><info chip="LPC4088" flash_driver="LPC177x_8x_407x_8x_512.cfx" match_id="0x481D3F47" name="LPC4088" stub="crt_emu_cm3_nxp"><chip><name>LPC4088</name>
|
||||
<family>LPC407x_8x</family>
|
||||
<vendor>NXP (formerly Philips)</vendor>
|
||||
<reset board="None" core="Real" sys="Real"/>
|
||||
<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/>
|
||||
<memory can_program="true" id="Flash" is_ro="true" type="Flash"/>
|
||||
<memory id="RAM" type="RAM"/>
|
||||
<memory id="Periph" is_volatile="true" type="Peripheral"/>
|
||||
<memoryInstance derived_from="Flash" edited="true" id="MFlash512" location="0x0" size="0x80000"/>
|
||||
<memoryInstance derived_from="RAM" edited="true" id="RamPeriph32" location="0x20000000" size="0x8000"/>
|
||||
<memoryInstance derived_from="RAM" edited="true" id="RamLoc64" location="0x10000000" size="0x10000"/>
|
||||
<prog_flash blocksz="0x1000" location="0x0" maxprgbuff="0x1000" progwithcode="TRUE" size="0x10000"/>
|
||||
<prog_flash blocksz="0x8000" location="0x10000" maxprgbuff="0x1000" progwithcode="TRUE" size="0x70000"/>
|
||||
<peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/>
|
||||
<peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/>
|
||||
<peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/>
|
||||
<peripheralInstance derived_from="V7M_ITM" id="ITM" location="0xe0000000"/>
|
||||
<peripheralInstance derived_from="FLASHCTRL" id="FLASHCTRL" location="0x200000"/>
|
||||
<peripheralInstance derived_from="GPDMA" id="GPDMA" location="0x20080000"/>
|
||||
<peripheralInstance derived_from="ETHERNET" id="ETHERNET" location="0x20084000"/>
|
||||
<peripheralInstance derived_from="LCD" id="LCD" location="0x20088000"/>
|
||||
<peripheralInstance derived_from="USB" id="USB" location="0x2008c000"/>
|
||||
<peripheralInstance derived_from="CRC" id="CRC" location="0x20090000"/>
|
||||
<peripheralInstance derived_from="GPIO" id="GPIO" location="0x20098000"/>
|
||||
<peripheralInstance derived_from="EMC" id="EMC" location="0x2009c000"/>
|
||||
<peripheralInstance derived_from="WWDT" id="WWDT" location="0x40000000"/>
|
||||
<peripheralInstance derived_from="TIMER0" id="TIMER0" location="0x40004000"/>
|
||||
<peripheralInstance derived_from="TIMER1" id="TIMER1" location="0x40008000"/>
|
||||
<peripheralInstance derived_from="UART0" id="UART0" location="0x4000c000"/>
|
||||
<peripheralInstance derived_from="UART1" id="UART1" location="0x40010000"/>
|
||||
<peripheralInstance derived_from="PWM0" id="PWM0" location="0x40014000"/>
|
||||
<peripheralInstance derived_from="PWM1" id="PWM1" location="0x40018000"/>
|
||||
<peripheralInstance derived_from="I2C0" id="I2C0" location="0x4001c000"/>
|
||||
<peripheralInstance derived_from="COMPARATOR" id="COMPARATOR" location="0x40020000"/>
|
||||
<peripheralInstance derived_from="RTC" id="RTC" location="0x40024000"/>
|
||||
<peripheralInstance derived_from="GPIOINT" id="GPIOINT" location="0x40028080"/>
|
||||
<peripheralInstance derived_from="IOCON" id="IOCON" location="0x4002c000"/>
|
||||
<peripheralInstance derived_from="SSP1" id="SSP1" location="0x40030000"/>
|
||||
<peripheralInstance derived_from="ADC" id="ADC" location="0x40034000"/>
|
||||
<peripheralInstance derived_from="CANAFRAM" id="CANAFRAM" location="0x40038000"/>
|
||||
<peripheralInstance derived_from="CANAF" id="CANAF" location="0x4003c000"/>
|
||||
<peripheralInstance derived_from="CCAN" id="CCAN" location="0x40040000"/>
|
||||
<peripheralInstance derived_from="CAN1" id="CAN1" location="0x40044000"/>
|
||||
<peripheralInstance derived_from="CAN2" id="CAN2" location="0x40048000"/>
|
||||
<peripheralInstance derived_from="I2C1" id="I2C1" location="0x4005c000"/>
|
||||
<peripheralInstance derived_from="SSP0" id="SSP0" location="0x40088000"/>
|
||||
<peripheralInstance derived_from="DAC" id="DAC" location="0x4008c000"/>
|
||||
<peripheralInstance derived_from="TIMER2" id="TIMER2" location="0x40090000"/>
|
||||
<peripheralInstance derived_from="TIMER3" id="TIMER3" location="0x40094000"/>
|
||||
<peripheralInstance derived_from="UART2" id="UART2" location="0x40098000"/>
|
||||
<peripheralInstance derived_from="UART3" id="UART3" location="0x4009c000"/>
|
||||
<peripheralInstance derived_from="I2C2" id="I2C2" location="0x400a0000"/>
|
||||
<peripheralInstance derived_from="UART4" id="UART4" location="0x400a4000"/>
|
||||
<peripheralInstance derived_from="I2S" id="I2S" location="0x400a8000"/>
|
||||
<peripheralInstance derived_from="SSP2" id="SSP2" location="0x400ac000"/>
|
||||
<peripheralInstance derived_from="MCPWM" id="MCPWM" location="0x400b8000"/>
|
||||
<peripheralInstance derived_from="QEI" id="QEI" location="0x400bc000"/>
|
||||
<peripheralInstance derived_from="SDMMC" id="SDMMC" location="0x400c0000"/>
|
||||
<peripheralInstance derived_from="SYSCON" id="SYSCON" location="0x400fc000"/>
|
||||
</chip>
|
||||
<processor><name gcc_name="cortex-m4">Cortex-M4</name>
|
||||
<family>Cortex-M</family>
|
||||
</processor>
|
||||
<link href="nxp_lpc407x_8x_peripheral.xme" show="embed" type="simple"/>
|
||||
</info>
|
||||
</infoList>
|
||||
</TargetConfig></projectStorage>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/Mongoose_LPC4088_QSB_BM"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Release">
|
||||
<resource resourceType="PROJECT" workspacePath="/Mongoose_LPC4088_QSB_BM"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Mongoose_LPC4088_QSB_BM</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>lpc_chip_40xx</project>
|
||||
<project>lpc_board_ea_devkit_4088</project>
|
||||
<project>webserver</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>lwip</name>
|
||||
<type>2</type>
|
||||
<locationURI>LWIP_PATH</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>example/src/mongoose.c</name>
|
||||
<type>1</type>
|
||||
<location>$%7BPARENT-4-PROJECT_LOC%7D/mongoose.c</location>
|
||||
</link>
|
||||
</linkedResources>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>LWIP_PATH</name>
|
||||
<value>$%7BSDK_PATH%7D/webserver/lwip</value>
|
||||
</variable>
|
||||
<variable>
|
||||
<name>SDK_PATH</name>
|
||||
<value>$%7BPARENT-2-PROJECT_LOC%7D/LPCOpen_QSB</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* @brief LPC17xx/LPC40xx EMAC and PHY driver configuration file for LWIP
|
||||
*
|
||||
* @note
|
||||
* Copyright(C) NXP Semiconductors, 2012
|
||||
* All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* Software that is described herein is for illustrative purposes only
|
||||
* which provides customers with programming information regarding the
|
||||
* LPC products. This software is supplied "AS IS" without any warranties of
|
||||
* any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
* all warranties, express or implied, including all implied warranties of
|
||||
* merchantability, fitness for a particular purpose and non-infringement of
|
||||
* intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
* or liability for the use of the software, conveys no license or rights under any
|
||||
* patent, copyright, mask work right, or any other intellectual property rights in
|
||||
* or to any products. NXP Semiconductors reserves the right to make changes
|
||||
* in the software without notification. NXP Semiconductors also makes no
|
||||
* representation or warranty that such application will be suitable for the
|
||||
* specified use without further testing or modification.
|
||||
*
|
||||
* @par
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation is hereby granted, under NXP Semiconductors' and its
|
||||
* licensor's relevant copyrights in the software, without fee, provided that it
|
||||
* is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
* copyright, permission, and disclaimer notice must appear in all copies of
|
||||
* this code.
|
||||
*/
|
||||
|
||||
#ifndef __LPC_17XX40XX_EMAC_CONFIG_H_
|
||||
#define __LPC_17XX40XX_EMAC_CONFIG_H_
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* The PHY address connected the to MII/RMII */
|
||||
#define LPC_PHYDEF_PHYADDR 1
|
||||
|
||||
/* Autonegotiation mode enable flag */
|
||||
#define PHY_USE_AUTONEG 1
|
||||
|
||||
/* PHY interface full duplex operation or half duplex enable flag.
|
||||
Only applies if PHY_USE_AUTONEG = 0 */
|
||||
#define PHY_USE_FULL_DUPLEX 1
|
||||
|
||||
/* PHY interface 100MBS or 10MBS enable flag.
|
||||
Only applies if PHY_USE_AUTONEG = 0 */
|
||||
#define PHY_USE_100MBS 1
|
||||
|
||||
/* Defines the number of descriptors used for RX */
|
||||
#define LPC_NUM_BUFF_RXDESCS 4
|
||||
|
||||
/* Defines the number of descriptors used for TX */
|
||||
#define LPC_NUM_BUFF_TXDESCS 4
|
||||
|
||||
/* Disable slow speed memory buffering */
|
||||
#define LPC_CHECK_SLOWMEM 0
|
||||
|
||||
/* Array of slow memory address ranges for LPC_CHECK_SLOWMEM */
|
||||
#define LPC_SLOWMEM_ARRAY
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LPC_17XX40XX_EMAC_CONFIG_H_ */
|
||||
@@ -0,0 +1,128 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* @brief LWIP build option override file
|
||||
*
|
||||
* @note
|
||||
* Copyright(C) NXP Semiconductors, 2012
|
||||
* All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* Software that is described herein is for illustrative purposes only
|
||||
* which provides customers with programming information regarding the
|
||||
* LPC products. This software is supplied "AS IS" without any warranties of
|
||||
* any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
* all warranties, express or implied, including all implied warranties of
|
||||
* merchantability, fitness for a particular purpose and non-infringement of
|
||||
* intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
* or liability for the use of the software, conveys no license or rights under any
|
||||
* patent, copyright, mask work right, or any other intellectual property rights in
|
||||
* or to any products. NXP Semiconductors reserves the right to make changes
|
||||
* in the software without notification. NXP Semiconductors also makes no
|
||||
* representation or warranty that such application will be suitable for the
|
||||
* specified use without further testing or modification.
|
||||
*
|
||||
* @par
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation is hereby granted, under NXP Semiconductors' and its
|
||||
* licensor's relevant copyrights in the software, without fee, provided that it
|
||||
* is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
* copyright, permission, and disclaimer notice must appear in all copies of
|
||||
* this code.
|
||||
*/
|
||||
|
||||
#ifndef __LWIPOPTS_H_
|
||||
#define __LWIPOPTS_H_
|
||||
|
||||
/* Standalone build */
|
||||
#define NO_SYS 1
|
||||
|
||||
//#define LWIP_DEBUG 1
|
||||
#define LPC_TX_PBUF_BOUNCE_EN 1
|
||||
//#define HTTPD_DEBUG LWIP_DBG_ON
|
||||
|
||||
/* Use LWIP timers */
|
||||
#define NO_SYS_NO_TIMERS 0
|
||||
|
||||
#define LWIP_HTTPD_DYNAMIC_HEADERS 1
|
||||
|
||||
/* Need for memory protection */
|
||||
#define SYS_LIGHTWEIGHT_PROT 0
|
||||
|
||||
/* 32-bit alignment */
|
||||
#define MEM_ALIGNMENT 4
|
||||
|
||||
/* pbuf buffers in pool. In zero-copy mode, these buffers are
|
||||
located in peripheral RAM. In copied mode, they are located in
|
||||
internal IRAM */
|
||||
#define PBUF_POOL_SIZE 7
|
||||
|
||||
/* No padding needed */
|
||||
#define ETH_PAD_SIZE 0
|
||||
|
||||
#define IP_SOF_BROADCAST 1
|
||||
#define IP_SOF_BROADCAST_RECV 1
|
||||
|
||||
/* The ethernet FCS is performed in hardware. The IP, TCP, and UDP
|
||||
CRCs still need to be done in hardware. */
|
||||
#define CHECKSUM_GEN_IP 1
|
||||
#define CHECKSUM_GEN_UDP 1
|
||||
#define CHECKSUM_GEN_TCP 1
|
||||
#define CHECKSUM_CHECK_IP 1
|
||||
#define CHECKSUM_CHECK_UDP 1
|
||||
#define CHECKSUM_CHECK_TCP 1
|
||||
#define LWIP_CHECKSUM_ON_COPY 1
|
||||
|
||||
/* Use LWIP version of htonx() to allow generic functionality across
|
||||
all platforms. If you are using the Cortex Mx devices, you might
|
||||
be able to use the Cortex __rev instruction instead. */
|
||||
#define LWIP_PLATFORM_BYTESWAP 0
|
||||
|
||||
/* Non-static memory, used with DMA pool */
|
||||
#define MEM_SIZE (12 * 1024)
|
||||
|
||||
/* Raw interface not needed */
|
||||
#define LWIP_RAW 1
|
||||
|
||||
/* DHCP is ok, UDP is required with DHCP */
|
||||
#define LWIP_DHCP 1
|
||||
#define LWIP_UDP 1
|
||||
|
||||
/* Hostname can be used */
|
||||
#define LWIP_NETIF_HOSTNAME 1
|
||||
|
||||
#define LWIP_BROADCAST_PING 1
|
||||
|
||||
/* MSS should match the hardware packet size */
|
||||
#define TCP_MSS 1460
|
||||
#define TCP_SND_BUF (2 * TCP_MSS)
|
||||
|
||||
#define LWIP_SOCKET 0
|
||||
#define LWIP_NETCONN 0
|
||||
#define MEMP_NUM_SYS_TIMEOUT 300
|
||||
|
||||
#define LWIP_STATS 0
|
||||
#define LINK_STATS 0
|
||||
#define LWIP_STATS_DISPLAY 0
|
||||
|
||||
/* There are more *_DEBUG options that can be selected.
|
||||
See opts.h. Make sure that LWIP_DEBUG is defined when
|
||||
building the code to use debug. */
|
||||
#define TCP_DEBUG LWIP_DBG_OFF
|
||||
#define ETHARP_DEBUG LWIP_DBG_OFF
|
||||
#define PBUF_DEBUG LWIP_DBG_OFF
|
||||
#define IP_DEBUG LWIP_DBG_OFF
|
||||
#define TCPIP_DEBUG LWIP_DBG_OFF
|
||||
#define DHCP_DEBUG LWIP_DBG_OFF
|
||||
#define UDP_DEBUG LWIP_DBG_OFF
|
||||
|
||||
/* This define is custom for the LPC EMAC driver. Enabled it to
|
||||
get debug messages for the driver. */
|
||||
#define EMAC_DEBUG LWIP_DBG_OFF
|
||||
|
||||
#define MEM_LIBC_MALLOC 1
|
||||
#define MEMP_MEM_MALLOC 1
|
||||
|
||||
/* Needed for malloc/free */
|
||||
#include <stdlib.h>
|
||||
|
||||
#endif /* __LWIPOPTS_H_ */
|
||||
@@ -0,0 +1,8 @@
|
||||
Mongoose Web Server example without an RTOS
|
||||
===========================================
|
||||
|
||||
This project sets up a simple Web server using the Mongoose Web Server and
|
||||
Networking library.
|
||||
|
||||
This project depends on lpc_chip_40xx and lpc_board_ea_devkit_4088 (for
|
||||
drivers) and the webserver example project (for LWIP).
|
||||
+419
@@ -0,0 +1,419 @@
|
||||
/* clang-format off */
|
||||
//*****************************************************************************
|
||||
// LPC407x_8x Microcontroller Startup code for use with LPCXpresso IDE
|
||||
//
|
||||
// Version : 140114
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Copyright(C) NXP Semiconductors, 2014
|
||||
// All rights reserved.
|
||||
//
|
||||
// Software that is described herein is for illustrative purposes only
|
||||
// which provides customers with programming information regarding the
|
||||
// LPC products. This software is supplied "AS IS" without any warranties of
|
||||
// any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
// all warranties, express or implied, including all implied warranties of
|
||||
// merchantability, fitness for a particular purpose and non-infringement of
|
||||
// intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
// or liability for the use of the software, conveys no license or rights under any
|
||||
// patent, copyright, mask work right, or any other intellectual property rights in
|
||||
// or to any products. NXP Semiconductors reserves the right to make changes
|
||||
// in the software without notification. NXP Semiconductors also makes no
|
||||
// representation or warranty that such application will be suitable for the
|
||||
// specified use without further testing or modification.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software and its
|
||||
// documentation is hereby granted, under NXP Semiconductors' and its
|
||||
// licensor's relevant copyrights in the software, without fee, provided that it
|
||||
// is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
// copyright, permission, and disclaimer notice must appear in all copies of
|
||||
// this code.
|
||||
//*****************************************************************************
|
||||
#if defined (__cplusplus)
|
||||
#ifdef __REDLIB__
|
||||
#error Redlib does not support C++
|
||||
#else
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The entry point for the C++ library startup
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern "C" {
|
||||
extern void __libc_init_array(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define WEAK __attribute__ ((weak))
|
||||
#define ALIAS(f) __attribute__ ((weak, alias (#f)))
|
||||
|
||||
//*****************************************************************************
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
#if defined (__USE_CMSIS) || defined (__USE_LPCOPEN)
|
||||
// Declaration of external SystemInit function
|
||||
extern void SystemInit(void);
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Forward declaration of the default handlers. These are aliased.
|
||||
// When the application defines a handler (with the same name), this will
|
||||
// automatically take precedence over these weak definitions
|
||||
//
|
||||
//*****************************************************************************
|
||||
void ResetISR(void);
|
||||
WEAK void NMI_Handler(void);
|
||||
WEAK void HardFault_Handler(void);
|
||||
WEAK void MemManage_Handler(void);
|
||||
WEAK void BusFault_Handler(void);
|
||||
WEAK void UsageFault_Handler(void);
|
||||
WEAK void SVC_Handler(void);
|
||||
WEAK void DebugMon_Handler(void);
|
||||
WEAK void PendSV_Handler(void);
|
||||
WEAK void SysTick_Handler(void);
|
||||
WEAK void IntDefaultHandler(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Forward declaration of the specific IRQ handlers. These are aliased
|
||||
// to the IntDefaultHandler, which is a 'forever' loop. When the application
|
||||
// defines a handler (with the same name), this will automatically take
|
||||
// precedence over these weak definitions
|
||||
//
|
||||
//*****************************************************************************
|
||||
void WDT_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void TIMER0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void TIMER1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void TIMER2_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void TIMER3_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void UART0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void UART1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void UART2_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void UART3_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void PWM1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void I2C0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void I2C1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void I2C2_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void SPI_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void SSP0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void SSP1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void PLL0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void RTC_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void EINT0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void EINT1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void EINT2_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void EINT3_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void ADC_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void BOD_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void USB_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void CAN_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void DMA_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void I2S_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#if defined (__USE_LPCOPEN)
|
||||
void ETH_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#else
|
||||
void ENET_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#endif
|
||||
void RIT_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void MCPWM_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void QEI_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void PLL1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void USBActivity_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void CANActivity_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#if defined (__USE_LPCOPEN)
|
||||
void SDIO_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#else
|
||||
void MCI_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#endif
|
||||
void UART4_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void SSP2_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void LCD_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void GPIO_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void PWM0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void EEPROM_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The entry point for the application.
|
||||
// __main() is the entry point for Redlib based applications
|
||||
// main() is the entry point for Newlib based applications
|
||||
//
|
||||
//*****************************************************************************
|
||||
#if defined (__REDLIB__)
|
||||
extern void __main(void);
|
||||
#endif
|
||||
extern int main(void);
|
||||
//*****************************************************************************
|
||||
//
|
||||
// External declaration for the pointer to the stack top from the Linker Script
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern void _vStackTop(void);
|
||||
|
||||
//*****************************************************************************
|
||||
#if defined (__cplusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The vector table.
|
||||
// This relies on the linker script to place at correct location in memory.
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern void (* const g_pfnVectors[])(void);
|
||||
__attribute__ ((section(".isr_vector")))
|
||||
void (* const g_pfnVectors[])(void) = {
|
||||
// Core Level - CM4
|
||||
&_vStackTop, // The initial stack pointer
|
||||
ResetISR, // The reset handler
|
||||
NMI_Handler, // The NMI handler
|
||||
HardFault_Handler, // The hard fault handler
|
||||
MemManage_Handler, // The MPU fault handler
|
||||
BusFault_Handler, // The bus fault handler
|
||||
UsageFault_Handler, // The usage fault handler
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
SVC_Handler, // SVCall handler
|
||||
DebugMon_Handler, // Debug monitor handler
|
||||
0, // Reserved
|
||||
PendSV_Handler, // The PendSV handler
|
||||
SysTick_Handler, // The SysTick handler
|
||||
|
||||
// Chip Level - LPC40xx
|
||||
WDT_IRQHandler, // 16, 0x40 - WDT
|
||||
TIMER0_IRQHandler, // 17, 0x44 - TIMER0
|
||||
TIMER1_IRQHandler, // 18, 0x48 - TIMER1
|
||||
TIMER2_IRQHandler, // 19, 0x4c - TIMER2
|
||||
TIMER3_IRQHandler, // 20, 0x50 - TIMER3
|
||||
UART0_IRQHandler, // 21, 0x54 - UART0
|
||||
UART1_IRQHandler, // 22, 0x58 - UART1
|
||||
UART2_IRQHandler, // 23, 0x5c - UART2
|
||||
UART3_IRQHandler, // 24, 0x60 - UART3
|
||||
PWM1_IRQHandler, // 25, 0x64 - PWM1
|
||||
I2C0_IRQHandler, // 26, 0x68 - I2C0
|
||||
I2C1_IRQHandler, // 27, 0x6c - I2C1
|
||||
I2C2_IRQHandler, // 28, 0x70 - I2C2
|
||||
IntDefaultHandler, // 29, Not used
|
||||
SSP0_IRQHandler, // 30, 0x78 - SSP0
|
||||
SSP1_IRQHandler, // 31, 0x7c - SSP1
|
||||
PLL0_IRQHandler, // 32, 0x80 - PLL0 (Main PLL)
|
||||
RTC_IRQHandler, // 33, 0x84 - RTC
|
||||
EINT0_IRQHandler, // 34, 0x88 - EINT0
|
||||
EINT1_IRQHandler, // 35, 0x8c - EINT1
|
||||
EINT2_IRQHandler, // 36, 0x90 - EINT2
|
||||
EINT3_IRQHandler, // 37, 0x94 - EINT3
|
||||
ADC_IRQHandler, // 38, 0x98 - ADC
|
||||
BOD_IRQHandler, // 39, 0x9c - BOD
|
||||
USB_IRQHandler, // 40, 0xA0 - USB
|
||||
CAN_IRQHandler, // 41, 0xa4 - CAN
|
||||
DMA_IRQHandler, // 42, 0xa8 - GP DMA
|
||||
I2S_IRQHandler, // 43, 0xac - I2S
|
||||
#if defined (__USE_LPCOPEN)
|
||||
ETH_IRQHandler, // 44, 0xb0 - Ethernet
|
||||
SDIO_IRQHandler, // 45, 0xb4 - SD/MMC card I/F
|
||||
#else
|
||||
ENET_IRQHandler, // 44, 0xb0 - Ethernet
|
||||
MCI_IRQHandler, // 45, 0xb4 - SD/MMC card I/F
|
||||
#endif
|
||||
MCPWM_IRQHandler, // 46, 0xb8 - Motor Control PWM
|
||||
QEI_IRQHandler, // 47, 0xbc - Quadrature Encoder
|
||||
PLL1_IRQHandler, // 48, 0xc0 - PLL1 (USB PLL)
|
||||
USBActivity_IRQHandler, // 49, 0xc4 - USB Activity interrupt to wakeup
|
||||
CANActivity_IRQHandler, // 50, 0xc8 - CAN Activity interrupt to wakeup
|
||||
UART4_IRQHandler, // 51, 0xcc - UART4
|
||||
SSP2_IRQHandler, // 52, 0xd0 - SSP2
|
||||
LCD_IRQHandler, // 53, 0xd4 - LCD
|
||||
GPIO_IRQHandler, // 54, 0xd8 - GPIO
|
||||
PWM0_IRQHandler, // 55, 0xdc - PWM0
|
||||
EEPROM_IRQHandler, // 56, 0xe0 - EEPROM
|
||||
|
||||
};
|
||||
|
||||
//*****************************************************************************
|
||||
// Functions to carry out the initialization of RW and BSS data sections. These
|
||||
// are written as separate functions rather than being inlined within the
|
||||
// ResetISR() function in order to cope with MCUs with multiple banks of
|
||||
// memory.
|
||||
//*****************************************************************************
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void data_init(unsigned int romstart, unsigned int start, unsigned int len) {
|
||||
unsigned int *pulDest = (unsigned int*) start;
|
||||
unsigned int *pulSrc = (unsigned int*) romstart;
|
||||
unsigned int loop;
|
||||
for (loop = 0; loop < len; loop = loop + 4)
|
||||
*pulDest++ = *pulSrc++;
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void bss_init(unsigned int start, unsigned int len) {
|
||||
unsigned int *pulDest = (unsigned int*) start;
|
||||
unsigned int loop;
|
||||
for (loop = 0; loop < len; loop = loop + 4)
|
||||
*pulDest++ = 0;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// The following symbols are constructs generated by the linker, indicating
|
||||
// the location of various points in the "Global Section Table". This table is
|
||||
// created by the linker via the Code Red managed linker script mechanism. It
|
||||
// contains the load address, execution address and length of each RW data
|
||||
// section and the execution and length of each BSS (zero initialized) section.
|
||||
//*****************************************************************************
|
||||
extern unsigned int __data_section_table;
|
||||
extern unsigned int __data_section_table_end;
|
||||
extern unsigned int __bss_section_table;
|
||||
extern unsigned int __bss_section_table_end;
|
||||
|
||||
//*****************************************************************************
|
||||
// Reset entry point for your code.
|
||||
// Sets up a simple runtime environment and initializes the C/C++
|
||||
// library.
|
||||
//*****************************************************************************
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void
|
||||
ResetISR(void) {
|
||||
|
||||
//
|
||||
// Copy the data sections from flash to SRAM.
|
||||
//
|
||||
unsigned int LoadAddr, ExeAddr, SectionLen;
|
||||
unsigned int *SectionTableAddr;
|
||||
|
||||
// Load base address of Global Section Table
|
||||
SectionTableAddr = &__data_section_table;
|
||||
|
||||
// Copy the data sections from flash to SRAM.
|
||||
while (SectionTableAddr < &__data_section_table_end) {
|
||||
LoadAddr = *SectionTableAddr++;
|
||||
ExeAddr = *SectionTableAddr++;
|
||||
SectionLen = *SectionTableAddr++;
|
||||
data_init(LoadAddr, ExeAddr, SectionLen);
|
||||
}
|
||||
// At this point, SectionTableAddr = &__bss_section_table;
|
||||
// Zero fill the bss segment
|
||||
while (SectionTableAddr < &__bss_section_table_end) {
|
||||
ExeAddr = *SectionTableAddr++;
|
||||
SectionLen = *SectionTableAddr++;
|
||||
bss_init(ExeAddr, SectionLen);
|
||||
}
|
||||
|
||||
#if defined (__VFP_FP__) && !defined (__SOFTFP__)
|
||||
/*
|
||||
* Code to enable the Cortex-M4 FPU only included
|
||||
* if appropriate build options have been selected.
|
||||
* Code taken from Section 7.1, Cortex-M4 TRM (DDI0439C)
|
||||
*/
|
||||
// Read CPACR (located at address 0xE000ED88)
|
||||
// Set bits 20-23 to enable CP10 and CP11 coprocessors
|
||||
// Write back the modified value to the CPACR
|
||||
asm volatile ("LDR.W R0, =0xE000ED88\n\t"
|
||||
"LDR R1, [R0]\n\t"
|
||||
"ORR R1, R1, #(0xF << 20)\n\t"
|
||||
"STR R1, [R0]");
|
||||
#endif // (__VFP_FP__) && !(__SOFTFP__)
|
||||
|
||||
// Check to see if we are running the code from a non-zero
|
||||
// address (eg RAM, external flash), in which case we need
|
||||
// to modify the VTOR register to tell the CPU that the
|
||||
// vector table is located at a non-0x0 address.
|
||||
|
||||
// Note that we do not use the CMSIS register access mechanism,
|
||||
// as there is no guarantee that the project has been configured
|
||||
// to use CMSIS.
|
||||
unsigned int * pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
if ((unsigned int *)g_pfnVectors!=(unsigned int *) 0x00000000) {
|
||||
// CMSIS : SCB->VTOR = <address of vector table>
|
||||
*pSCB_VTOR = (unsigned int)g_pfnVectors;
|
||||
}
|
||||
|
||||
#if defined (__USE_CMSIS) || defined (__USE_LPCOPEN)
|
||||
SystemInit();
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus)
|
||||
//
|
||||
// Call C++ library initialisation
|
||||
//
|
||||
__libc_init_array();
|
||||
#endif
|
||||
|
||||
#if defined (__REDLIB__)
|
||||
// Call the Redlib library, which in turn calls main()
|
||||
__main() ;
|
||||
#else
|
||||
main();
|
||||
#endif
|
||||
|
||||
//
|
||||
// main() shouldn't return, but if it does, we'll just enter an infinite loop
|
||||
//
|
||||
while (1) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// Default exception handlers. Override the ones here by defining your own
|
||||
// handler routines in your application code.
|
||||
//*****************************************************************************
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void NMI_Handler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void HardFault_Handler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void MemManage_Handler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void BusFault_Handler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void UsageFault_Handler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void SVC_Handler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void DebugMon_Handler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void PendSV_Handler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void SysTick_Handler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Processor ends up here if an unexpected interrupt occurs or a specific
|
||||
// handler is not present in the application code.
|
||||
//
|
||||
//*****************************************************************************
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void IntDefaultHandler(void)
|
||||
{ while(1) {}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Cesanta Software Limited
|
||||
* All rights reserved
|
||||
*/
|
||||
|
||||
#include "mongoose.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "lwip/dhcp.h"
|
||||
#include "lwip/init.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/timers.h"
|
||||
#include "netif/etharp.h"
|
||||
|
||||
#include "board.h"
|
||||
#include "lpc_phy.h"
|
||||
#include "arch/lpc17xx_40xx_emac.h"
|
||||
#include "arch/lpc_arch.h"
|
||||
|
||||
/* IP address configuration. */
|
||||
#define USE_DHCP 1 /* For static IP, set to 0 and configure options below */
|
||||
#if !USE_DHCP
|
||||
#define STATIC_IP "192.168.0.111"
|
||||
#define STATIC_NM "255.255.255.0"
|
||||
#define STATIC_GW "192.168.0.1"
|
||||
#endif
|
||||
|
||||
void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
if (ev == MG_EV_POLL) return;
|
||||
/* printf("ev %d\r\n", ev); */
|
||||
switch (ev) {
|
||||
case MG_EV_ACCEPT: {
|
||||
char addr[32];
|
||||
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
|
||||
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
|
||||
printf("%p: Connection from %s\r\n", nc, addr);
|
||||
break;
|
||||
}
|
||||
case MG_EV_HTTP_REQUEST: {
|
||||
struct http_message *hm = (struct http_message *) ev_data;
|
||||
char addr[32];
|
||||
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
|
||||
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
|
||||
printf("%p: %.*s %.*s\r\n", nc, (int) hm->method.len, hm->method.p,
|
||||
(int) hm->uri.len, hm->uri.p);
|
||||
mg_send_response_line(nc, 200,
|
||||
"Content-Type: text/html\r\n"
|
||||
"Connection: close");
|
||||
mg_printf(nc,
|
||||
"\r\n<h1>Hello, %s!</h1>\r\n"
|
||||
"You asked for %.*s\r\n",
|
||||
addr, (int) hm->uri.len, hm->uri.p);
|
||||
nc->flags |= MG_F_SEND_AND_CLOSE;
|
||||
Board_LED_Toggle(2);
|
||||
break;
|
||||
}
|
||||
case MG_EV_CLOSE: {
|
||||
printf("%p: Connection closed\r\n", nc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void handle_eth(struct netif *eth_if) {
|
||||
/* PHY link status. */
|
||||
uint32_t status = lpcPHYStsPoll();
|
||||
|
||||
if (status & PHY_LINK_CHANGED) {
|
||||
if (status & PHY_LINK_CONNECTED) {
|
||||
Board_LED_Set(0, true);
|
||||
|
||||
if (status & PHY_LINK_SPEED100) {
|
||||
Chip_ENET_Set100Mbps(LPC_ETHERNET);
|
||||
} else {
|
||||
Chip_ENET_Set10Mbps(LPC_ETHERNET);
|
||||
}
|
||||
if (status & PHY_LINK_FULLDUPLX) {
|
||||
Chip_ENET_SetFullDuplex(LPC_ETHERNET);
|
||||
} else {
|
||||
Chip_ENET_SetHalfDuplex(LPC_ETHERNET);
|
||||
}
|
||||
|
||||
netif_set_link_up(eth_if);
|
||||
printf("Link up\r\n");
|
||||
} else {
|
||||
Board_LED_Set(0, false);
|
||||
netif_set_link_down(eth_if);
|
||||
printf("Link down\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
Board_LED_Set(1, (eth_if->dhcp->state == DHCP_BOUND));
|
||||
|
||||
/* Handle packets as part of this loop, not in the IRQ handler */
|
||||
lpc_enetif_input(eth_if);
|
||||
|
||||
/* Free TX buffers that are done sending */
|
||||
lpc_tx_reclaim(eth_if);
|
||||
}
|
||||
|
||||
int gettimeofday(struct timeval *tv, void *tzvp) {
|
||||
tv->tv_sec = time(NULL);
|
||||
tv->tv_usec = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a callback invoked by Mongoose to signal that a poll is needed soon.
|
||||
* Since we're in a tight polling loop anyway (see below), we don't need to do
|
||||
* anything.
|
||||
*/
|
||||
void mg_lwip_mgr_schedule_poll(struct mg_mgr *mgr) {
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
struct netif eth0;
|
||||
|
||||
SystemCoreClockUpdate();
|
||||
Board_Init();
|
||||
SysTick_Enable(1);
|
||||
|
||||
lwip_init();
|
||||
|
||||
Board_LED_Set(0, false); /* Link state */
|
||||
Board_LED_Set(1, false); /* DHCP state */
|
||||
Board_LED_Set(2, false); /* HTTP request activity indicator */
|
||||
Board_LED_Set(3, false); /* Error indicator */
|
||||
|
||||
#if USE_DHCP
|
||||
netif_add(ð0, NULL, NULL, NULL, NULL, lpc_enetif_init, ethernet_input);
|
||||
printf("Waiting for DHCP...\r\n");
|
||||
dhcp_start(ð0);
|
||||
u8_t os = 0xff, ds;
|
||||
do {
|
||||
ds = eth0.dhcp->state;
|
||||
if (ds != os) {
|
||||
printf(" DHCP state: %d\r\n", ds);
|
||||
os = ds;
|
||||
}
|
||||
handle_eth(ð0);
|
||||
sys_check_timeouts();
|
||||
} while (ds != DHCP_BOUND);
|
||||
printf("DHCP bound.\r\n");
|
||||
#else
|
||||
ip_addr_t ip, nm, gw;
|
||||
if (!ipaddr_aton(STATIC_IP, &ip) || !ipaddr_aton(STATIC_NM, &nm) ||
|
||||
!ipaddr_aton(STATIC_GW, &gw)) {
|
||||
printf("Invalid static IP configuration.\r\n");
|
||||
Board_LED_Set(3, true);
|
||||
return 1;
|
||||
} else {
|
||||
netif_add(ð0, &ip, &nm, &gw, NULL, lpc_enetif_init, ethernet_input);
|
||||
netif_set_up(ð0);
|
||||
}
|
||||
#endif
|
||||
netif_set_default(ð0);
|
||||
printf("Setting up HTTP server...\r\n");
|
||||
|
||||
struct mg_mgr mgr;
|
||||
mg_mgr_init(&mgr, NULL);
|
||||
|
||||
const char *err;
|
||||
struct mg_bind_opts opts = {};
|
||||
opts.error_string = &err;
|
||||
struct mg_connection *nc = mg_bind_opt(&mgr, "80", ev_handler, opts);
|
||||
if (nc == NULL) {
|
||||
printf("Failed to create listener: %s\r\n", err);
|
||||
Board_LED_Set(3, true);
|
||||
return 1;
|
||||
}
|
||||
mg_set_protocol_http_websocket(nc);
|
||||
printf("Server address: http://%s/\r\n", ipaddr_ntoa(ð0.ip_addr));
|
||||
|
||||
while (1) {
|
||||
/* Ethernet link status, low level input. */
|
||||
handle_eth(ð0);
|
||||
|
||||
/* LWIP timers - ARP, DHCP, TCP, etc. */
|
||||
sys_check_timeouts();
|
||||
|
||||
/* Mongoose poll */
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/* clang-format off */
|
||||
/*
|
||||
* @brief Common SystemInit function for LPC17xx/40xx chips
|
||||
*
|
||||
* @note
|
||||
* Copyright(C) NXP Semiconductors, 2013
|
||||
* All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* Software that is described herein is for illustrative purposes only
|
||||
* which provides customers with programming information regarding the
|
||||
* LPC products. This software is supplied "AS IS" without any warranties of
|
||||
* any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
* all warranties, express or implied, including all implied warranties of
|
||||
* merchantability, fitness for a particular purpose and non-infringement of
|
||||
* intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
* or liability for the use of the software, conveys no license or rights under any
|
||||
* patent, copyright, mask work right, or any other intellectual property rights in
|
||||
* or to any products. NXP Semiconductors reserves the right to make changes
|
||||
* in the software without notification. NXP Semiconductors also makes no
|
||||
* representation or warranty that such application will be suitable for the
|
||||
* specified use without further testing or modification.
|
||||
*
|
||||
* @par
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation is hereby granted, under NXP Semiconductors' and its
|
||||
* licensor's relevant copyrights in the software, without fee, provided that it
|
||||
* is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
* copyright, permission, and disclaimer notice must appear in all copies of
|
||||
* this code.
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* Private types/enumerations/variables
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Public types/enumerations/variables
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Private functions
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Public functions
|
||||
****************************************************************************/
|
||||
|
||||
/* Set up and initialize hardware prior to call to main */
|
||||
void SystemInit(void)
|
||||
{
|
||||
unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
|
||||
#if defined(__IAR_SYSTEMS_ICC__)
|
||||
extern void *__vector_table;
|
||||
|
||||
*pSCB_VTOR = (unsigned int) &__vector_table;
|
||||
#elif defined(__CODE_RED)
|
||||
extern void *g_pfnVectors;
|
||||
|
||||
*pSCB_VTOR = (unsigned int) &g_pfnVectors;
|
||||
#elif defined(__ARMCC_VERSION)
|
||||
extern void *__Vectors;
|
||||
|
||||
*pSCB_VTOR = (unsigned int) &__Vectors;
|
||||
#endif
|
||||
|
||||
#if defined(__FPU_PRESENT) && __FPU_PRESENT == 1
|
||||
fpuInit();
|
||||
#endif
|
||||
|
||||
#if defined(NO_BOARD_LIB)
|
||||
/* Chip specific SystemInit */
|
||||
Chip_SystemInit();
|
||||
#else
|
||||
/* Setup system clocking and muxing */
|
||||
Board_SystemInit();
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
Mongoose Web Server example without an RTOS
|
||||
===========================================
|
||||
|
||||
This project sets up a simple Web server using the Mongoose Web Server and
|
||||
Networking library.
|
||||
|
||||
This project is based on the [LPC4088 QuickStart Board](https://www.embeddedartists.com/products/boards/lpc4088_qsb.php) from Embedded Artists.
|
||||
|
||||
Please download the [modified LPCOpen SDK](https://www.embeddedartists.com/sites/default/files/support/qsb/lpc4088/lpcopen_2_10_lpcxpresso_arm_university_4088qsb.zip)
|
||||
and unpack it into the `LPCOpen_QSB` directory.
|
||||
|
||||
This project depends on `lpc_chip_40xx` and `lpc_board_ea_devkit_4088` (for drivers)
|
||||
and the `webserver` example project (for LWIP). Please import them along with this project.
|
||||
|
||||
By default, the project uses DHCP to obtain an IP address.
|
||||
If you want to configure a static IP address, please edit the settings at the top of `example/src/main.c`.
|
||||
@@ -0,0 +1,113 @@
|
||||
#
|
||||
# There exist several targets which are by default empty and which can be
|
||||
# used for execution of your targets. These targets are usually executed
|
||||
# before and after some main targets. They are:
|
||||
#
|
||||
# .build-pre: called before 'build' target
|
||||
# .build-post: called after 'build' target
|
||||
# .clean-pre: called before 'clean' target
|
||||
# .clean-post: called after 'clean' target
|
||||
# .clobber-pre: called before 'clobber' target
|
||||
# .clobber-post: called after 'clobber' target
|
||||
# .all-pre: called before 'all' target
|
||||
# .all-post: called after 'all' target
|
||||
# .help-pre: called before 'help' target
|
||||
# .help-post: called after 'help' target
|
||||
#
|
||||
# Targets beginning with '.' are not intended to be called on their own.
|
||||
#
|
||||
# Main targets can be executed directly, and they are:
|
||||
#
|
||||
# build build a specific configuration
|
||||
# clean remove built files from a configuration
|
||||
# clobber remove all built files
|
||||
# all build all configurations
|
||||
# help print help mesage
|
||||
#
|
||||
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
|
||||
# .help-impl are implemented in nbproject/makefile-impl.mk.
|
||||
#
|
||||
# Available make variables:
|
||||
#
|
||||
# CND_BASEDIR base directory for relative paths
|
||||
# CND_DISTDIR default top distribution directory (build artifacts)
|
||||
# CND_BUILDDIR default top build directory (object files, ...)
|
||||
# CONF name of current configuration
|
||||
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
|
||||
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
|
||||
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
|
||||
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
|
||||
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
|
||||
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
|
||||
#
|
||||
# NOCDDL
|
||||
|
||||
|
||||
# Environment
|
||||
MKDIR=mkdir
|
||||
CP=cp
|
||||
CCADMIN=CCadmin
|
||||
RANLIB=ranlib
|
||||
|
||||
|
||||
# build
|
||||
build: .build-post
|
||||
|
||||
.build-pre:
|
||||
# Add your pre 'build' code here...
|
||||
|
||||
.build-post: .build-impl
|
||||
# Add your post 'build' code here...
|
||||
|
||||
|
||||
# clean
|
||||
clean: .clean-post
|
||||
|
||||
.clean-pre:
|
||||
# Add your pre 'clean' code here...
|
||||
# WARNING: the IDE does not call this target since it takes a long time to
|
||||
# simply run make. Instead, the IDE removes the configuration directories
|
||||
# under build and dist directly without calling make.
|
||||
# This target is left here so people can do a clean when running a clean
|
||||
# outside the IDE.
|
||||
|
||||
.clean-post: .clean-impl
|
||||
# Add your post 'clean' code here...
|
||||
|
||||
|
||||
# clobber
|
||||
clobber: .clobber-post
|
||||
|
||||
.clobber-pre:
|
||||
# Add your pre 'clobber' code here...
|
||||
|
||||
.clobber-post: .clobber-impl
|
||||
# Add your post 'clobber' code here...
|
||||
|
||||
|
||||
# all
|
||||
all: .all-post
|
||||
|
||||
.all-pre:
|
||||
# Add your pre 'all' code here...
|
||||
|
||||
.all-post: .all-impl
|
||||
# Add your post 'all' code here...
|
||||
|
||||
|
||||
# help
|
||||
help: .help-post
|
||||
|
||||
.help-pre:
|
||||
# Add your pre 'help' code here...
|
||||
|
||||
.help-post: .help-impl
|
||||
# Add your post 'help' code here...
|
||||
|
||||
|
||||
|
||||
# include project implementation makefile
|
||||
include nbproject/Makefile-impl.mk
|
||||
|
||||
# include project make variables
|
||||
include nbproject/Makefile-variables.mk
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#Wed Oct 26 16:05:10 EEST 2016
|
||||
pic32mx_eth_sk2_encx24j600.languagetoolchain.dir=/opt/microchip/xc32/v1.42/bin
|
||||
pic32mx_eth_sk2_encx24j600.com-microchip-mplab-nbide-toolchainXC32-XC32LanguageToolchain.md5=7787462309de955deefcc6f5508f88a9
|
||||
pic32mx_eth_sk2_encx24j600.languagetoolchain.version=1.42
|
||||
configurations-xml=2f70242829ecb692b68d01a3f7c4e1e7
|
||||
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=02b44c60b7ea0aab28d65f169487b894
|
||||
host.platform=linux
|
||||
conf.ids=pic32mx_eth_sk2_encx24j600
|
||||
@@ -0,0 +1,69 @@
|
||||
#
|
||||
# Generated Makefile - do not edit!
|
||||
#
|
||||
# Edit the Makefile in the project folder instead (../Makefile). Each target
|
||||
# has a pre- and a post- target defined where you can add customization code.
|
||||
#
|
||||
# This makefile implements macros and targets common to all configurations.
|
||||
#
|
||||
# NOCDDL
|
||||
|
||||
|
||||
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
|
||||
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
|
||||
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
|
||||
# and .clean-reqprojects-conf unless SUB has the value 'no'
|
||||
SUB_no=NO
|
||||
SUBPROJECTS=${SUB_${SUB}}
|
||||
BUILD_SUBPROJECTS_=.build-subprojects
|
||||
BUILD_SUBPROJECTS_NO=
|
||||
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
|
||||
CLEAN_SUBPROJECTS_=.clean-subprojects
|
||||
CLEAN_SUBPROJECTS_NO=
|
||||
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
|
||||
|
||||
|
||||
# Project Name
|
||||
PROJECTNAME=http_server.X
|
||||
|
||||
# Active Configuration
|
||||
DEFAULTCONF=pic32mx_eth_sk2_encx24j600
|
||||
CONF=${DEFAULTCONF}
|
||||
|
||||
# All Configurations
|
||||
ALLCONFS=pic32mx_eth_sk2_encx24j600
|
||||
|
||||
|
||||
# build
|
||||
.build-impl: .build-pre
|
||||
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
|
||||
|
||||
|
||||
# clean
|
||||
.clean-impl: .clean-pre
|
||||
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
|
||||
|
||||
# clobber
|
||||
.clobber-impl: .clobber-pre .depcheck-impl
|
||||
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=pic32mx_eth_sk2_encx24j600 clean
|
||||
|
||||
|
||||
|
||||
# all
|
||||
.all-impl: .all-pre .depcheck-impl
|
||||
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=pic32mx_eth_sk2_encx24j600 build
|
||||
|
||||
|
||||
|
||||
# dependency checking support
|
||||
.depcheck-impl:
|
||||
# @echo "# This code depends on make tool being used" >.dep.inc
|
||||
# @if [ -n "${MAKE_VERSION}" ]; then \
|
||||
# echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
|
||||
# echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
|
||||
# echo "include \$${DEPFILES}" >>.dep.inc; \
|
||||
# echo "endif" >>.dep.inc; \
|
||||
# else \
|
||||
# echo ".KEEP_STATE:" >>.dep.inc; \
|
||||
# echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
|
||||
# fi
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# Generated Makefile - do not edit!
|
||||
#
|
||||
#
|
||||
# This file contains information about the location of compilers and other tools.
|
||||
# If you commmit this file into your revision control server, you will be able to
|
||||
# to checkout the project and build it from the command line with make. However,
|
||||
# if more than one person works on the same project, then this file might show
|
||||
# conflicts since different users are bound to have compilers in different places.
|
||||
# In that case you might choose to not commit this file and let MPLAB X recreate this file
|
||||
# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at
|
||||
# least once so the file gets created and the project can be built. Finally, you can also
|
||||
# avoid using this file at all if you are only building from the command line with make.
|
||||
# You can invoke make with the values of the macros:
|
||||
# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ...
|
||||
#
|
||||
PATH_TO_IDE_BIN=/opt/microchip/mplabx/v3.40/mplab_ide/platform/../mplab_ide/modules/../../bin/
|
||||
# Adding MPLAB X bin directory to path.
|
||||
PATH:=/opt/microchip/mplabx/v3.40/mplab_ide/platform/../mplab_ide/modules/../../bin/:$(PATH)
|
||||
# Path to java used to run MPLAB X when this makefile was created
|
||||
MP_JAVA_PATH="/opt/microchip/mplabx/v3.40/sys/java/jre1.8.0_91/bin/"
|
||||
OS_CURRENT="$(shell uname -s)"
|
||||
MP_CC="/opt/microchip/xc32/v1.42/bin/xc32-gcc"
|
||||
MP_CPPC="/opt/microchip/xc32/v1.42/bin/xc32-g++"
|
||||
# MP_BC is not defined
|
||||
MP_AS="/opt/microchip/xc32/v1.42/bin/xc32-as"
|
||||
MP_LD="/opt/microchip/xc32/v1.42/bin/xc32-ld"
|
||||
MP_AR="/opt/microchip/xc32/v1.42/bin/xc32-ar"
|
||||
DEP_GEN=${MP_JAVA_PATH}java -jar "/opt/microchip/mplabx/v3.40/mplab_ide/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
|
||||
MP_CC_DIR="/opt/microchip/xc32/v1.42/bin"
|
||||
MP_CPPC_DIR="/opt/microchip/xc32/v1.42/bin"
|
||||
# MP_BC_DIR is not defined
|
||||
MP_AS_DIR="/opt/microchip/xc32/v1.42/bin"
|
||||
MP_LD_DIR="/opt/microchip/xc32/v1.42/bin"
|
||||
MP_AR_DIR="/opt/microchip/xc32/v1.42/bin"
|
||||
# MP_BC_DIR is not defined
|
||||
+1011
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# Generated - do not edit!
|
||||
#
|
||||
# NOCDDL
|
||||
#
|
||||
CND_BASEDIR=`pwd`
|
||||
# pic32mx_eth_sk2_encx24j600 configuration
|
||||
CND_ARTIFACT_DIR_pic32mx_eth_sk2_encx24j600=dist/pic32mx_eth_sk2_encx24j600/production
|
||||
CND_ARTIFACT_NAME_pic32mx_eth_sk2_encx24j600=http_server.X.production.hex
|
||||
CND_ARTIFACT_PATH_pic32mx_eth_sk2_encx24j600=dist/pic32mx_eth_sk2_encx24j600/production/http_server.X.production.hex
|
||||
CND_PACKAGE_DIR_pic32mx_eth_sk2_encx24j600=${CND_DISTDIR}/pic32mx_eth_sk2_encx24j600/package
|
||||
CND_PACKAGE_NAME_pic32mx_eth_sk2_encx24j600=httpserver.x.tar
|
||||
CND_PACKAGE_PATH_pic32mx_eth_sk2_encx24j600=${CND_DISTDIR}/pic32mx_eth_sk2_encx24j600/package/httpserver.x.tar
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
#
|
||||
# Generated - do not edit!
|
||||
#
|
||||
|
||||
# Macros
|
||||
TOP=`pwd`
|
||||
CND_CONF=pic32mx_eth_sk2_encx24j600
|
||||
CND_DISTDIR=dist
|
||||
TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging
|
||||
TMPDIRNAME=tmp-packaging
|
||||
OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/http_server.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
|
||||
OUTPUT_BASENAME=http_server.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
|
||||
PACKAGE_TOP_DIR=httpserver.x/
|
||||
|
||||
# Functions
|
||||
function checkReturnCode
|
||||
{
|
||||
rc=$?
|
||||
if [ $rc != 0 ]
|
||||
then
|
||||
exit $rc
|
||||
fi
|
||||
}
|
||||
function makeDirectory
|
||||
# $1 directory path
|
||||
# $2 permission (optional)
|
||||
{
|
||||
mkdir -p "$1"
|
||||
checkReturnCode
|
||||
if [ "$2" != "" ]
|
||||
then
|
||||
chmod $2 "$1"
|
||||
checkReturnCode
|
||||
fi
|
||||
}
|
||||
function copyFileToTmpDir
|
||||
# $1 from-file path
|
||||
# $2 to-file path
|
||||
# $3 permission
|
||||
{
|
||||
cp "$1" "$2"
|
||||
checkReturnCode
|
||||
if [ "$3" != "" ]
|
||||
then
|
||||
chmod $3 "$2"
|
||||
checkReturnCode
|
||||
fi
|
||||
}
|
||||
|
||||
# Setup
|
||||
cd "${TOP}"
|
||||
mkdir -p ${CND_DISTDIR}/${CND_CONF}/package
|
||||
rm -rf ${TMPDIR}
|
||||
mkdir -p ${TMPDIR}
|
||||
|
||||
# Copy files and create directories and links
|
||||
cd "${TOP}"
|
||||
makeDirectory ${TMPDIR}/httpserver.x/bin
|
||||
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
|
||||
|
||||
|
||||
# Generate tar file
|
||||
cd "${TOP}"
|
||||
rm -f ${CND_DISTDIR}/${CND_CONF}/package/httpserver.x.tar
|
||||
cd ${TMPDIR}
|
||||
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/httpserver.x.tar *
|
||||
checkReturnCode
|
||||
|
||||
# Cleanup
|
||||
cd "${TOP}"
|
||||
rm -rf ${TMPDIR}
|
||||
File diff suppressed because it is too large.
Load diff
+25
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configurationDescriptor version="62">
|
||||
<projectmakefile>Makefile</projectmakefile>
|
||||
<defaultConf>0</defaultConf>
|
||||
<confs>
|
||||
<conf name="pic32mx_eth_sk2_encx24j600" type="2">
|
||||
<platformToolSN>:=MPLABComm-USB-Microchip:=<vid>04D8:=<pid>8107:=<rev>0002:=<man>Microchip Technology Incorporated:=<prod>Explorer 16/32 PICkit on Board:=<sn>BUR162971352:=<drv>x:=<xpt>h:=end</platformToolSN>
|
||||
<languageToolchainDir>/opt/microchip/xc32/v1.42/bin</languageToolchainDir>
|
||||
<mdbdebugger version="1">
|
||||
<placeholder1>place holder 1</placeholder1>
|
||||
<placeholder2>place holder 2</placeholder2>
|
||||
</mdbdebugger>
|
||||
<runprofile version="6">
|
||||
<args></args>
|
||||
<rundir></rundir>
|
||||
<buildfirst>true</buildfirst>
|
||||
<console-type>0</console-type>
|
||||
<terminal-type>0</terminal-type>
|
||||
<remove-instrumentation>0</remove-instrumentation>
|
||||
<environment>
|
||||
</environment>
|
||||
</runprofile>
|
||||
</conf>
|
||||
</confs>
|
||||
</configurationDescriptor>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||
<group>
|
||||
<file>file:/home/alex/go/src/cesanta.com/mongoose/examples/PIC32/http_server/firmware/src/app.c</file>
|
||||
<file>file:/home/alex/go/src/cesanta.com/mongoose/examples/PIC32/http_server/firmware/src/app.h</file>
|
||||
</group>
|
||||
</open-files>
|
||||
</project-private>
|
||||
Loaded 100 of 224 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user