user49784: I am having trouble getting SPI.transfer(buffer, size) to work as expected. 
Here is the code: 
// inslude the SPI library:
#include <SPI.h>


// set pin 10 as the slave select for the digital pot:
const int slaveSelectPin = 10;

uint16_t SPI_message = 0xABCD;

void setup() {
  // set the slaveSelectPin as an output:
  pinMode(slaveSelectPin, OUTPUT);
  // initialize SPI:
  SPI.begin();

}

void loop() {

  SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
  SPI.transfer(0xEF);
  SPI.transfer(&SPI_message, 2);
  SPI.endTransaction();

  delayMicroseconds(300);

}

Here is the output of logic analyzer: 

As can be seen the call for SPI.Transfer(0xEF) works as expected. However SPI.transfer(&SPI_message,2) sends 0x0000 instead of 0xABCD on the bus. 
What am I doing wrong? 

user13432: SPI.transfer(&SPI_message,2) is unfortunately destructive. The buffer is updated with the received values. There is a SPI member function[1] that can be used for 16-bit data; SPI.transfer16(SPI_message).
To correct your sketch either initialize the buffer before each call (as recommended by @domen) or use the 16-bit transfer function. 
There are other SPI APIs that included non-destructive transfer function e.g. read/write. Please see [2].
Cheers!
Ref. 

https://www.arduino.cc/en/Reference/SPITransfer
https://github.com/mikaelpatel/Arduino-SPI/blob/master/src/SPI.h#L137


49784: <p>I am having trouble getting <code>SPI.transfer(buffer, size)</code> to work as expected. </p>

<p>Here is the code: </p>

<pre><code>// inslude the SPI library:
#include &lt;SPI.h&gt;


// set pin 10 as the slave select for the digital pot:
const int slaveSelectPin = 10;

uint16_t SPI_message = 0xABCD;

void setup() {
  // set the slaveSelectPin as an output:
  pinMode(slaveSelectPin, OUTPUT);
  // initialize SPI:
  SPI.begin();

}

void loop() {

  SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
  SPI.transfer(0xEF);
  SPI.transfer(&amp;SPI_message, 2);
  SPI.endTransaction();

  delayMicroseconds(300);

}
</code></pre>

<p>Here is the output of logic analyzer: </p>

<p><a href="https://i.stack.imgur.com/3GI55.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3GI55.png" alt="enter image description here"></a></p>

<p>As can be seen the call for <code>SPI.Transfer(0xEF)</code> works as expected. However <code>SPI.transfer(&amp;SPI_message,2)</code> sends 0x0000 instead of 0xABCD on the bus. </p>

<p><strong>What am I doing wrong?</strong>  </p>
 13432: <p><code>SPI.transfer(&amp;SPI_message,2)</code> is unfortunately destructive. The buffer is updated with the received values. There is a SPI member function[1] that can be used for 16-bit data; <code>SPI.transfer16(SPI_message)</code>.</p>

<p>To correct your sketch either initialize the buffer before each call (as recommended by @domen) or use the 16-bit transfer function. </p>

<p>There are other SPI APIs that included non-destructive transfer function e.g. read/write. Please see [2].</p>

<p>Cheers!</p>

<p>Ref. </p>

<ol>
<li><a href="https://www.arduino.cc/en/Reference/SPITransfer" rel="nofollow noreferrer">https://www.arduino.cc/en/Reference/SPITransfer</a></li>
<li><a href="https://github.com/mikaelpatel/Arduino-SPI/blob/master/src/SPI.h#L137" rel="nofollow noreferrer">https://github.com/mikaelpatel/Arduino-SPI/blob/master/src/SPI.h#L137</a></li>
</ol>
