2021-08-03 14:13:53 +01:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
#ifndef _PIO_SPI_H
|
|
|
|
#define _PIO_SPI_H
|
|
|
|
|
|
|
|
#include "hardware/pio.h"
|
2023-09-08 18:59:25 +01:00
|
|
|
#ifndef NO_QSTR
|
2021-08-03 14:13:53 +01:00
|
|
|
#include "spi.pio.h"
|
2023-09-08 18:59:25 +01:00
|
|
|
#endif
|
2021-08-03 14:13:53 +01:00
|
|
|
|
|
|
|
typedef struct pio_spi_inst {
|
|
|
|
PIO pio;
|
|
|
|
uint sm;
|
|
|
|
uint cs_pin;
|
|
|
|
} pio_spi_inst_t;
|
|
|
|
|
|
|
|
void pio_spi_write8_blocking(const pio_spi_inst_t *spi, const uint8_t *src, size_t len);
|
|
|
|
|
|
|
|
void pio_spi_read8_blocking(const pio_spi_inst_t *spi, uint8_t *dst, size_t len);
|
|
|
|
|
|
|
|
void pio_spi_write8_read8_blocking(const pio_spi_inst_t *spi, uint8_t *src, uint8_t *dst, size_t len);
|
|
|
|
|
|
|
|
void pio_spi_repeat8_read8_blocking(const pio_spi_inst_t *spi, uint8_t src, uint8_t *dst, size_t len);
|
|
|
|
|
|
|
|
#endif
|