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