detect_sensors.h 1.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/***************************************************************************//**
* @file      detect_sensors.h
* @brief     Determine sensor boards attached to each of the ports. Use
*            Device Tree, sysfs to set sensor types per port. Add autodetection
*            (using pullup/pull downs) later
* @copyright Copyright 2016 (C) Elphel, Inc.
* @par <b>License</b>
*  This program is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 2 of the License, or
*  (at your option) any later version.
*  This program is distributed in the hope that 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.
*  You should have received a copy of the GNU General Public License
*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/

#define DETECT_SENSOR 1 ///< Include sensors, May be OR-ed when looking for sensor/multiplexer code/name
#define DETECT_MUX 2    ///< Include multiplexers, May be OR-ed when looking for sensor/multiplexer code/name

Andrey Filippov's avatar
Andrey Filippov committed
23 24
typedef enum {NONE,PARALLEL12,HISPI4} sens_iface_t; ///< Sensor port interface type

25 26
int          get_code_by_name(const char * name, int type);
const char * get_name_by_code(int code, int type);
Andrey Filippov's avatar
Andrey Filippov committed
27 28
sens_iface_t get_iface_by_code(int code, int type);

29 30
int get_detected_mux_code(int port);
int get_detected_sensor_code(int port, int sub_chn);
Andrey Filippov's avatar
Andrey Filippov committed
31
int get_subchannels(int port);
32 33
int set_detected_mux_code(int port, int mux_type);
int set_detected_sensor_code(int port, int sub_chn,  int mux_type);
Andrey Filippov's avatar
Andrey Filippov committed
34
sens_iface_t get_port_interface(int port);