Merge pull request #2129 from VOGL-electronic/liblitespi-4k-erase
liblitespi: add 4k erase function
This commit is contained in:
commit
4d748b7163
|
@ -238,6 +238,15 @@ void spiflash_erase_range(uint32_t addr, uint32_t len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void spiflash_erase_4k_sector(uint32_t addr)
|
||||||
|
{
|
||||||
|
w_buf[0] = 0x20;
|
||||||
|
w_buf[1] = addr>>16;
|
||||||
|
w_buf[2] = addr>>8;
|
||||||
|
w_buf[3] = addr>>0;
|
||||||
|
transfer_cmd(w_buf, r_buf, 4);
|
||||||
|
}
|
||||||
|
|
||||||
int spiflash_write_stream(uint32_t addr, uint8_t *stream, uint32_t len)
|
int spiflash_write_stream(uint32_t addr, uint8_t *stream, uint32_t len)
|
||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
|
@ -14,6 +14,7 @@ void spiflash_memspeed(void);
|
||||||
void spiflash_init(void);
|
void spiflash_init(void);
|
||||||
int spiflash_write_stream(uint32_t addr, uint8_t *stream, uint32_t len);
|
int spiflash_write_stream(uint32_t addr, uint8_t *stream, uint32_t len);
|
||||||
void spiflash_erase_range(uint32_t addr, uint32_t len);
|
void spiflash_erase_range(uint32_t addr, uint32_t len);
|
||||||
|
void spiflash_erase_4k_sector(uint32_t addr);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue