source: rtems/bsps/shared/dev/i2c/spi-flash-m25p40.c @ 9bf813c5

Last change on this file since 9bf813c5 was 9bf813c5, checked in by Joel Sherrill <joel@…>, on 03/01/22 at 21:38:43

bsps/shared/: Scripted embedded brains header file clean up

Updates #4625.

  • Property mode set to 100644
File size: 2.6 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|                    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.org/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 bytes */
36    .sector_size =          0x10000, /* 64K - erase sector size in bytes */
37    .mem_size =             0x80000, /* 512K - total capacity in bytes */
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 bytes */
54    .sector_size =          0x10000, /* 64K erase sector size in bytes */
55    .mem_size =             0x80000, /* 512K total capacity in bytes */
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.