54 lines
1.5 KiB
C
54 lines
1.5 KiB
C
|
#ifndef _DSP_H
|
||
|
#define _DSP_H
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include <stdbool.h>
|
||
|
|
||
|
#include "fr30xx.h"
|
||
|
|
||
|
#define DSP_IRAM_BASE_ADDR 0x78400000
|
||
|
#define DSP_IMEM_MCU_BASE_ADDR 0x1FFC0000
|
||
|
#define DSP_DRAM_BASE_ADDR 0x781E0000
|
||
|
#define DSP_DRAM_MCU_BASE_ADDR 0x200C0000
|
||
|
#define DSP_IRAM_SIZE 0x00020000
|
||
|
#define DSP_DRAM_SIZE 0x00040000
|
||
|
|
||
|
#define DSP_IRAM_2_MCU_SRAM(x) ((uint32_t)(x) - DSP_IRAM_BASE_ADDR + DSP_IMEM_MCU_BASE_ADDR)
|
||
|
#define DSP_DRAM_2_MCU_SRAM(x) ((uint32_t)(x) - DSP_DRAM_BASE_ADDR + DSP_DRAM_MCU_BASE_ADDR)
|
||
|
#define MCU_SRAM_2_DSP_DRAM(x) ((uint32_t)(x) - DSP_DRAM_MCU_BASE_ADDR + DSP_DRAM_BASE_ADDR)
|
||
|
|
||
|
//__INLINE void dsp_reset_vector_set(uint32_t vector)
|
||
|
//{
|
||
|
// SYSTEM->DSPVectorConfig.DSP_VEC_TBL = vector;
|
||
|
// SYSTEM->DSPVectorConfig.DSP_VEC_SEL = 1;
|
||
|
//}
|
||
|
|
||
|
//__INLINE void dsp_reset(void)
|
||
|
//{
|
||
|
// SYSTEM->DSPRegReset.DSP_MAS_SFT_RST = 1;
|
||
|
//}
|
||
|
|
||
|
//__INLINE void dsp_release(void)
|
||
|
//{
|
||
|
// SYSTEM->DSPRegReset.DSP_MAS_SFT_RST = 0;
|
||
|
//}
|
||
|
|
||
|
//__INLINE void dsp_run(void)
|
||
|
//{
|
||
|
// SYSTEM->DSPCTRL.DSP_RUNSTALL = 0;
|
||
|
//}
|
||
|
|
||
|
//__INLINE void dsp_stall(void)
|
||
|
//{
|
||
|
// SYSTEM->DSPCTRL.DSP_RUNSTALL = 1;
|
||
|
//}
|
||
|
|
||
|
bool dsp_load_code_from_fs(char *path);
|
||
|
bool dsp_load_code_from_internal_flash(uint32_t address, uint32_t length);
|
||
|
bool dsp_load_rw_from_internal_flash(uint32_t address, uint32_t length);
|
||
|
|
||
|
void dsp_prepare(void);
|
||
|
void dsp_run(uint32_t vector);
|
||
|
|
||
|
#endif // _DSP_H
|