diff options
Diffstat (limited to 'src/drivers/SpiNorFlash.cpp')
| -rw-r--r-- | src/drivers/SpiNorFlash.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/drivers/SpiNorFlash.cpp b/src/drivers/SpiNorFlash.cpp new file mode 100644 index 00000000..d19548ee --- /dev/null +++ b/src/drivers/SpiNorFlash.cpp @@ -0,0 +1,36 @@ +#include <hal/nrf_gpio.h> +#include <libraries/delay/nrf_delay.h> +#include <libraries/log/nrf_log.h> +#include "SpiNorFlash.h" +#include "Spi.h" + +using namespace Pinetime::Drivers; + +SpiNorFlash::SpiNorFlash(Spi& spi) : spi{spi} { + +} + +void SpiNorFlash::Init() { + uint8_t cmd = 0x9F; + spi.Write(&cmd, 1); + + uint8_t data[3]; + data[0] = 0; + data[1] = 0; + data[2] = 0; + spi.Read(data, 3); + + NRF_LOG_INFO("Manufacturer : %d, Device : %d", data[0], (data[1] + (data[2]<<8))); +} + +void SpiNorFlash::Uninit() { + +} + +void SpiNorFlash::Sleep() { + +} + +void SpiNorFlash::Wakeup() { + +} |
