/* Attempt to get lock on driver instance. 
The purpose of this is to enable exclusive access to driver instances, so that, e.g., transactions by different services will not interfere with each other. */
enum status_code spi_lock(struct spi_module *const module)
/* Attempt to get lock on driver instance. 
The purpose of this is to enable exclusive access to driver instances, so that, e.g., transactions by different services will not interfere with each other. */
enum status_code spi_lock(struct spi_module *const module)
{
	enum status_code status;
	if (module->locked) {
		status = STATUS_BUSY;
	} else {
		module->locked = true;
		status = STATUS_OK;
	}
	return status;
}