| 36 | } |
| 37 | |
| 38 | int GoPiGo3::spi_read_16(uint8_t msg_type, uint16_t &value){ |
| 39 | value = 0; |
| 40 | spi_array_out[0] = Address; |
| 41 | spi_array_out[1] = msg_type; |
| 42 | // assign error to the value returned by spi_transfer_array, and if not 0: |
| 43 | if(int error = spi_transfer_array(6, spi_array_out, spi_array_in)){ |
| 44 | return error; |
| 45 | } |
| 46 | if(spi_array_in[3] != 0xA5){ |
| 47 | return ERROR_SPI_RESPONSE; |
| 48 | } |
| 49 | value = ((spi_array_in[4] << 8) | spi_array_in[5]); |
| 50 | return ERROR_NONE; |
| 51 | } |
| 52 | |
| 53 | int GoPiGo3::spi_read_32(uint8_t msg_type, uint32_t &value){ |
| 54 | value = 0; |
nothing calls this directly
no test coverage detected