Upon request, the finish_transfer function.
Code:
static void spi_finish_transfer(spi_interface_t* spif) {
spi_transfer_t* _transfer;
tbuf_push(51);
XMC_GPIO_SetOutputHigh(
SPI_Channel[spif->transfer->channel].cs->port,
SPI_Channel[spif->transfer->channel].cs->pin);
_transfer = spif->transfer;
spif->transfer = NULL;
mutex_unlock(&spif->mtx);
_transfer->complete((void *)_transfer->context);
}