Access SPI from C++ for reading and writing

Hello,
how can be accessed SPI in C/C++ for reading and writing ?

You can reference to spidev_test that public source.

Thanks