|
|
|
@ -204,14 +204,16 @@ esp_err_t sx127x_set_crc(sx127x_t *handle, sx127x_crc_t crc) {
@@ -204,14 +204,16 @@ esp_err_t sx127x_set_crc(sx127x_t *handle, sx127x_crc_t crc) {
|
|
|
|
|
return ESP_OK; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
esp_err_t sx127x_write_fifo(sx127x_t *handle, char *data, size_t data_len) { |
|
|
|
|
esp_err_t sx127x_write_fifo(sx127x_t *handle, const char *data, |
|
|
|
|
size_t data_len) { |
|
|
|
|
spi_transaction_t trans; |
|
|
|
|
memset(&trans, 0, sizeof(trans)); |
|
|
|
|
trans.flags = SPI_TRANS_USE_RXDATA; |
|
|
|
|
trans.flags = 0; |
|
|
|
|
trans.addr = REG_FIFO; |
|
|
|
|
trans.length = 8 * data_len; |
|
|
|
|
trans.rxlength = 0; |
|
|
|
|
trans.tx_buffer = data; |
|
|
|
|
trans.rxlength = 0; |
|
|
|
|
trans.rx_buffer = NULL; |
|
|
|
|
|
|
|
|
|
esp_err_t ret = spi_device_transmit(handle->device_handle, &trans); |
|
|
|
|
SX127X_ERROR_CHECK2(ret, spi_device_transmit); |
|
|
|
|