summaryrefslogtreecommitdiff
path: root/bsp/yichip/yc3122-pos/libraries/core/rom_api.h
blob: 5f8b7fcea44d0e492d36cecbf699195e13d74a4a (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * Copyright (c) 2006-2020, YICHIP Development Team
 * @file     yc_rom_api.h
 * @brief    source file for setting rom_api
 *
 * Change Logs:
 * Date           Author      Version        Notes
 * 2020-11-05     wushengyan         V1.0.0         the first version
 */
#ifndef __ROM_API_H__
#define __ROM_API_H__

#define YC3122_AA   (0)
#define YC3122_AB   (1)
#define IC_DEVICE   YC3122_AB
#if (IC_DEVICE == YC3122_AA) 
/* TIMER */
#define FUNC_DELAY_US_ADDR                  (0x5030 + 1)
#define FUNC_DELAY_MS_ADDR                  (0x5068 + 1)

/* OTP */
#define FUNC_INIT_OTP_ADDR                  (0x5468 + 1)
#define FUNC_DEINIT_OTP_ADDR                (0x54c8 + 1)
#define FUNC_READ_OTP_ADDR                  (0x5510 + 1)
#define FUNC_WRITE_OTP_ADDR                 (0x5648 + 1)
#define FUNC_READ_CHIPID_ADDR               (0x56ac + 1)
#define FUNC_READ_CHIPLF_ADDR               (0x56ba + 1)

/* LPM */
#define FUNC_LIGHT_SLEEP_ADDR               (0x5338 + 1)
#define FUNC_DEEP_SLEEP_ADDR                (0x535c + 1)

/* QSPI */
#define FUNC_ENC_WRITE_FLASH_ADDR           (0x67c0 + 1)
#define FUNC_QSPI_FLASH_SECTORERASE_ADDR    (0x59a8 + 1)
#define FUNC_QSPI_FLASH_BLOCKERASE_ADDR     (0x59b4 + 1)
#define FUNC_QSPI_FLASH_BLOCK64ERASE_ADDR   (0x59c0 + 1)
#define FUNC_QSPI_FLASH_WRITE_ADDR          (0x58e8 + 1)
#define FUNC_QSPI_FLASH_READ_ADDR           (0x59ea + 1)
#define FUNC_FLASH_BLANK_CHECK              (0x670c + 1)
#define FUNC_PREFETCH                       (0x5398 + 1)
#define FUNC_READ_FLASH_ID                  (0x5a54 + 1)

#elif (IC_DEVICE == YC3122_AB)

/* TIMER */
#define FUNC_DELAY_US_ADDR                  (0x5020 + 1)
#define FUNC_DELAY_MS_ADDR                  (0x5058 + 1)

/* OTP */
#define FUNC_INIT_OTP_ADDR                  (0x5458 + 1)
#define FUNC_DEINIT_OTP_ADDR                (0x54b8 + 1)
#define FUNC_READ_OTP_ADDR                  (0x5500 + 1)
#define FUNC_WRITE_OTP_ADDR                 (0x5638 + 1)
#define FUNC_READ_CHIPID_ADDR               (0x569c + 1)
#define FUNC_READ_CHIPLF_ADDR               (0x56aa + 1)

/* LPM */
#define FUNC_LIGHT_SLEEP_ADDR               (0x5328 + 1)
#define FUNC_DEEP_SLEEP_ADDR                (0x534c + 1)

/* QSPI */
#define FUNC_ENC_WRITE_FLASH_ADDR           (0x6798 + 1)
#define FUNC_QSPI_FLASH_SECTORERASE_ADDR    (0x5998 + 1)
#define FUNC_QSPI_FLASH_BLOCKERASE_ADDR     (0x59a4 + 1)
#define FUNC_QSPI_FLASH_BLOCK64ERASE_ADDR   (0x59b0 + 1)
#define FUNC_QSPI_FLASH_WRITE_ADDR          (0x58d8 + 1)
#define FUNC_QSPI_FLASH_READ_ADDR           (0x59da + 1)
#define FUNC_FLASH_BLANK_CHECK              (0x66e4 + 1)
#define FUNC_PREFETCH                       (0x5388 + 1)
#define FUNC_READ_FLASH_ID                  (0x5a44 + 1)
#define FUNC_QSPI_FLASH_CMD                 (0x57ec + 1)

#endif


#endif