Hi, Martin,
Regarding your question, I have downloaded the data sheet of BMP280, I think the required SPI timing of BMP280 is CBS HIGH during the interval of transmission, while the CBS pin should be LOW during the data transmission.
When the SPI of KEA128 is set up in master mode, you can set the SPI registers so that it can implement the function: when the SPI transfer data, the SS pin will be LOW automatically, the SS pin will be High only during the interval of transmission automatically.
This is the setting:
1)MSTR bit in SPI_C1 is set, the SPI is in master mode
2)MODFEN bit in SPI_C2 is set.
3)SSOE in SPI_C1 bit is set, the SS pin will be Low during data transfer, high during interval between two transmission automatically.
If you do want to use a GPIO to connect to CBS of BMP280, it is okay. The /SS of SPI can be configured as GPIO, of course, you can use any GPIO pin of KEA128 to connect to CBS pin. The SPI0_PCS(SPI0_SS) is multiplexed with PTE3, the other functions are KBI1_P3, SPI0_PCS.
How to configure the SS pin of SPI in GPIO mode:
1)MSTR bit in SPI_C1 is set, the SPI is in master mode
2)MODFEN bit in SPI_C2 is set.
//configure SS pin in GPIO mode
3)set the PTE3 bit in GPIOB_DDR so that the PTE3 pin functions as GPIO output
4)set the PTE3 bit in GPIOB_PDOR will have the PTE3 pin in HIGH state.
5)clear the PTE3 bit in GPIOB_PDOR will have the PTE3 pin in LOW state.
This is the procedure:
clear the PTE3 pin, write register address to SPI data register, you can check the SPRF to determine if valid data has been received, read the data in SPI0_D to memory, write dummy data to SPI0_D to launch another transfer, check SPRF bit,..., set PTE3 when specified number of data have been transferred. You can also use interrupt mechanism to transfer.
BR
Xiangjun Rong