1141cc406Sopenharmony_ci/* sane - Scanner Access Now Easy.
2141cc406Sopenharmony_ci
3141cc406Sopenharmony_ci   Copyright (C) 2003-2004 Henning Meier-Geinitz <henning@meier-geinitz.de>
4141cc406Sopenharmony_ci   Copyright (C) 2004-2005 Gerhard Jaeger <gerhard@gjaeger.de>
5141cc406Sopenharmony_ci   Copyright (C) 2004-2013 Stéphane Voltz <stef.dev@free.fr>
6141cc406Sopenharmony_ci   Copyright (C) 2005-2009 Pierre Willenbrock <pierre@pirsoft.dnsalias.org>
7141cc406Sopenharmony_ci
8141cc406Sopenharmony_ci   This file is part of the SANE package.
9141cc406Sopenharmony_ci
10141cc406Sopenharmony_ci   This program is free software; you can redistribute it and/or
11141cc406Sopenharmony_ci   modify it under the terms of the GNU General Public License as
12141cc406Sopenharmony_ci   published by the Free Software Foundation; either version 2 of the
13141cc406Sopenharmony_ci   License, or (at your option) any later version.
14141cc406Sopenharmony_ci
15141cc406Sopenharmony_ci   This program is distributed in the hope that it will be useful, but
16141cc406Sopenharmony_ci   WITHOUT ANY WARRANTY; without even the implied warranty of
17141cc406Sopenharmony_ci   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18141cc406Sopenharmony_ci   General Public License for more details.
19141cc406Sopenharmony_ci
20141cc406Sopenharmony_ci   You should have received a copy of the GNU General Public License
21141cc406Sopenharmony_ci   along with this program.  If not, see <https://www.gnu.org/licenses/>.
22141cc406Sopenharmony_ci*/
23141cc406Sopenharmony_ci
24141cc406Sopenharmony_ci#ifndef BACKEND_GENESYS_GL646_H
25141cc406Sopenharmony_ci#define BACKEND_GENESYS_GL646_H
26141cc406Sopenharmony_ci
27141cc406Sopenharmony_ci#include "genesys.h"
28141cc406Sopenharmony_ci#include "command_set_common.h"
29141cc406Sopenharmony_ci#include "motor.h"
30141cc406Sopenharmony_ci
31141cc406Sopenharmony_cinamespace genesys {
32141cc406Sopenharmony_cinamespace gl646 {
33141cc406Sopenharmony_ci
34141cc406Sopenharmony_ciclass CommandSetGl646 : public CommandSetCommon
35141cc406Sopenharmony_ci{
36141cc406Sopenharmony_cipublic:
37141cc406Sopenharmony_ci    ~CommandSetGl646() override = default;
38141cc406Sopenharmony_ci
39141cc406Sopenharmony_ci    bool needs_home_before_init_regs_for_scan(Genesys_Device* dev) const override;
40141cc406Sopenharmony_ci
41141cc406Sopenharmony_ci    void init(Genesys_Device* dev) const override;
42141cc406Sopenharmony_ci
43141cc406Sopenharmony_ci    void init_regs_for_warmup(Genesys_Device* dev, const Genesys_Sensor& sensor,
44141cc406Sopenharmony_ci                              Genesys_Register_Set* regs) const override;
45141cc406Sopenharmony_ci
46141cc406Sopenharmony_ci    void init_regs_for_shading(Genesys_Device* dev, const Genesys_Sensor& sensor,
47141cc406Sopenharmony_ci                               Genesys_Register_Set& regs) const override;
48141cc406Sopenharmony_ci
49141cc406Sopenharmony_ci    void init_regs_for_scan_session(Genesys_Device* dev, const Genesys_Sensor& sensor,
50141cc406Sopenharmony_ci                                    Genesys_Register_Set* reg,
51141cc406Sopenharmony_ci                                    const ScanSession& session) const override;
52141cc406Sopenharmony_ci
53141cc406Sopenharmony_ci    void set_fe(Genesys_Device* dev, const Genesys_Sensor& sensor, std::uint8_t set) const override;
54141cc406Sopenharmony_ci    void set_powersaving(Genesys_Device* dev, int delay) const override;
55141cc406Sopenharmony_ci    void save_power(Genesys_Device* dev, bool enable) const override;
56141cc406Sopenharmony_ci
57141cc406Sopenharmony_ci    void begin_scan(Genesys_Device* dev, const Genesys_Sensor& sensor,
58141cc406Sopenharmony_ci                    Genesys_Register_Set* regs, bool start_motor) const override;
59141cc406Sopenharmony_ci
60141cc406Sopenharmony_ci    void end_scan(Genesys_Device* dev, Genesys_Register_Set* regs, bool check_stop) const override;
61141cc406Sopenharmony_ci
62141cc406Sopenharmony_ci    void send_gamma_table(Genesys_Device* dev, const Genesys_Sensor& sensor) const override;
63141cc406Sopenharmony_ci
64141cc406Sopenharmony_ci    void offset_calibration(Genesys_Device* dev, const Genesys_Sensor& sensor,
65141cc406Sopenharmony_ci                            Genesys_Register_Set& regs) const override;
66141cc406Sopenharmony_ci
67141cc406Sopenharmony_ci    void coarse_gain_calibration(Genesys_Device* dev, const Genesys_Sensor& sensor,
68141cc406Sopenharmony_ci                                 Genesys_Register_Set& regs, int dpi) const override;
69141cc406Sopenharmony_ci
70141cc406Sopenharmony_ci    SensorExposure led_calibration(Genesys_Device* dev, const Genesys_Sensor& sensor,
71141cc406Sopenharmony_ci                                   Genesys_Register_Set& regs) const override;
72141cc406Sopenharmony_ci
73141cc406Sopenharmony_ci    void wait_for_motor_stop(Genesys_Device* dev) const override;
74141cc406Sopenharmony_ci
75141cc406Sopenharmony_ci    void move_back_home(Genesys_Device* dev, bool wait_until_home) const override;
76141cc406Sopenharmony_ci
77141cc406Sopenharmony_ci    void update_hardware_sensors(struct Genesys_Scanner* s) const override;
78141cc406Sopenharmony_ci
79141cc406Sopenharmony_ci    void update_home_sensor_gpio(Genesys_Device& dev) const override;
80141cc406Sopenharmony_ci
81141cc406Sopenharmony_ci    void load_document(Genesys_Device* dev) const override;
82141cc406Sopenharmony_ci
83141cc406Sopenharmony_ci    void detect_document_end(Genesys_Device* dev) const override;
84141cc406Sopenharmony_ci
85141cc406Sopenharmony_ci    void eject_document(Genesys_Device* dev) const override;
86141cc406Sopenharmony_ci
87141cc406Sopenharmony_ci    void send_shading_data(Genesys_Device* dev, const Genesys_Sensor& sensor, std::uint8_t* data,
88141cc406Sopenharmony_ci                           int size) const override;
89141cc406Sopenharmony_ci
90141cc406Sopenharmony_ci    bool has_send_shading_data() const override
91141cc406Sopenharmony_ci    {
92141cc406Sopenharmony_ci        return false;
93141cc406Sopenharmony_ci    }
94141cc406Sopenharmony_ci
95141cc406Sopenharmony_ci    ScanSession calculate_scan_session(const Genesys_Device* dev,
96141cc406Sopenharmony_ci                                       const Genesys_Sensor& sensor,
97141cc406Sopenharmony_ci                                       const Genesys_Settings& settings) const override;
98141cc406Sopenharmony_ci
99141cc406Sopenharmony_ci    void asic_boot(Genesys_Device* dev, bool cold) const override;
100141cc406Sopenharmony_ci};
101141cc406Sopenharmony_ci
102141cc406Sopenharmony_ci} // namespace gl646
103141cc406Sopenharmony_ci} // namespace genesys
104141cc406Sopenharmony_ci
105141cc406Sopenharmony_ci#endif // BACKEND_GENESYS_GL646_H
106