|
@@ -13,7 +13,7 @@
|
|
|
#include "luat_log.h"
|
|
#include "luat_log.h"
|
|
|
#include "luat_timer.h"
|
|
#include "luat_timer.h"
|
|
|
|
|
|
|
|
-static uint8_t luat_spi_mode = 0;
|
|
|
|
|
|
|
+static uint8_t luat_spi_mode = 1;
|
|
|
|
|
|
|
|
int luat_spi_device_config(luat_spi_device_t* spi_dev) {
|
|
int luat_spi_device_config(luat_spi_device_t* spi_dev) {
|
|
|
unsigned int clk;
|
|
unsigned int clk;
|
|
@@ -128,7 +128,7 @@ int luat_spi_close(int spi_id) {
|
|
|
int32_t tls_spi_xfer(const void *data_out, void *data_in, uint32_t num_out, uint32_t num_in);
|
|
int32_t tls_spi_xfer(const void *data_out, void *data_in, uint32_t num_out, uint32_t num_in);
|
|
|
int luat_spi_transfer(int spi_id, const char* send_buf, size_t send_length, char* recv_buf, size_t recv_length){
|
|
int luat_spi_transfer(int spi_id, const char* send_buf, size_t send_length, char* recv_buf, size_t recv_length){
|
|
|
//tls_spi_read_with_cmd(send_buf, send_length, recv_buf, recv_length);
|
|
//tls_spi_read_with_cmd(send_buf, send_length, recv_buf, recv_length);
|
|
|
- if (luat_spi_mode == 0)
|
|
|
|
|
|
|
+ if (luat_spi_mode == 1)
|
|
|
tls_spi_xfer(send_buf, recv_buf, send_buf, recv_length);
|
|
tls_spi_xfer(send_buf, recv_buf, send_buf, recv_length);
|
|
|
else {
|
|
else {
|
|
|
if (send_length > 0)
|
|
if (send_length > 0)
|