source: rtems/c/src/libchip/i2c/spi-flash-m25p40.c @ 3495c57

4.104.11
Last change on this file since 3495c57 was 3495c57, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 30, 2009 at 3:49:08 AM

Whitespace removal.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*===============================================================*\
2| Project: SPI driver for M25P40 like spi flash device            |
3+-----------------------------------------------------------------+
4|                    Copyright (c) 2007                           |
5|                    Embedded Brains GmbH                         |
6|                    Obere Lagerstr. 30                           |
7|                    D-82178 Puchheim                             |
8|                    Germany                                      |
9|                    rtems@embedded-brains.de                     |
10+-----------------------------------------------------------------+
11| The license and distribution terms for this file may be         |
12| found in the file LICENSE in this distribution or at            |
13|                                                                 |
14| http://www.rtems.com/license/LICENSE.                           |
15|                                                                 |
16+-----------------------------------------------------------------+
17\*===============================================================*/
18
19#include <rtems.h>
20#include <rtems/libi2c.h>
21
22#include <libchip/spi-flash-m25p40.h>
23#include <rtems/libio.h>
24
25
26static spi_memdrv_t spi_flash_m25p40_rw_drv_t = {
27  {/* public fields */
28  ops:         &spi_memdrv_rw_ops, /* operations of general memdrv */
29  size:        sizeof (spi_flash_m25p40_rw_drv_t),
30  },
31  { /* our private fields */
32  baudrate:             2000000,
33  erase_before_program: true,
34  empty_state:          0xff,
35  page_size:            256, /* programming page size in byte */
36  sector_size:          0x10000 /* 64*1024 */, /* erase sector size in byte */
37  mem_size:             0x80000 /* 512*1024 */ /* total capacity in byte    */
38  }
39};
40
41rtems_libi2c_drv_t *spi_flash_m25p40_rw_driver_descriptor =
42&spi_flash_m25p40_rw_drv_t.libi2c_drv_entry;
43
44static spi_memdrv_t spi_flash_m25p40_ro_drv_t = {
45  {/* public fields */
46  ops:         &spi_memdrv_ro_ops, /* operations of general memdrv */
47  size:        sizeof (spi_flash_m25p40_ro_drv_t),
48  },
49  { /* our private fields */
50  baudrate:             2000000,
51  erase_before_program: true,
52  empty_state:          0xff,
53  page_size:            256, /* programming page size in byte */
54  sector_size:          0x10000 /* 64*1024 */, /* erase sector size in byte */
55  mem_size:             0x80000 /* 512*1024 */ /* total capacity in byte    */
56  }
57};
58
59rtems_libi2c_drv_t *spi_flash_m25p40_ro_driver_descriptor =
60&spi_flash_m25p40_ro_drv_t.libi2c_drv_entry;
Note: See TracBrowser for help on using the repository browser.