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

4.104.115
Last change on this file since 3495c57 was 3495c57, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/30/09 at 03:49:08

Whitespace removal.

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[83374f3]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
[42bf1b9]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,
[6640459d]33  erase_before_program: true,
[42bf1b9]34  empty_state:          0xff,
35  page_size:            256, /* programming page size in byte */
[05c599d]36  sector_size:          0x10000 /* 64*1024 */, /* erase sector size in byte */
37  mem_size:             0x80000 /* 512*1024 */ /* total capacity in byte    */
[83374f3]38  }
39};
40
[3495c57]41rtems_libi2c_drv_t *spi_flash_m25p40_rw_driver_descriptor =
[42bf1b9]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,
[6640459d]51  erase_before_program: true,
[42bf1b9]52  empty_state:          0xff,
53  page_size:            256, /* programming page size in byte */
[05c599d]54  sector_size:          0x10000 /* 64*1024 */, /* erase sector size in byte */
55  mem_size:             0x80000 /* 512*1024 */ /* total capacity in byte    */
[42bf1b9]56  }
[83374f3]57};
58
[3495c57]59rtems_libi2c_drv_t *spi_flash_m25p40_ro_driver_descriptor =
[42bf1b9]60&spi_flash_m25p40_ro_drv_t.libi2c_drv_entry;
Note: See TracBrowser for help on using the repository browser.