1 /*
2  * Copyright (C) 2017-2019 Alibaba Group Holding Limited
3  */
4 
5 /******************************************************************************
6  * @file     drv_sasc.h
7  * @brief    header file for sasc driver
8  * @version  V1.0
9  * @date     02. June 2017
10  * @model    sasc
11  ******************************************************************************/
12 #ifndef _CSI_SASC_H_
13 #define _CSI_SASC_H_
14 
15 
16 #include <stdint.h>
17 #include <drv/common.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 typedef enum {
23     SASC_AP_RW = 0,
24     SASC_AP_RO = 1,
25     SASC_AP_WO = 2,
26     SASC_AP_DN = 3
27 }
28 sasc_ap_e;
29 
30 typedef enum {
31     SASC_CD_DI = 0,
32     SASC_CD_DA = 1,
33     SASC_CD_IN = 2,
34     SASC_CD_DN = 3
35 } sasc_cd_e;
36 
37 typedef enum {
38     SASC_SRAM_4B = 5,
39     SASC_SRAM_8B = 6,
40     SASC_SRAM_16B = 7,
41     SASC_SRAM_32B = 8,
42     SASC_SRAM_64B = 9,
43     SASC_SRAM_128B = 10,
44     SASC_SRAM_256B = 11,
45     SASC_SRAM_512B = 12,
46     SASC_SRAM_1KB = 13,
47     SASC_SRAM_2KB = 14,
48     SASC_SRAM_4KB = 15,
49     SASC_SRAM_8KB = 16,
50     SASC_SRAM_16KB = 17,
51     SASC_SRAM_32KB = 18,
52     SASC_SRAM_64KB = 19,
53     SASC_SRAM_128KB = 20,
54     SASC_FLASH_1S = 21,
55     SASC_FLASH_2S = 22,
56     SASC_FLASH_4S = 23,
57     SASC_FLASH_8S = 24,
58     SASC_FLASH_16S = 25,
59     SASC_FLASH_32S = 26,
60     SASC_FLASH_64S = 27,
61     SASC_FLASH_128S = 28,
62     SASC_FLASH_256S = 29,
63     SASC_FLASH_512S = 30,
64     SASC_FLASH_1024S = 31,
65     SASC_FLASH_2048S = 32
66 } sasc_size_e;
67 
68 /**
69   \brief       Config the sasc region attribute.
70   \param[in]   handle  sasc handle to operate.
71   \param[in]   addr  config region base address.
72   \param[in]   size  config region addr.
73   \param[in]   sap   super mode ap.
74   \param[in]   uap   user mode ap.
75   \param[in]   scd   super mode cd.
76   \param[in]   ucd   user mode cd.
77   \param[in]   is_security  config the region is security or not.
78   \return      error code
79 */
80 int32_t drv_sasc_config_region(uint32_t addr, sasc_size_e size, sasc_ap_e sap, sasc_ap_e uap, sasc_cd_e ucd, uint8_t is_security);
81 
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif /* _CSI_SASC_H_ */
88