Čeština / English
Login

SVN Repository / Prohlížení

Aktuální adresář: FITkit / trunk / mcu / libs / enc28j60 /

enc28j60_spi_rx.h

   1  /*******************************************************************************
   2  
   3     Copyright (C) 2010 Brno University of Technology,
   4                        Faculty of Information Technology
   5     Author(s): Martin Musil <xmusil34 AT fit.vutbr.cz>
   6  
   7     LICENSE TERMS
   8  
   9     Redistribution and use in source and binary forms, with or without
  10     modification, are permitted provided that the following conditions
  11     are met:
  12     1. Redistributions of source code must retain the above copyright
  13        notice, this list of conditions and the following disclaimer.
  14     2. Redistributions in binary form must reproduce the above copyright
  15        notice, this list of conditions and the following disclaimer in
  16        the documentation and/or other materials provided with the
  17        distribution.
  18     3. All advertising materials mentioning features or use of this software
  19        or firmware must display the following acknowledgement:
  20  
  21          This product includes software developed by the University of
  22          Technology, Faculty of Information Technology, Brno and its
  23          contributors.
  24  
  25     4. Neither the name of the Company nor the names of its contributors
  26        may be used to endorse or promote products derived from this
  27        software without specific prior written permission.
  28  
  29     This software or firmware is provided ``as is'', and any express or implied
  30     warranties, including, but not limited to, the implied warranties of
  31     merchantability and fitness for a particular purpose are disclaimed.
  32     In no event shall the company or contributors be liable for any
  33     direct, indirect, incidental, special, exemplary, or consequential
  34     damages (including, but not limited to, procurement of substitute
  35     goods or services; loss of use, data, or profits; or business
  36     interruption) however caused and on any theory of liability, whether
  37     in contract, strict liability, or tort (including negligence or
  38     otherwise) arising in any way out of the use of this software, even
  39     if advised of the possibility of such damage.
  40  
  41     $Id$
  42  
  43  *******************************************************************************/
  44  
  45  /**
  46  	\file enc28j60_spi_rx.h
  47  
  48  */
  49  
  50  #ifndef _ENC28J60_SPI_RX_
  51  #define _ENC28J60_SPI_RX_
  52  
  53  #define NULL 0		///< NULL pointer
  54  
  55  /*
  56  #define RX_START	3126
  57  #define RX_END		0x1FFF
  58  */
  59  /*
  60  zmena, dodany radic mel obcasne problemy s inicializaci jednoho registru, ERXWRPT,
  61  je pouze pro cteni a inicializuje se automaticky podle hodnoty ERXST, ale obcas
  62  se v nem hodnota ERXST neobjevila, byla tam 0, proto jsem ukazatele zamenil,
  63  aby byla hodnota ERXST a potazmo ERXWRPT 0 a tak i pri teto chybe pracoval radic spravne
  64  */
  65  
  66  /**
  67   \cond
  68   **/
  69  
  70  
  71  
  72  
  73  
  74  
  75  
  76  /**
  77  
  78  
  79  
  80   **/
  81  char rx_init();
  82  
  83  /**
  84  
  85  
  86  
  87   **/
  88  char rx_free();
  89  
  90  /**
  91   \endcond
  92   **/
  93  
  94  /**
  95  
  96  
  97   **/
  98  inline unsigned int rx_getc();
  99  
 100  /**
 101  
 102   \param ptr - ukazatel, kam se bude zapisovat
 103  
 104  
 105   **/
 106  unsigned int rx_read(void* ptr, int length);
 107  
 108  /**
 109  
 110  
 111  
 112  
 113   **/
 114  unsigned int rx_getline(void* ptr, int max_length);
 115  
 116  /**
 117  
 118  
 119   **/
 120  inline int rx_left();
 121  
 122  /**
 123  
 124  
 125  
 126   **/
 127  inline unsigned char rx_isempty();
 128  
 129  /**
 130   \cond
 131   **/
 132  
 133  /**
 134  
 135  
 136   **/
 137  inline void rx_cut_padding(unsigned char length);
 138  
 139  /**
 140   \endcond
 141   **/
 142  
 143  /**
 144  
 145  
 146   **/
 147  #define rx_skip(len) rx_read(NULL, len)
 148  
 149  
 150  #endif /*_ENC28J60_SPI_RX_*/
 151  
Zobrazeno: 695355x Naposledy: 19.8.2022 12:26:47