#ifndef __OMW_SPIS_H__
#define __OMW_SPIS_H__

#include "omw_config.h"
#include "omw_gpio.h"

#define OMW_SPIS0_BASE 0x41007000

#define OMW_SPIS_3LINES 0
#define OMW_SPIS_4LINES 1

void omw_spis_send(uint32_t spis_base_addr, void * pdata, uint32_t len);
uint32_t omw_spis_rcv(uint32_t spis_base_addr, void * pbuf, uint32_t blen);
void omw_spis_init(uint32_t spis_base_addr, uint8_t line_mode);

#define OMW_SPIS_SWT2TXST_ONLY(spis_base_addr) \
do \
{ \
    volatile uint32_t * spi_cfg_addr = (volatile uint32_t *)spis_base_addr; \
    spi_cfg_addr[0] = ((1 << 8) | 0x7); \
} while (0)

#endif
