feat: add spi_config_t structure and update init function to accept configuration
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#define B7431E31_4075_4B09_B4B3_EAD0234EFB40
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include "hal/spi_types.h"
|
||||
#include "radiolib_definitions.hpp"
|
||||
#include "llcc68_definitions.hpp"
|
||||
#include "utils/app_result.hpp"
|
||||
@ -36,10 +37,15 @@ constexpr size_t DEFAULT_TIMEOUT_MS = 1000;
|
||||
|
||||
std::span<uint8_t> mut_shared_buffer();
|
||||
|
||||
struct spi_config_t {
|
||||
spi_host_device_t host_id;
|
||||
int clock_speed_hz;
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief Initialize the SPI interface.
|
||||
*/
|
||||
void init();
|
||||
void init(spi_config_t config = {SPI2_HOST, 4'000'000});
|
||||
|
||||
|
||||
inline error_t status_to_err(const uint8_t status) {
|
||||
|
||||
Reference in New Issue
Block a user