<h4>Description</h4>
<p>spi_transfer_reg implementation doesn't follow its documentation.</p>
<pre><code>/**
 * @brief   Transfer one byte to/from a given register address
 *
 * This function is a shortcut function for easier handling of SPI devices that
 * implement a register based access scheme.
 *
 * @param[in] bus       SPI device to use
 * @param[in]  cs       chip select pin/line to use, set to SPI_CS_UNDEF if chip
 *                      select should not be handled by the SPI driver
 * @param[in] reg       register address to transfer data to/from
 * @param[in] out       byte to send, set NULL if only receiving data
 *
 * @return              value that was read from the given register address
 */
uint8_t spi_transfer_reg(spi_t bus, spi_cs_t cs, uint8_t reg, uint8_t out);
</code></pre>
<p>We should be able to put a NULL into last argument to only receive data but last argument isn't a pointer.</p>
<p>Now the question is : Should we update the documentation to follow the current implementation OR should we update the current implementation to follow the documentation ?</p>
<h4>Steps to reproduce the issue</h4>
<p>put a NULL in last argument.</p>
<h4>Expected results</h4>
<p>put a NULL in last argument to only receive the content of a register.</p>
<h4>Actual results</h4>
<p>Compilation failed</p>
<h4>Versions</h4>
<p>master</p>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/issues/11763?email_source=notifications&email_token=ABE7WYBNLED45FOZMGO6YV3P4ZVDPA5CNFSM4H4IFNRKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G4MOBVQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYBTS65JZPRAOK4XI4TP4ZVDPANCNFSM4H4IFNRA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYFM2EIRSOT6ODUDBJ3P4ZVDPA5CNFSM4H4IFNRKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G4MOBVQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/issues/11763?email_source=notifications\u0026email_token=ABE7WYBNLED45FOZMGO6YV3P4ZVDPA5CNFSM4H4IFNRKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G4MOBVQ",
"url": "https://github.com/RIOT-OS/RIOT/issues/11763?email_source=notifications\u0026email_token=ABE7WYBNLED45FOZMGO6YV3P4ZVDPA5CNFSM4H4IFNRKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G4MOBVQ",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>