2012-01-20 14:37:47 +01:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
2011-01-24 08:52:14 +01:00
|
|
|
*
|
2012-01-20 14:37:47 +01:00
|
|
|
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
|
|
* @{
|
|
|
|
* @addtogroup PIOS_FLASH Flash device handler
|
|
|
|
* @{
|
2011-01-24 08:52:14 +01:00
|
|
|
*
|
2012-12-12 04:36:18 +01:00
|
|
|
* @file pios_flash_jedec_priv.h
|
2012-01-20 14:37:47 +01:00
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
2012-12-12 04:36:18 +01:00
|
|
|
* @brief Driver for talking to most JEDEC flash chips
|
2012-01-20 14:37:47 +01:00
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
2012-12-12 04:36:18 +01:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2012-01-20 14:37:47 +01:00
|
|
|
* (at your option) any later version.
|
2012-12-12 04:36:18 +01:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
2012-01-20 14:37:47 +01:00
|
|
|
* for more details.
|
2012-12-12 04:36:18 +01:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
2012-01-20 14:37:47 +01:00
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2011-01-24 08:52:14 +01:00
|
|
|
*/
|
|
|
|
|
2012-12-12 04:36:18 +01:00
|
|
|
#ifndef PIOS_FLASH_JEDEC_H_
|
|
|
|
#define PIOS_FLASH_JEDEC_H_
|
|
|
|
|
|
|
|
#include "pios_flash.h" /* API definition for flash drivers */
|
|
|
|
|
|
|
|
extern const struct pios_flash_driver pios_jedec_flash_driver;
|
|
|
|
|
2012-12-15 05:16:31 +01:00
|
|
|
#define JEDEC_MANUFACTURER_ST 0x20
|
|
|
|
#define JEDEC_MANUFACTURER_MACRONIX 0xC2
|
|
|
|
#define JEDEC_MANUFACTURER_WINBOND 0xEF
|
|
|
|
|
2012-01-25 07:23:24 +01:00
|
|
|
struct pios_flash_jedec_cfg {
|
2012-12-15 05:16:31 +01:00
|
|
|
uint8_t expect_manufacturer;
|
|
|
|
uint8_t expect_memorytype;
|
|
|
|
uint8_t expect_capacity;
|
2012-01-25 07:23:24 +01:00
|
|
|
uint32_t sector_erase;
|
|
|
|
uint32_t chip_erase;
|
|
|
|
};
|
|
|
|
|
2012-12-15 05:13:33 +01:00
|
|
|
int32_t PIOS_Flash_Jedec_Init(uintptr_t * flash_id, uint32_t spi_id, uint32_t slave_num, const struct pios_flash_jedec_cfg * cfg);
|
2012-01-26 19:39:35 +01:00
|
|
|
|
2012-12-12 04:36:18 +01:00
|
|
|
#endif /* PIOS_FLASH_JEDEC_H_ */
|