[riot-notifications] [RIOT-OS/RIOT] spi_transfer_reg behavior doesn't follow doc (#11763)

Dylan Laduranty notifications at github.com
Fri Jun 28 22:04:07 CEST 2019

#### Description
spi_transfer_reg implementation doesn't follow its documentation. 

 * @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);
We should be able to put a NULL into last argument to only receive data but last argument isn't a pointer.

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 ?

#### Steps to reproduce the issue
put a NULL in last argument.

#### Expected results
put a NULL in last argument to only receive the content of a register.

#### Actual results
Compilation failed

#### Versions

<!-- Thanks for contributing! -->

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190628/a4a0a7a1/attachment-0001.html>

More information about the notifications mailing list