MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / spi_transfer_array

Function spi_transfer_array

Software/C/GoPiGo3.h:67–77  ·  view source on GitHub ↗

Transfer length number of bytes. Write from outArray, read to inArray.

Source from the content-addressed store, hash-verified

65
66// Transfer length number of bytes. Write from outArray, read to inArray.
67int spi_transfer_array(uint8_t length, uint8_t *outArray, uint8_t *inArray){
68 spi_xfer_struct.len = length;
69 spi_xfer_struct.tx_buf = (unsigned long)outArray;
70 spi_xfer_struct.rx_buf = (unsigned long)inArray;
71
72 if (ioctl(spi_file_handle, SPI_IOC_MESSAGE(1), &spi_xfer_struct) < 0) {
73 return ERROR_SPI_FILE;
74 }
75
76 return ERROR_NONE;
77}
78
79// Function to call if an error occured that can not be resolved, such as failure to set up SPI
80void fatal_error(const char *error){

Callers 15

spi_read_8Method · 0.85
spi_read_16Method · 0.85
spi_read_32Method · 0.85
spi_read_stringMethod · 0.85
spi_write_32Method · 0.85
get_idMethod · 0.85
set_ledMethod · 0.85
set_servoMethod · 0.85
set_motor_powerMethod · 0.85
set_motor_positionMethod · 0.85
set_motor_dpsMethod · 0.85
set_motor_limitsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected