SPI: chip select can now be kept active if the bus has been acquired

The user can now request the chip select to remain active after the current
transfer. In order to do so, he MUST acquire the bus first with `spi_device_acquire_bus()`
function, else, an error is returned.
This commit is contained in:
Omar Chebib
2021-05-13 11:53:44 +08:00
parent a1b5c38218
commit a6e14c37b2
9 changed files with 84 additions and 12 deletions

View File

@@ -612,6 +612,16 @@ static inline void spi_ll_master_select_cs(spi_dev_t *hw, int cs_id)
}
}
/**
* Keep Chip Select activated after the current transaction.
*
* @param hw Beginning address of the peripheral registers.
* @param keep_active if 0 don't keep CS activated, else keep CS activated
*/
static inline void spi_ll_master_keep_cs(spi_dev_t *hw, int keep_active) {
hw->misc.cs_keep_active = (keep_active != 0) ? 1 : 0;
}
/*------------------------------------------------------------------------------
* Configs: parameters
*----------------------------------------------------------------------------*/