2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 #ifndef __SP_PUBLIC_H_INCLUDED__
16 #define __SP_PUBLIC_H_INCLUDED__
18 #include <type_support.h>
19 #include "system_types.h"
21 typedef struct sp_state_s sp_state_t;
22 typedef struct sp_stall_s sp_stall_t;
24 /*! Enable or disable the program complete irq signal of SP[ID]
26 \param ID[in] SP identifier
27 \param cnd[in] predicate
29 \return none, if(cnd) enable(SP[ID].irq) else disable(SP[ID].irq)
31 extern void cnd_sp_irq_enable(
35 /*! Read the state of cell SP[ID]
37 \param ID[in] SP identifier
38 \param state[out] sp state structure
39 \param stall[out] isp stall conditions
41 \return none, state = SP[ID].state, stall = SP[ID].stall
43 extern void sp_get_state(
48 /*! Write to the status and control register of SP[ID]
50 \param ID[in] SP identifier
51 \param reg[in] register index
52 \param value[in] The data to be written
54 \return none, SP[ID].sc[reg] = value
56 STORAGE_CLASS_SP_H void sp_ctrl_store(
58 const hrt_address reg,
59 const hrt_data value);
61 /*! Read from the status and control register of SP[ID]
63 \param ID[in] SP identifier
64 \param reg[in] register index
65 \param value[in] The data to be written
67 \return SP[ID].sc[reg]
69 STORAGE_CLASS_SP_H hrt_data sp_ctrl_load(
71 const hrt_address reg);
73 /*! Get the status of a bitfield in the control register of SP[ID]
75 \param ID[in] SP identifier
76 \param reg[in] register index
77 \param bit[in] The bit index to be checked
79 \return (SP[ID].sc[reg] & (1<<bit)) != 0
81 STORAGE_CLASS_SP_H bool sp_ctrl_getbit(
83 const hrt_address reg,
84 const unsigned int bit);
86 /*! Set a bitfield in the control register of SP[ID]
88 \param ID[in] SP identifier
89 \param reg[in] register index
90 \param bit[in] The bit index to be set
92 \return none, SP[ID].sc[reg] |= (1<<bit)
94 STORAGE_CLASS_SP_H void sp_ctrl_setbit(
96 const hrt_address reg,
97 const unsigned int bit);
99 /*! Clear a bitfield in the control register of SP[ID]
101 \param ID[in] SP identifier
102 \param reg[in] register index
103 \param bit[in] The bit index to be set
105 \return none, SP[ID].sc[reg] &= ~(1<<bit)
107 STORAGE_CLASS_SP_H void sp_ctrl_clearbit(
109 const hrt_address reg,
110 const unsigned int bit);
112 /*! Write to the DMEM of SP[ID]
114 \param ID[in] SP identifier
115 \param addr[in] the address in DMEM
116 \param data[in] The data to be written
117 \param size[in] The size(in bytes) of the data to be written
119 \return none, SP[ID].dmem[addr...addr+size-1] = data
121 STORAGE_CLASS_SP_H void sp_dmem_store(
127 /*! Read from the DMEM of SP[ID]
129 \param ID[in] SP identifier
130 \param addr[in] the address in DMEM
131 \param data[in] The data to be read
132 \param size[in] The size(in bytes) of the data to be read
134 \return none, data = SP[ID].dmem[addr...addr+size-1]
136 STORAGE_CLASS_SP_H void sp_dmem_load(
138 const hrt_address addr,
142 /*! Write a 8-bit datum to the DMEM of SP[ID]
144 \param ID[in] SP identifier
145 \param addr[in] the address in DMEM
146 \param data[in] The data to be written
147 \param size[in] The size(in bytes) of the data to be written
149 \return none, SP[ID].dmem[addr...addr+size-1] = data
151 STORAGE_CLASS_SP_H void sp_dmem_store_uint8(
156 /*! Write a 16-bit datum to the DMEM of SP[ID]
158 \param ID[in] SP identifier
159 \param addr[in] the address in DMEM
160 \param data[in] The data to be written
161 \param size[in] The size(in bytes) of the data to be written
163 \return none, SP[ID].dmem[addr...addr+size-1] = data
165 STORAGE_CLASS_SP_H void sp_dmem_store_uint16(
168 const uint16_t data);
170 /*! Write a 32-bit datum to the DMEM of SP[ID]
172 \param ID[in] SP identifier
173 \param addr[in] the address in DMEM
174 \param data[in] The data to be written
175 \param size[in] The size(in bytes) of the data to be written
177 \return none, SP[ID].dmem[addr...addr+size-1] = data
179 STORAGE_CLASS_SP_H void sp_dmem_store_uint32(
182 const uint32_t data);
184 /*! Load a 8-bit datum from the DMEM of SP[ID]
186 \param ID[in] SP identifier
187 \param addr[in] the address in DMEM
188 \param data[in] The data to be read
189 \param size[in] The size(in bytes) of the data to be read
191 \return none, data = SP[ID].dmem[addr...addr+size-1]
193 STORAGE_CLASS_SP_H uint8_t sp_dmem_load_uint8(
195 const hrt_address addr);
197 /*! Load a 16-bit datum from the DMEM of SP[ID]
199 \param ID[in] SP identifier
200 \param addr[in] the address in DMEM
201 \param data[in] The data to be read
202 \param size[in] The size(in bytes) of the data to be read
204 \return none, data = SP[ID].dmem[addr...addr+size-1]
206 STORAGE_CLASS_SP_H uint16_t sp_dmem_load_uint16(
208 const hrt_address addr);
210 /*! Load a 32-bit datum from the DMEM of SP[ID]
212 \param ID[in] SP identifier
213 \param addr[in] the address in DMEM
214 \param data[in] The data to be read
215 \param size[in] The size(in bytes) of the data to be read
217 \return none, data = SP[ID].dmem[addr...addr+size-1]
219 STORAGE_CLASS_SP_H uint32_t sp_dmem_load_uint32(
221 const hrt_address addr);
223 #endif /* __SP_PUBLIC_H_INCLUDED__ */