#ifndef __OC_SPI16_H_
#define __OC_SPI16_H_

#include "libwr2rf/io.h"

/* OpenCore SPI master.  */
void libwr2rf_oc_spi_init(struct libwr2rf_dev *dev, unsigned base, unsigned div);

/* Write and read NBITS (at most 128) from and to VALS.  */
void libwr2rf_oc_spi_txrx128(struct libwr2rf_dev *dev, unsigned base, unsigned cs,
                             int nbits, uint16_t *vals);

/* Write and read NBITS (at most 16).  OUT can be null.  */
void libwr2rf_oc_spi_txrx16(struct libwr2rf_dev *dev, unsigned base, unsigned cs,
                            int nbits, uint32_t in, uint32_t *out);

#endif /* __OC_SPI16_H_ */
