Based on your description, it seems like you're having trouble interfacing the LTC6811 with the S32K microcontroller using the lpspi_drv_mastertransferblocking function for data transmission and reception. You mentioned that this function does not seem to control the CS pin as it should.
Firstly, it's important to note that the lpspi_drv_mastertransferblocking function is a blocking function that returns only when the transmission is complete. This function uses a blocking mechanism which means it will block the execution until the transfer is complete.
Regarding the control of the CS pin, the LPSPI peripheral does not control this pin directly. You need to manually control the CS pin using GPIO before and after the SPI transfer. Here is a simple example:
/* Select the slave device */ GPIO_DRV_ClearPinOutput(your_CS_pin);
/* Transfer data */ lpspi_status_t status = LPSPI_DRV_MasterTransferBlocking(instance, &masterTransfer);
/* Deselect the slave device */ GPIO_DRV_SetPinOutput(your_CS_pin);
Please replace 'your_CS_pin' with the actual pin number you're using for the CS pin.
Also, make sure that the SPI settings (baud rate, clock polarity, clock phase, etc.) match between the LTC6811 and the S32K microcontroller.