Will be used something like:
spi_transaction(HSPI_CS0, param1, param2)
and it changes the HSPI CS pin (GPIO15) to a GPIO set to high temporarily, while it toggles the GPIO0 (HSPI_CS0) pin as a chip select.
Then I can also use that software CS pin in the inverted mode (for devices that are active high CS).
Also, when sending/receiving data, it's only using SPI_W0 register for now. Will add some code later to allow for the SPI_USR_MOSI_HIGHPART and SPI_USR_MISO_HIGHPART configurations where it uses SPI_W8 instead.
Eventually going to expand it with another function, where you pass it a pointer to an array of data, and it sends the whole lot in one command. There are 16 SPI_Wx registers holding a total of 64 bytes. While it's sending those 64bytes you can return to usercode and do more stuff while it runs in the background (which is the entire advantage of using hardware SPI!).
However, nothing stopping the code from loading up another 64bytes straight after the transmission completes
I'll be writing some other libraries soon, that build off this SPI driver as a module. SSD1306 OLED display is next on my list. Software i2c is just too slow at updating a 128x64 display and it holds up any other code from executing.