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 __INPUT_FORMATTER_PUBLIC_H_INCLUDED__
16 #define __INPUT_FORMATTER_PUBLIC_H_INCLUDED__
18 #include <type_support.h>
19 #include "system_types.h"
21 /*! Reset INPUT_FORMATTER[ID]
23 \param ID[in] INPUT_FORMATTER identifier
25 \return none, reset(INPUT_FORMATTER[ID])
27 void input_formatter_rst(
28 const input_formatter_ID_t ID);
30 /*! Set the blocking mode of INPUT_FORMATTER[ID]
32 \param ID[in] INPUT_FORMATTER identifier
33 \param enable[in] blocking enable flag
36 - In HW, the capture unit will deliver an infinite stream of frames,
37 the input formatter will synchronise on the first SOF. In simulation
38 there are only a fixed number of frames, presented only once. By
39 enabling blocking the inputformatter will wait on the first presented
40 frame, thus avoiding race in the simulation setup.
42 \return none, INPUT_FORMATTER[ID].blocking_mode = enable
44 void input_formatter_set_fifo_blocking_mode(
45 const input_formatter_ID_t ID,
48 /*! Return the data alignment of INPUT_FORMATTER[ID]
50 \param ID[in] INPUT_FORMATTER identifier
52 \return alignment(INPUT_FORMATTER[ID].data)
54 unsigned int input_formatter_get_alignment(
55 const input_formatter_ID_t ID);
57 /*! Read the source switch state into INPUT_FORMATTER[ID]
59 \param ID[in] INPUT_FORMATTER identifier
60 \param state[out] input formatter switch state structure
62 \return none, state = INPUT_FORMATTER[ID].switch_state
64 void input_formatter_get_switch_state(
65 const input_formatter_ID_t ID,
66 input_formatter_switch_state_t *state);
68 /*! Read the control registers of INPUT_FORMATTER[ID]
70 \param ID[in] INPUT_FORMATTER identifier
71 \param state[out] input formatter state structure
73 \return none, state = INPUT_FORMATTER[ID].state
75 void input_formatter_get_state(
76 const input_formatter_ID_t ID,
77 input_formatter_state_t *state);
79 /*! Read the control registers of bin copy INPUT_FORMATTER[ID]
81 \param ID[in] INPUT_FORMATTER identifier
82 \param state[out] input formatter state structure
84 \return none, state = INPUT_FORMATTER[ID].state
86 void input_formatter_bin_get_state(
87 const input_formatter_ID_t ID,
88 input_formatter_bin_state_t *state);
90 /*! Write to a control register of INPUT_FORMATTER[ID]
92 \param ID[in] INPUT_FORMATTER identifier
93 \param reg_addr[in] register byte address
94 \param value[in] The data to be written
96 \return none, INPUT_FORMATTER[ID].ctrl[reg] = value
98 STORAGE_CLASS_INPUT_FORMATTER_H void input_formatter_reg_store(
99 const input_formatter_ID_t ID,
100 const hrt_address reg_addr,
101 const hrt_data value);
103 /*! Read from a control register of INPUT_FORMATTER[ID]
105 \param ID[in] INPUT_FORMATTER identifier
106 \param reg_addr[in] register byte address
107 \param value[in] The data to be written
109 \return INPUT_FORMATTER[ID].ctrl[reg]
111 STORAGE_CLASS_INPUT_FORMATTER_H hrt_data input_formatter_reg_load(
112 const input_formatter_ID_t ID,
113 const unsigned int reg_addr);
115 #endif /* __INPUT_FORMATTER_PUBLIC_H_INCLUDED__ */