Second draft of spi api, renamed some functions for clarity and added spi_reg_t *spi as an argument to each function, forgot this in the first draft