spi_at45d.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef _DEV_SPI_AT45D_H_
  2. #define _DEV_SPI_AT45D_H_
  3. /*
  4. * Copyright (C) 2008-2009 by egnite GmbH
  5. *
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  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 the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. Neither the name of the copyright holders nor the names of
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  30. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  31. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. *
  34. * For additional information see http://www.ethernut.de/
  35. */
  36. /*!
  37. * \file include/dev/spi_at45d.h
  38. * \brief AT45D
  39. *
  40. * \verbatim
  41. * $Id: spi_at45d.h 4473 2012-08-20 15:12:45Z haraldkipp $
  42. * \endverbatim
  43. */
  44. #include <sys/device.h>
  45. #include <dev/spibus.h>
  46. extern NUTSPINODE nodeSpiAt45d0;
  47. extern NUTDEVICE devSpiAt45d0;
  48. extern NUTSPINODE nodeSpiAt45d1;
  49. extern NUTDEVICE devSpiAt45d1;
  50. extern NUTSPINODE nodeSpiAt45d2;
  51. extern NUTDEVICE devSpiAt45d2;
  52. extern NUTSPINODE nodeSpiAt45d3;
  53. extern NUTDEVICE devSpiAt45d3;
  54. extern int SpiAt45dInit(NUTDEVICE *dev);
  55. extern int SpiAt45dCommand(NUTDEVICE *dev, uint8_t op, uint32_t parm, int len, const void *tdata, void *rdata, int datalen);
  56. extern uint8_t SpiAt45dStatus(NUTDEVICE *dev);
  57. extern int SpiAt45dWaitReady(NUTDEVICE *dev, uint32_t tmo, int poll);
  58. extern int SpiAt45dPageErase(NUTDEVICE *dev, uint32_t pgn);
  59. extern int SpiAt45dChipErase(NUTDEVICE *dev);
  60. extern int SpiAt45dPageRead(NUTDEVICE *dev, uint32_t pgn, void *data, int len);
  61. extern int SpiAt45dPageWrite(NUTDEVICE *dev, uint32_t pgn, const void *data, int len);
  62. extern uint32_t SpiAt45dPages(NUTDEVICE *dev);
  63. extern int SpiAt45dPageSize(NUTDEVICE *dev);
  64. #ifdef __HARVARD_ARCH__
  65. extern int SpiAt45dPageWrite_P(NUTDEVICE *dev, uint32_t pgn, PGM_P data, int len);
  66. #endif
  67. extern int SpiAt45dIOCtl(NUTDEVICE * dev, int req, void *conf);
  68. #endif