#ifndef __HAL_LKSMCU_SPI_H__
#define __HAL_LKSMCU_SPI_H__
#include "stdint.h"
typedef enum
{
    HAL_SPI_0,
    HAL_SPI_1,
} HAL_SPI_x;
// 初始化
void HAL_SPI_Reset(HAL_SPI_x);   // 模块复位
void HAL_SPI_Enable(HAL_SPI_x);  // 模块打开
void HAL_SPI_Disable(HAL_SPI_x); // 模块关闭

void HAL_SPI_SetBaud(HAL_SPI_x spi, uint32_t baud);
uint8_t HAL_SPI_TxData(HAL_SPI_x, uint8_t *data, uint32_t len);
uint8_t HAL_SPI_RxData(HAL_SPI_x, uint8_t *data, uint32_t len);
uint8_t HAL_SPI_RxTxData(HAL_SPI_x, uint8_t *rxdata, uint8_t *txdata, uint32_t len);
uint8_t HAL_SPI_TxDataWidth16(HAL_SPI_x, uint16_t *data, uint32_t len);
uint8_t HAL_SPI_RxDataWidth16(HAL_SPI_x, uint16_t *data, uint32_t len);
uint8_t HAL_SPI_RxTxDataWidth16(HAL_SPI_x, uint16_t *rxdata, uint16_t *txdata, uint32_t len);
#endif
