spi_flash: add support for ext flash

This commit is contained in:
Cao Sen Miao
2021-06-21 19:43:51 +08:00
parent c0cf45b118
commit 992de2750e
10 changed files with 78 additions and 46 deletions

View File

@@ -148,12 +148,21 @@ static inline void gpspi_flash_ll_set_buffer_data(spi_dev_t *dev, const void *bu
*/
static inline void gpspi_flash_ll_user_start(spi_dev_t *dev)
{
dev->ctrl.hold_pol = 1;
dev->cmd.update = 1;
while (dev->cmd.update);
dev->cmd.usr = 1;
}
/**
* Set HD pin high when flash work at spi mode.
*
* @param dev Beginning address of the peripheral registers.
*/
static inline void gpspi_flash_ll_set_hold_pol(spi_dev_t *dev, uint32_t pol_val)
{
dev->ctrl.hold_pol = pol_val;
}
/**
* Check whether the host is idle to perform new commands.
*