Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / flight / pios / inc / pios_flash_jedec_priv.h
blob765acf6e1082ce5f3c4ed38d85f916cbbd2ca4bd
1 /**
2 ******************************************************************************
4 * @addtogroup PIOS PIOS Core hardware abstraction layer
5 * @{
6 * @addtogroup PIOS_FLASH Flash device handler
7 * @{
9 * @file pios_flash_jedec_priv.h
10 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
11 * @brief Driver for talking to most JEDEC flash chips
12 * @see The GNU Public License (GPL) Version 3
14 *****************************************************************************/
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 3 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * for more details.
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #ifndef PIOS_FLASH_JEDEC_H
32 #define PIOS_FLASH_JEDEC_H
34 #include "pios_flash.h" /* API definition for flash drivers */
36 extern const struct pios_flash_driver pios_jedec_flash_driver;
38 #define JEDEC_MANUFACTURER_ST 0x20
39 #define JEDEC_MANUFACTURER_MICRON 0x20
40 #define JEDEC_MANUFACTURER_NUMORIX 0x20
41 #define JEDEC_MANUFACTURER_MACRONIX 0xC2
42 #define JEDEC_MANUFACTURER_WINBOND 0xEF
44 struct pios_flash_jedec_cfg {
45 uint8_t expect_manufacturer;
46 uint8_t expect_memorytype;
47 uint8_t expect_capacity;
48 uint8_t sector_erase;
49 uint8_t chip_erase;
50 uint8_t fast_read;
51 uint8_t fast_read_dummy_bytes;
54 int32_t PIOS_Flash_Jedec_Init(uintptr_t *flash_id, uint32_t spi_id, uint32_t slave_num);
56 #endif /* PIOS_FLASH_JEDEC_H */