MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / transfer

Method transfer

libraries/MCP_DAC/MCP_DAC.cpp:217–235  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////// PROTECTED

Source from the content-addressed store, hash-verified

215// PROTECTED
216//
217void MCP_DAC::transfer(uint16_t data)
218{
219 // DATA TRANSFER
220 digitalWrite(_select, LOW);
221 if (_hwSPI)
222 {
223 // mySPI->beginTransaction(SPISettings(_SPIspeed, MSBFIRST, SPI_MODE0));
224 mySPI->beginTransaction(_spi_settings);
225 mySPI->transfer((uint8_t)(data >> 8));
226 mySPI->transfer((uint8_t)(data & 0xFF));
227 mySPI->endTransaction();
228 }
229 else // Software SPI
230 {
231 swSPI_transfer((uint8_t)(data >> 8));
232 swSPI_transfer((uint8_t)(data & 0xFF));
233 }
234 digitalWrite(_select, HIGH);
235}
236
237
238// MSBFIRST

Callers 15

writeDeviceMethod · 0.80
readPromMethod · 0.80
readADCMethod · 0.80
commandMethod · 0.80
updateDeviceMethod · 0.80
writeRegMethod · 0.80
readRegMethod · 0.80
_readMethod · 0.80
_readMethod · 0.80
readADCMethod · 0.80
updateDeviceMethod · 0.80
updateDeviceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected