| 21 | } |
| 22 | |
| 23 | int GoPiGo3::spi_read_8(uint8_t msg_type, uint8_t &value){ |
| 24 | value = 0; |
| 25 | spi_array_out[0] = Address; |
| 26 | spi_array_out[1] = msg_type; |
| 27 | // assign error to the value returned by spi_transfer_array, and if not 0: |
| 28 | if(int error = spi_transfer_array(5, spi_array_out, spi_array_in)){ |
| 29 | return error; |
| 30 | } |
| 31 | if(spi_array_in[3] != 0xA5){ |
| 32 | return ERROR_SPI_RESPONSE; |
| 33 | } |
| 34 | value = spi_array_in[4]; |
| 35 | return ERROR_NONE; |
| 36 | } |
| 37 | |
| 38 | int GoPiGo3::spi_read_16(uint8_t msg_type, uint16_t &value){ |
| 39 | value = 0; |
nothing calls this directly
no test coverage detected