dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_flash_jedec_priv.h
Go to the documentation of this file.
1 
15 /*
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.
20  *
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.
25  *
26  * You should have received a copy of the GNU General Public License along
27  * with this program; if not, see <http://www.gnu.org/licenses/>
28  */
29 
30 #ifndef PIOS_FLASH_JEDEC_H_
31 #define PIOS_FLASH_JEDEC_H_
32 
33 #include "pios_flash.h" /* API definition for flash drivers */
34 
35 extern const struct pios_flash_driver pios_jedec_flash_driver;
36 
37 #define JEDEC_MANUFACTURER_ANY 0x00
38 #define JEDEC_MANUFACTURER_ST 0x20
39 #define JEDEC_MANUFACTURER_MACRONIX 0xC2
40 #define JEDEC_MANUFACTURER_WINBOND 0xEF
41 #define JEDEC_MANUFACTURER_SPANSION 0x01
42 #define JEDEC_MANUFACTURER_MICRON 0x20
43 
44 #define JEDEC_MEMORYTYPE_ANY 0x00
45 
49  uint8_t expect_capacity;
50  uint32_t sector_erase;
51 };
52 
53 int32_t PIOS_Flash_Jedec_Init(uintptr_t *flash_id, pios_spi_t spi_id, uint32_t slave_num, const struct pios_flash_jedec_cfg *cfg);
54 int32_t PIOS_Flash_Jedec_ReadOTPData(uintptr_t chip_id, uint32_t chip_offset, uint8_t *data, uint16_t len);
55 uint32_t PIOS_Flash_Jedec_GetCapacity(uintptr_t chip_id);
56 
57 #endif /* PIOS_FLASH_JEDEC_H_ */
const struct pios_flash_driver pios_jedec_flash_driver
int32_t PIOS_Flash_Jedec_Init(uintptr_t *flash_id, pios_spi_t spi_id, uint32_t slave_num, const struct pios_flash_jedec_cfg *cfg)
uint8_t data[XFER_BYTES_PER_PACKET]
Definition: bl_messages.h:129
int32_t PIOS_Flash_Jedec_ReadOTPData(uintptr_t chip_id, uint32_t chip_offset, uint8_t *data, uint16_t len)
static struct flyingpicmd_cfg_fa cfg
Definition: main.c:49
uint32_t PIOS_Flash_Jedec_GetCapacity(uintptr_t chip_id)