/*
 * Copyright 2022 MindMotion Microelectronics Co., Ltd.
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
#ifndef __MEM_PORT_H__
#define __MEM_PORT_H__

#include "board_init.h"

/* memory info type. */
typedef struct
{
    uint32_t base;
    uint32_t size;
} mem_port_info_t;

/* memory list. */
extern const mem_port_info_t mem_port_list[];
/* memory list len, memory num. */
extern const uint32_t             mem_port_num;

/* execute the program @base. */
void     mem_port_exec (uint32_t base);
/* erase memory. */
uint32_t mem_port_erase(uint32_t base, uint32_t size);
/* write contents to memory. */
uint32_t mem_port_write(uint32_t base, uint8_t * buf, uint32_t size);

#endif /* __MEM_PORT_H__. */
