Blame view

epsilon-master/ion/src/device/flash.h 578 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  #ifndef ION_DEVICE_FLASH_H
  #define ION_DEVICE_FLASH_H
  
  #include <stddef.h>
  #include "regs/flash.h"
  
  namespace Ion {
  namespace Flash {
  namespace Device {
  
  void MassErase();
  
  constexpr int NumberOfSectors = 12;
  int SectorAtAddress(uint32_t address);
  void EraseSector(int i);
  
  void WriteMemory(uint8_t * source, uint8_t * destination, size_t length);
  
  /* The Device is powered by a 2.8V LDO. This allows us to perform writes to the
   * Flash 32 bits at once. */
  constexpr FLASH::CR::PSIZE MemoryAccessWidth = FLASH::CR::PSIZE::X32;
  typedef uint32_t MemoryAccessType;
  
  }
  }
  }
  
  #endif