Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
DevSPI Class Reference
Helper class DevSPI providing functions for synchronous SPI communication common for a series of SPI devices. More...
#include <DevSPI.h>
Public Member Functions | |
| int | spi_write (uint8_t *pBuffer, DigitalOut &ssel, uint16_t NumBytesToWrite) |
| Writes a buffer to the SPI peripheral device in 8-bit data mode using synchronous SPI communication. | |
| int | spi_read (uint8_t *pBuffer, DigitalOut &ssel, uint16_t NumBytesToRead) |
| Reads a buffer from the SPI peripheral device in 8-bit data mode using synchronous SPI communication. | |
| int | spi_read_write (uint8_t *pBufferToRead, uint8_t *pBufferToWrite, DigitalOut &ssel, uint16_t NumBytes) |
| Reads and write a buffer from/to the SPI peripheral device at the same time in 8-bit data mode using synchronous SPI communication. | |
| int | spi_write (uint16_t *pBuffer, DigitalOut &ssel, uint16_t NumValuesToWrite) |
| Writes a buffer to the SPI peripheral device in 16-bit data mode using synchronous SPI communication. | |
| int | spi_read (uint16_t *pBuffer, DigitalOut &ssel, uint16_t NumValuesToRead) |
| Reads a buffer from the SPI peripheral device in 16-bit data mode using synchronous SPI communication. | |
| int | spi_read_write (uint16_t *pBufferToRead, uint16_t *pBufferToWrite, DigitalOut &ssel, uint16_t NumValues) |
| Reads and write a buffer from/to the SPI peripheral device at the same time in 16-bit data mode using synchronous SPI communication. | |
| int | spi_write (uint8_t *pBuffer, DigitalOut &ssel, uint16_t NumBytesToWrite) |
| Writes a buffer to the SPI peripheral device in 8-bit data mode using synchronous SPI communication. | |
| int | spi_read (uint8_t *pBuffer, DigitalOut &ssel, uint16_t NumBytesToRead) |
| Reads a buffer from the SPI peripheral device in 8-bit data mode using synchronous SPI communication. | |
| int | spi_read_write (uint8_t *pBufferToRead, uint8_t *pBufferToWrite, DigitalOut &ssel, uint16_t NumBytes) |
| Reads and write a buffer from/to the SPI peripheral device at the same time in 8-bit data mode using synchronous SPI communication. | |
| int | spi_write (uint16_t *pBuffer, DigitalOut &ssel, uint16_t NumValuesToWrite) |
| Writes a buffer to the SPI peripheral device in 16-bit data mode using synchronous SPI communication. | |
| int | spi_read (uint16_t *pBuffer, DigitalOut &ssel, uint16_t NumValuesToRead) |
| Reads a buffer from the SPI peripheral device in 16-bit data mode using synchronous SPI communication. | |
| int | spi_read_write (uint16_t *pBufferToRead, uint16_t *pBufferToWrite, DigitalOut &ssel, uint16_t NumValues) |
| Reads and write a buffer from/to the SPI peripheral device at the same time in 16-bit data mode using synchronous SPI communication. | |
| int | spi_write (uint8_t *pBuffer, DigitalOut &ssel, uint16_t NumBytesToWrite) |
| Writes a buffer to the SPI peripheral device in 8-bit data mode using synchronous SPI communication. | |
| int | spi_read (uint8_t *pBuffer, DigitalOut &ssel, uint16_t NumBytesToRead) |
| Reads a buffer from the SPI peripheral device in 8-bit data mode using synchronous SPI communication. | |
| int | spi_read_write (uint8_t *pBufferToRead, uint8_t *pBufferToWrite, DigitalOut &ssel, uint16_t NumBytes) |
| Reads and write a buffer from/to the SPI peripheral device at the same time in 8-bit data mode using synchronous SPI communication. | |
| int | spi_write (uint16_t *pBuffer, DigitalOut &ssel, uint16_t NumValuesToWrite) |
| Writes a buffer to the SPI peripheral device in 16-bit data mode using synchronous SPI communication. | |
| int | spi_read (uint16_t *pBuffer, DigitalOut &ssel, uint16_t NumValuesToRead) |
| Reads a buffer from the SPI peripheral device in 16-bit data mode using synchronous SPI communication. | |
| int | spi_read_write (uint16_t *pBufferToRead, uint16_t *pBufferToWrite, DigitalOut &ssel, uint16_t NumValues) |
| Reads and write a buffer from/to the SPI peripheral device at the same time in 16-bit data mode using synchronous SPI communication. | |
| int | spi_write (uint8_t *pBuffer, DigitalOut &ssel, uint16_t NumBytesToWrite) |
| Writes a buffer to the SPI peripheral device in 8-bit data mode using synchronous SPI communication. | |
| int | spi_read (uint8_t *pBuffer, DigitalOut &ssel, uint16_t NumBytesToRead) |
| Reads a buffer from the SPI peripheral device in 8-bit data mode using synchronous SPI communication. | |
| int | spi_read_write (uint8_t *pBufferToRead, uint8_t *pBufferToWrite, DigitalOut &ssel, uint16_t NumBytes) |
| Reads and write a buffer from/to the SPI peripheral device at the same time in 8-bit data mode using synchronous SPI communication. | |
| int | spi_write (uint16_t *pBuffer, DigitalOut &ssel, uint16_t NumValuesToWrite) |
| Writes a buffer to the SPI peripheral device in 16-bit data mode using synchronous SPI communication. | |
| int | spi_read (uint16_t *pBuffer, DigitalOut &ssel, uint16_t NumValuesToRead) |
| Reads a buffer from the SPI peripheral device in 16-bit data mode using synchronous SPI communication. | |
| int | spi_read_write (uint16_t *pBufferToRead, uint16_t *pBufferToWrite, DigitalOut &ssel, uint16_t NumValues) |
| Reads and write a buffer from/to the SPI peripheral device at the same time in 16-bit data mode using synchronous SPI communication. | |
Detailed Description
Helper class DevSPI providing functions for synchronous SPI communication common for a series of SPI devices.
Definition at line 57 of file HTS221/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
Member Function Documentation
| int spi_read | ( | uint16_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumValuesToRead | ||
| ) |
Reads a buffer from the SPI peripheral device in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBuffer pointer to the buffer to read data into. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValuesToRead number of 16-bit values to read.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 236 of file HTS221/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read | ( | uint16_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumValuesToRead | ||
| ) |
Reads a buffer from the SPI peripheral device in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBuffer pointer to the buffer to read data into. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValuesToRead number of 16-bit values to read.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 236 of file LSM6DSL/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read | ( | uint8_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumBytesToRead | ||
| ) |
Reads a buffer from the SPI peripheral device in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBuffer pointer to the buffer to read data into. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytesToRead number of bytes to read.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 141 of file LSM303AGR/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read | ( | uint8_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumBytesToRead | ||
| ) |
Reads a buffer from the SPI peripheral device in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBuffer pointer to the buffer to read data into. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytesToRead number of bytes to read.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 141 of file LPS22HB/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read | ( | uint16_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumValuesToRead | ||
| ) |
Reads a buffer from the SPI peripheral device in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBuffer pointer to the buffer to read data into. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValuesToRead number of 16-bit values to read.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 236 of file LSM303AGR/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read | ( | uint8_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumBytesToRead | ||
| ) |
Reads a buffer from the SPI peripheral device in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBuffer pointer to the buffer to read data into. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytesToRead number of bytes to read.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 141 of file HTS221/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read | ( | uint16_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumValuesToRead | ||
| ) |
Reads a buffer from the SPI peripheral device in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBuffer pointer to the buffer to read data into. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValuesToRead number of 16-bit values to read.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 236 of file LPS22HB/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read | ( | uint8_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumBytesToRead | ||
| ) |
Reads a buffer from the SPI peripheral device in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBuffer pointer to the buffer to read data into. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytesToRead number of bytes to read.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 141 of file LSM6DSL/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read_write | ( | uint16_t * | pBufferToRead, |
| uint16_t * | pBufferToWrite, | ||
| DigitalOut & | ssel, | ||
| uint16_t | NumValues | ||
| ) |
Reads and write a buffer from/to the SPI peripheral device at the same time in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBufferToRead pointer to the buffer to read data into. [in] pBufferToWrite pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValues number of 16-bit values to read and write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 269 of file LSM303AGR/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read_write | ( | uint8_t * | pBufferToRead, |
| uint8_t * | pBufferToWrite, | ||
| DigitalOut & | ssel, | ||
| uint16_t | NumBytes | ||
| ) |
Reads and write a buffer from/to the SPI peripheral device at the same time in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBufferToRead pointer to the buffer to read data into. [in] pBufferToWrite pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytes number of bytes to read and write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 172 of file HTS221/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read_write | ( | uint8_t * | pBufferToRead, |
| uint8_t * | pBufferToWrite, | ||
| DigitalOut & | ssel, | ||
| uint16_t | NumBytes | ||
| ) |
Reads and write a buffer from/to the SPI peripheral device at the same time in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBufferToRead pointer to the buffer to read data into. [in] pBufferToWrite pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytes number of bytes to read and write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 172 of file LSM6DSL/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read_write | ( | uint16_t * | pBufferToRead, |
| uint16_t * | pBufferToWrite, | ||
| DigitalOut & | ssel, | ||
| uint16_t | NumValues | ||
| ) |
Reads and write a buffer from/to the SPI peripheral device at the same time in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBufferToRead pointer to the buffer to read data into. [in] pBufferToWrite pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValues number of 16-bit values to read and write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 269 of file LSM6DSL/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read_write | ( | uint8_t * | pBufferToRead, |
| uint8_t * | pBufferToWrite, | ||
| DigitalOut & | ssel, | ||
| uint16_t | NumBytes | ||
| ) |
Reads and write a buffer from/to the SPI peripheral device at the same time in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBufferToRead pointer to the buffer to read data into. [in] pBufferToWrite pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytes number of bytes to read and write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 172 of file LSM303AGR/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read_write | ( | uint16_t * | pBufferToRead, |
| uint16_t * | pBufferToWrite, | ||
| DigitalOut & | ssel, | ||
| uint16_t | NumValues | ||
| ) |
Reads and write a buffer from/to the SPI peripheral device at the same time in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBufferToRead pointer to the buffer to read data into. [in] pBufferToWrite pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValues number of 16-bit values to read and write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 269 of file LPS22HB/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read_write | ( | uint8_t * | pBufferToRead, |
| uint8_t * | pBufferToWrite, | ||
| DigitalOut & | ssel, | ||
| uint16_t | NumBytes | ||
| ) |
Reads and write a buffer from/to the SPI peripheral device at the same time in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBufferToRead pointer to the buffer to read data into. [in] pBufferToWrite pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytes number of bytes to read and write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 172 of file LPS22HB/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_read_write | ( | uint16_t * | pBufferToRead, |
| uint16_t * | pBufferToWrite, | ||
| DigitalOut & | ssel, | ||
| uint16_t | NumValues | ||
| ) |
Reads and write a buffer from/to the SPI peripheral device at the same time in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[out] pBufferToRead pointer to the buffer to read data into. [in] pBufferToWrite pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValues number of 16-bit values to read and write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 269 of file HTS221/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_write | ( | uint8_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumBytesToWrite | ||
| ) |
Writes a buffer to the SPI peripheral device in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[in] pBuffer pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytesToWrite number of bytes to write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 111 of file LSM6DSL/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_write | ( | uint16_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumValuesToWrite | ||
| ) |
Writes a buffer to the SPI peripheral device in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[in] pBuffer pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValuesToWrite number of 16-bit values to write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 204 of file LSM303AGR/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_write | ( | uint8_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumBytesToWrite | ||
| ) |
Writes a buffer to the SPI peripheral device in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[in] pBuffer pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytesToWrite number of bytes to write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 111 of file LSM303AGR/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_write | ( | uint16_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumValuesToWrite | ||
| ) |
Writes a buffer to the SPI peripheral device in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[in] pBuffer pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValuesToWrite number of 16-bit values to write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 204 of file HTS221/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_write | ( | uint8_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumBytesToWrite | ||
| ) |
Writes a buffer to the SPI peripheral device in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[in] pBuffer pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytesToWrite number of bytes to write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 111 of file HTS221/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_write | ( | uint16_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumValuesToWrite | ||
| ) |
Writes a buffer to the SPI peripheral device in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[in] pBuffer pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValuesToWrite number of 16-bit values to write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 204 of file LSM6DSL/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_write | ( | uint16_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumValuesToWrite | ||
| ) |
Writes a buffer to the SPI peripheral device in 16-bit data mode using synchronous SPI communication.
- Parameters:
-
[in] pBuffer pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumValuesToWrite number of 16-bit values to write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
- In order to guarantee this method to work correctly you have to pass buffers which are correctly aligned.
Definition at line 204 of file LPS22HB/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
| int spi_write | ( | uint8_t * | pBuffer, |
| DigitalOut & | ssel, | ||
| uint16_t | NumBytesToWrite | ||
| ) |
Writes a buffer to the SPI peripheral device in 8-bit data mode using synchronous SPI communication.
- Parameters:
-
[in] pBuffer pointer to the buffer of data to send. [in] ssel GPIO of the SSEL pin of the SPI device to be used for communication. [in] NumBytesToWrite number of bytes to write.
- Return values:
-
0 if ok. -1 if data format error.
- Note:
- When using the SPI in Interrupt-mode, remember to disable interrupts before calling this function and to enable them again after.
Definition at line 111 of file LPS22HB/X_NUCLEO_COMMON/DevSPI/DevSPI.h.
Generated on Tue Jul 12 2022 21:38:10 by
1.7.2