ProjetoBB
Dependencies: F7_Ethernet WebSocketClient mbed mcp3008
Fork of Nucleo_F746ZG_Ethernet by
F7_Ethernet/lwip/include/netif/slipif.h@0:f9b6112278fe, 2016-06-18 (annotated)
- Committer:
- DieterGraef
- Date:
- Sat Jun 18 10:49:12 2016 +0000
- Revision:
- 0:f9b6112278fe
Ethernet for the NUCLEO STM32F746 Board Testprogram uses DHCP and NTP to set the clock
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DieterGraef | 0:f9b6112278fe | 1 | /* |
DieterGraef | 0:f9b6112278fe | 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. |
DieterGraef | 0:f9b6112278fe | 3 | * All rights reserved. |
DieterGraef | 0:f9b6112278fe | 4 | * |
DieterGraef | 0:f9b6112278fe | 5 | * Redistribution and use in source and binary forms, with or without |
DieterGraef | 0:f9b6112278fe | 6 | * modification, are permitted provided that the following conditions |
DieterGraef | 0:f9b6112278fe | 7 | * are met: |
DieterGraef | 0:f9b6112278fe | 8 | * 1. Redistributions of source code must retain the above copyright |
DieterGraef | 0:f9b6112278fe | 9 | * notice, this list of conditions and the following disclaimer. |
DieterGraef | 0:f9b6112278fe | 10 | * 2. Redistributions in binary form must reproduce the above copyright |
DieterGraef | 0:f9b6112278fe | 11 | * notice, this list of conditions and the following disclaimer in the |
DieterGraef | 0:f9b6112278fe | 12 | * documentation and/or other materials provided with the distribution. |
DieterGraef | 0:f9b6112278fe | 13 | * 3. Neither the name of the Institute nor the names of its contributors |
DieterGraef | 0:f9b6112278fe | 14 | * may be used to endorse or promote products derived from this software |
DieterGraef | 0:f9b6112278fe | 15 | * without specific prior written permission. |
DieterGraef | 0:f9b6112278fe | 16 | * |
DieterGraef | 0:f9b6112278fe | 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND |
DieterGraef | 0:f9b6112278fe | 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
DieterGraef | 0:f9b6112278fe | 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
DieterGraef | 0:f9b6112278fe | 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE |
DieterGraef | 0:f9b6112278fe | 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
DieterGraef | 0:f9b6112278fe | 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
DieterGraef | 0:f9b6112278fe | 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
DieterGraef | 0:f9b6112278fe | 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
DieterGraef | 0:f9b6112278fe | 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
DieterGraef | 0:f9b6112278fe | 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
DieterGraef | 0:f9b6112278fe | 27 | * SUCH DAMAGE. |
DieterGraef | 0:f9b6112278fe | 28 | * |
DieterGraef | 0:f9b6112278fe | 29 | * This file is part of the lwIP TCP/IP stack. |
DieterGraef | 0:f9b6112278fe | 30 | * |
DieterGraef | 0:f9b6112278fe | 31 | * Author: Adam Dunkels <adam@sics.se> |
DieterGraef | 0:f9b6112278fe | 32 | * |
DieterGraef | 0:f9b6112278fe | 33 | */ |
DieterGraef | 0:f9b6112278fe | 34 | #ifndef __NETIF_SLIPIF_H__ |
DieterGraef | 0:f9b6112278fe | 35 | #define __NETIF_SLIPIF_H__ |
DieterGraef | 0:f9b6112278fe | 36 | |
DieterGraef | 0:f9b6112278fe | 37 | #include "lwip/opt.h" |
DieterGraef | 0:f9b6112278fe | 38 | #include "lwip/netif.h" |
DieterGraef | 0:f9b6112278fe | 39 | |
DieterGraef | 0:f9b6112278fe | 40 | /** Set this to 1 to start a thread that blocks reading on the serial line |
DieterGraef | 0:f9b6112278fe | 41 | * (using sio_read()). |
DieterGraef | 0:f9b6112278fe | 42 | */ |
DieterGraef | 0:f9b6112278fe | 43 | #ifndef SLIP_USE_RX_THREAD |
DieterGraef | 0:f9b6112278fe | 44 | #define SLIP_USE_RX_THREAD !NO_SYS |
DieterGraef | 0:f9b6112278fe | 45 | #endif |
DieterGraef | 0:f9b6112278fe | 46 | |
DieterGraef | 0:f9b6112278fe | 47 | /** Set this to 1 to enable functions to pass in RX bytes from ISR context. |
DieterGraef | 0:f9b6112278fe | 48 | * If enabled, slipif_received_byte[s]() process incoming bytes and put assembled |
DieterGraef | 0:f9b6112278fe | 49 | * packets on a queue, which is fed into lwIP from slipif_poll(). |
DieterGraef | 0:f9b6112278fe | 50 | * If disabled, slipif_poll() polls the serila line (using sio_tryread()). |
DieterGraef | 0:f9b6112278fe | 51 | */ |
DieterGraef | 0:f9b6112278fe | 52 | #ifndef SLIP_RX_FROM_ISR |
DieterGraef | 0:f9b6112278fe | 53 | #define SLIP_RX_FROM_ISR 0 |
DieterGraef | 0:f9b6112278fe | 54 | #endif |
DieterGraef | 0:f9b6112278fe | 55 | |
DieterGraef | 0:f9b6112278fe | 56 | /** Set this to 1 (default for SLIP_RX_FROM_ISR) to queue incoming packets |
DieterGraef | 0:f9b6112278fe | 57 | * received by slipif_received_byte[s]() as long as PBUF_POOL pbufs are available. |
DieterGraef | 0:f9b6112278fe | 58 | * If disabled, packets will be dropped if more than one packet is received. |
DieterGraef | 0:f9b6112278fe | 59 | */ |
DieterGraef | 0:f9b6112278fe | 60 | #ifndef SLIP_RX_QUEUE |
DieterGraef | 0:f9b6112278fe | 61 | #define SLIP_RX_QUEUE SLIP_RX_FROM_ISR |
DieterGraef | 0:f9b6112278fe | 62 | #endif |
DieterGraef | 0:f9b6112278fe | 63 | |
DieterGraef | 0:f9b6112278fe | 64 | #ifdef __cplusplus |
DieterGraef | 0:f9b6112278fe | 65 | extern "C" { |
DieterGraef | 0:f9b6112278fe | 66 | #endif |
DieterGraef | 0:f9b6112278fe | 67 | |
DieterGraef | 0:f9b6112278fe | 68 | err_t slipif_init(struct netif * netif); |
DieterGraef | 0:f9b6112278fe | 69 | void slipif_poll(struct netif *netif); |
DieterGraef | 0:f9b6112278fe | 70 | #if SLIP_RX_FROM_ISR |
DieterGraef | 0:f9b6112278fe | 71 | void slipif_process_rxqueue(struct netif *netif); |
DieterGraef | 0:f9b6112278fe | 72 | void slipif_received_byte(struct netif *netif, u8_t data); |
DieterGraef | 0:f9b6112278fe | 73 | void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len); |
DieterGraef | 0:f9b6112278fe | 74 | #endif /* SLIP_RX_FROM_ISR */ |
DieterGraef | 0:f9b6112278fe | 75 | |
DieterGraef | 0:f9b6112278fe | 76 | #ifdef __cplusplus |
DieterGraef | 0:f9b6112278fe | 77 | } |
DieterGraef | 0:f9b6112278fe | 78 | #endif |
DieterGraef | 0:f9b6112278fe | 79 | |
DieterGraef | 0:f9b6112278fe | 80 | #endif |
DieterGraef | 0:f9b6112278fe | 81 |