aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/SpiMaster.h
diff options
context:
space:
mode:
authormark9064 <30447455+mark9064@users.noreply.github.com>2024-01-24 23:30:48 +0000
committerJF <JF002@users.noreply.github.com>2024-05-12 13:57:12 +0200
commit0dcfb2edb7ac071aa0a22c01609122d577d4c05d (patch)
tree341c98fbac97ef863bcefbd0ad54e8dde0cd04eb /src/drivers/SpiMaster.h
parent06c69353156559aa786e8116f2527e8de3ee2d38 (diff)
Fix erratum 58 workaround
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;
};
}
}