Implementation of SPI driver for ADuCM302x.
More...
#include "aducm3029_spi.h"
#include "no_os_spi.h"
#include "no_os_error.h"
#include <stdlib.h>
#include "no_os_util.h"
#include "no_os_alloc.h"
Implementation of SPI driver for ADuCM302x.
- Author
- Mihail Chindris (mihai.nosp@m.l.ch.nosp@m.indri.nosp@m.s@an.nosp@m.alog..nosp@m.com)
Copyright 2019(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ MAX_CS_NUMBER
◆ NB_SPI_DEVICES
◆ aducm3029_spi_init()
Initialize the SPI communication peripheral.
- Parameters
-
| desc | - The SPI descriptor. |
| param | - The structure that contains the SPI parameters. |
- Returns
- 0 in case of success, -1 otherwise.
◆ aducm3029_spi_remove()
Free the resources allocated by no_os_spi_init().
- Parameters
-
| desc | - The SPI descriptor. |
- Returns
- 0 in case of success, -1 otherwise.
◆ aducm3029_spi_write_and_read()
| int32_t aducm3029_spi_write_and_read |
( |
struct no_os_spi_desc * | desc, |
|
|
uint8_t * | data, |
|
|
uint16_t | bytes_number ) |
Write and read data to/from SPI. If bytes number is 0 the function will return failure.
- Parameters
-
| desc | - The SPI descriptor. |
| data | - The buffer with the transmitted/received data. |
| bytes_number | - Number of bytes to write/read. |
- Returns
- 0 in case of success, -1 otherwise.
◆ aducm_spi_ops
Initial value:= {
}
int32_t aducm3029_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition aducm3029_spi.c:86
int32_t aducm3029_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition aducm3029_spi.c:156
int32_t aducm3029_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI. If bytes number is 0 the function will return failure.
Definition aducm3029_spi.c:187
ADuCM3029 platform specific SPI platform ops structure.
ADuCM3029 specific SPI platform ops structure.