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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#ifndef __ISP_PUBLIC_H_INCLUDED__
#define __ISP_PUBLIC_H_INCLUDED__
#include <type_support.h>
#include "system_types.h"
/*! Enable or disable the program complete irq signal of ISP[ID]
\param ID[in] SP identifier
\param cnd[in] predicate
\return none, if(cnd) enable(ISP[ID].irq) else disable(ISP[ID].irq)
*/
void cnd_isp_irq_enable(
const isp_ID_t ID,
const bool cnd);
/*! Read the state of cell ISP[ID]
\param ID[in] ISP identifier
\param state[out] isp state structure
\param stall[out] isp stall conditions
\return none, state = ISP[ID].state, stall = ISP[ID].stall
*/
void isp_get_state(
const isp_ID_t ID,
isp_state_t *state,
isp_stall_t *stall);
/*! Write to the status and control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param value[in] The data to be written
\return none, ISP[ID].sc[reg] = value
*/
STORAGE_CLASS_ISP_H void isp_ctrl_store(
const isp_ID_t ID,
const unsigned int reg,
const hrt_data value);
/*! Read from the status and control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param value[in] The data to be written
\return ISP[ID].sc[reg]
*/
STORAGE_CLASS_ISP_H hrt_data isp_ctrl_load(
const isp_ID_t ID,
const unsigned int reg);
/*! Get the status of a bitfield in the control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param bit[in] The bit index to be checked
\return (ISP[ID].sc[reg] & (1<<bit)) != 0
*/
STORAGE_CLASS_ISP_H bool isp_ctrl_getbit(
const isp_ID_t ID,
const unsigned int reg,
const unsigned int bit);
/*! Set a bitfield in the control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param bit[in] The bit index to be set
\return none, ISP[ID].sc[reg] |= (1<<bit)
*/
STORAGE_CLASS_ISP_H void isp_ctrl_setbit(
const isp_ID_t ID,
const unsigned int reg,
const unsigned int bit);
/*! Clear a bitfield in the control register of ISP[ID]
\param ID[in] ISP identifier
\param reg[in] register index
\param bit[in] The bit index to be set
\return none, ISP[ID].sc[reg] &= ~(1<<bit)
*/
STORAGE_CLASS_ISP_H void isp_ctrl_clearbit(
const isp_ID_t ID,
const unsigned int reg,
const unsigned int bit);
/*! Write to the DMEM of ISP[ID]
\param ID[in] ISP identifier
\param addr[in] the address in DMEM
\param data[in] The data to be written
\param size[in] The size(in bytes) of the data to be written
\return none, ISP[ID].dmem[addr...addr+size-1] = data
*/
STORAGE_CLASS_ISP_H void isp_dmem_store(
const isp_ID_t ID,
unsigned int addr,
const void *data,
const size_t size);
/*! Read from the DMEM of ISP[ID]
\param ID[in] ISP identifier
\param addr[in] the address in DMEM
\param data[in] The data to be read
\param size[in] The size(in bytes) of the data to be read
\return none, data = ISP[ID].dmem[addr...addr+size-1]
*/
STORAGE_CLASS_ISP_H void isp_dmem_load(
const isp_ID_t ID,
const unsigned int addr,
void *data,
const size_t size);
/*! Write a 32-bit datum to the DMEM of ISP[ID]
\param ID[in] ISP identifier
\param addr[in] the address in DMEM
\param data[in] The data to be written
\param size[in] The size(in bytes) of the data to be written
\return none, ISP[ID].dmem[addr] = data
*/
STORAGE_CLASS_ISP_H void isp_dmem_store_uint32(
const isp_ID_t ID,
unsigned int addr,
const uint32_t data);
/*! Load a 32-bit datum from the DMEM of ISP[ID]
\param ID[in] ISP identifier
\param addr[in] the address in DMEM
\param data[in] The data to be read
\param size[in] The size(in bytes) of the data to be read
\return none, data = ISP[ID].dmem[addr]
*/
STORAGE_CLASS_ISP_H uint32_t isp_dmem_load_uint32(
const isp_ID_t ID,
const unsigned int addr);
/*! Concatenate the LSW and MSW into a double precision word
\param x0[in] Integer containing the LSW
\param x1[in] Integer containing the MSW
\return x0 | (x1 << bits_per_vector_element)
*/
STORAGE_CLASS_ISP_H uint32_t isp_2w_cat_1w(
const u16 x0,
const uint16_t x1);
unsigned int isp_is_ready(isp_ID_t ID);
unsigned int isp_is_sleeping(isp_ID_t ID);
void isp_start(isp_ID_t ID);
void isp_wake(isp_ID_t ID);
#endif /* __ISP_PUBLIC_H_INCLUDED__ */
|