SPI functions are provided in the libraries

LIB/spi_lib.bas
LIB/spi_bb_lib.bas


 
SPI subsystem description  
SPI_master_init Initialises the SPI hardware
SPI_master_read_write_byte Simultaniously read and write a byte from and to the SPI bus
SPI_master_read_byte read byte from SPI bus
SPI_master_write_byte write byte to SPI bus
SPI_master_write_start_condition Assert start condition on SPI bus
SPI_master_write_stop_condition Assert stop condition on SPI bus