rt-thread/bsp/swm320-lq100/drivers/board.h

58 lines
1.2 KiB
C
Raw Normal View History

2018-12-24 17:17:27 +08:00
/*
* Copyright (c) 2006-2018, Synwit Technology Co.,Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2018-05-31 ZYH first version
* 2018-12-10 Zohar_Lee format file
*/
2021-09-30 17:55:16 +08:00
#ifndef __BOARD_H__
#define __BOARD_H__
2018-12-24 17:17:27 +08:00
#include <rtthread.h>
2021-09-30 17:55:16 +08:00
#include <rthw.h>
#include <rtdevice.h>
#include <string.h>
2018-12-24 17:17:27 +08:00
#include <SWM320.h>
2021-09-30 17:55:16 +08:00
#ifdef __cplusplus
extern "C"
{
#endif
2018-12-24 17:17:27 +08:00
#define SRAM_BASE 0x20000000
#define SRAM_SIZE 0x20000
2021-09-30 17:55:16 +08:00
#define SRAM_END (SRAM_BASE + SRAM_SIZE)
2018-12-24 17:17:27 +08:00
#ifdef BSP_USING_EXT_SRAM
2021-09-30 17:55:16 +08:00
#define EXT_SRAM_BASE SRAMM_BASE
#define EXT_SRAM_SIZE BSP_EXT_SRAM_SIZE
#define EXT_SRAM_BEGIN EXT_SRAM_BASE
#define EXT_SRAM_END (EXT_SRAM_BASE + EXT_SRAM_SIZE)
2018-12-24 17:17:27 +08:00
#endif
#if defined(__ARMCC_VERSION)
2018-12-24 17:17:27 +08:00
extern int Image$$RW_IRAM1$$ZI$$Limit;
2021-09-30 17:55:16 +08:00
#define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
2018-12-24 17:17:27 +08:00
#elif __ICCARM__
2021-09-30 17:55:16 +08:00
#pragma section = "HEAP"
#define HEAP_BEGIN (__segment_end("HEAP"))
2018-12-24 17:17:27 +08:00
#else
2021-09-30 17:55:16 +08:00
extern int __bss_end;
#define HEAP_BEGIN ((void *)&__bss_end)
2018-12-24 17:17:27 +08:00
#endif
2021-09-30 17:55:16 +08:00
2018-12-24 17:17:27 +08:00
#define HEAP_END SRAM_END
#define HEAP_SIZE (HEAP_END - (rt_uint32_t)HEAP_BEGIN)
2021-09-30 17:55:16 +08:00
void rt_hw_board_init(void);
#ifdef __cplusplus
}
2018-12-24 17:17:27 +08:00
#endif
2021-09-30 17:55:16 +08:00
#endif /* __BOARD_H__ */