REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
eeprom.cpp File Reference
#include "imxrt.h"
#include <avr/eeprom.h>
#include <string.h>
#include <avr/pgmspace.h>
#include "debug/printf.h"
Include dependency graph for eeprom.cpp:

Go to the source code of this file.

Macros

#define LUT0(opcode, pads, operand)
 
#define LUT1(opcode, pads, operand)
 
#define CMD_SDR   FLEXSPI_LUT_OPCODE_CMD_SDR
 
#define ADDR_SDR   FLEXSPI_LUT_OPCODE_RADDR_SDR
 
#define READ_SDR   FLEXSPI_LUT_OPCODE_READ_SDR
 
#define WRITE_SDR   FLEXSPI_LUT_OPCODE_WRITE_SDR
 
#define PINS1   FLEXSPI_LUT_NUM_PADS_1
 
#define PINS4   FLEXSPI_LUT_NUM_PADS_4
 

Functions

void flash_write (void *addr, const void *data, uint32_t len)
 
void flash_erase_sector (void *addr)
 
void flash_erase_32K_block (void *addr)
 
void flash_erase_64K_block (void *addr)
 
static FASTRUN void flash_wait ()
 

Macro Definition Documentation

◆ ADDR_SDR

#define ADDR_SDR   FLEXSPI_LUT_OPCODE_RADDR_SDR

◆ CMD_SDR

#define CMD_SDR   FLEXSPI_LUT_OPCODE_CMD_SDR

◆ LUT0

#define LUT0 ( opcode,
pads,
operand )
Value:
(FLEXSPI_LUT_INSTRUCTION((opcode), (pads), (operand)))

Definition at line 68 of file eeprom.cpp.

Referenced by flash_erase_32K_block(), flash_erase_64K_block(), flash_erase_sector(), flash_wait(), and flash_write().

◆ LUT1

#define LUT1 ( opcode,
pads,
operand )
Value:
(FLEXSPI_LUT_INSTRUCTION((opcode), (pads), (operand)) << 16)

Definition at line 69 of file eeprom.cpp.

Referenced by flash_erase_32K_block(), flash_erase_64K_block(), flash_erase_sector(), flash_wait(), and flash_write().

◆ PINS1

#define PINS1   FLEXSPI_LUT_NUM_PADS_1

◆ PINS4

#define PINS4   FLEXSPI_LUT_NUM_PADS_4

Definition at line 75 of file eeprom.cpp.

Referenced by flash_write().

◆ READ_SDR

#define READ_SDR   FLEXSPI_LUT_OPCODE_READ_SDR

Definition at line 72 of file eeprom.cpp.

Referenced by flash_wait().

◆ WRITE_SDR

#define WRITE_SDR   FLEXSPI_LUT_OPCODE_WRITE_SDR

Definition at line 73 of file eeprom.cpp.

Referenced by flash_write().

Function Documentation

◆ flash_erase_32K_block()

FASTRUN void flash_erase_32K_block ( void * addr)

Definition at line 163 of file eeprom.cpp.

References ADDR_SDR, CMD_SDR, flash_wait(), LUT0, LUT1, and PINS1.

Referenced by loader::erase_region().

◆ flash_erase_64K_block()

FASTRUN void flash_erase_64K_block ( void * addr)

Definition at line 187 of file eeprom.cpp.

References ADDR_SDR, CMD_SDR, flash_wait(), LUT0, LUT1, and PINS1.

Referenced by loader::erase_region().

◆ flash_erase_sector()

FASTRUN void flash_erase_sector ( void * addr)

Definition at line 139 of file eeprom.cpp.

References ADDR_SDR, CMD_SDR, flash_wait(), LUT0, LUT1, and PINS1.

Referenced by loader::erase_region().

◆ flash_wait()

static FASTRUN void flash_wait ( )
static

Definition at line 78 of file eeprom.cpp.

References CMD_SDR, LUT0, LUT1, PINS1, and READ_SDR.

Referenced by flash_erase_32K_block(), flash_erase_64K_block(), flash_erase_sector(), and flash_write().

◆ flash_write()

FASTRUN void flash_write ( void * addr,
const void * data,
uint32_t len )

Definition at line 99 of file eeprom.cpp.

References ADDR_SDR, CMD_SDR, flash_wait(), LUT0, LUT1, PINS1, PINS4, and WRITE_SDR.

Referenced by loader::flash_write_32().