aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/SpiMaster.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/SpiMaster.h')
-rw-r--r--src/drivers/SpiMaster.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/drivers/SpiMaster.h b/src/drivers/SpiMaster.h
index af38e87b..be6e5351 100644
--- a/src/drivers/SpiMaster.h
+++ b/src/drivers/SpiMaster.h
@@ -6,6 +6,8 @@
#include <FreeRTOS.h>
#include <semphr.h>
#include <task.h>
+#include "nrfx_gpiote.h"
+#include "nrf_ppi.h"
namespace Pinetime {
namespace Drivers {
@@ -44,8 +46,8 @@ namespace Pinetime {
void Wakeup();
private:
- void SetupWorkaroundForFtpan58(NRF_SPIM_Type* spim, uint32_t ppi_channel, uint32_t gpiote_channel);
- void DisableWorkaroundForFtpan58(NRF_SPIM_Type* spim, uint32_t ppi_channel, uint32_t gpiote_channel);
+ void SetupWorkaroundForErratum58();
+ void DisableWorkaroundForErratum58();
void PrepareTx(const volatile uint32_t bufferAddress, const volatile size_t size);
void PrepareRx(const volatile uint32_t bufferAddress, const volatile size_t size);
@@ -58,6 +60,8 @@ namespace Pinetime {
volatile uint32_t currentBufferAddr = 0;
volatile size_t currentBufferSize = 0;
SemaphoreHandle_t mutex = nullptr;
+ static constexpr nrf_ppi_channel_t workaroundPpi = NRF_PPI_CHANNEL0;
+ bool workaroundActive = false;
};
}
}