genesys: Allow full value range of the frontend registers to be set

merge-requests/185/head
Povilas Kanapickas 2019-09-15 14:46:46 +03:00
rodzic 2bb31ed5d8
commit 079fa25b0d
2 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -4678,7 +4678,7 @@ probe_genesys_devices (void)
of Genesys_Calibration_Cache as is.
*/
static const char* CALIBRATION_IDENT = "sane_genesys";
static const int CALIBRATION_VERSION = 9;
static const int CALIBRATION_VERSION = 10;
bool read_calibration(std::istream& str, Genesys_Device::Calibration& calibration,
const std::string& path)

Wyświetl plik

@ -98,30 +98,30 @@ struct Genesys_Frontend
// id of the frontend description
uint8_t fe_id = 0;
// all registers of the frontend
GenesysRegisterSettingSet regs;
// all registers of the frontend. Note that the registers can hold 9-bit values
RegisterSettingSet<std::uint16_t> regs;
// extra control registers
std::array<uint8_t, 3> reg2 = {};
std::array<std::uint16_t, 3> reg2 = {};
GenesysFrontendLayout layout;
void set_offset(unsigned which, uint8_t value)
void set_offset(unsigned which, std::uint16_t value)
{
regs.set_value(layout.offset_addr[which], value);
}
void set_gain(unsigned which, uint8_t value)
void set_gain(unsigned which, std::uint16_t value)
{
regs.set_value(layout.gain_addr[which], value);
}
uint8_t get_offset(unsigned which) const
std::uint16_t get_offset(unsigned which) const
{
return regs.get_value(layout.offset_addr[which]);
}
uint8_t get_gain(unsigned which) const
std::uint16_t get_gain(unsigned which) const
{
return regs.get_value(layout.gain_addr[which]);
}