Commit ba932fcf authored by Spencer E. Olson's avatar Spencer E. Olson Committed by Greg Kroah-Hartman

staging: comedi: ni_routing: Add NI signal routing info

See README for a thorough discussion of this content.

Adds tables of all register values for routing various signals to various
terminals on National Instruments hardware.  This information is directly
compared to and taken from register-level programming documentation and/or
register-level programming examples as provided by National Instruments.

Furthermore, this information was mostly compared (favorably) to the
register values already used in the comedi drivers for NI hardware.

Adds tables of valid routes for many devices.  This information is not
consistent from device to device, nor entirely consistent within device
families.  One additional major challenge is that this information does not
seem to be obtainable in any programmatic fashion, neither through the
proprietary NIDAQmx(-base) c-libraries, nor with register level
programming, _nor_ through any documentation.  In fact, the only consistent
source of this information is through the proprietary NI-MAX software,
which currently only runs on Windows platforms.  A further challenge is
that this information cannot be exported from NI-MAX, except by screenshot.

The collection and maintenance of this information is somewhat tedious and
requires frequent re-examination and comparison of NI-MAX and/or the
NI-MHDDK documentation (register programming information) and NI-MHDDK
examples.  Tools are added with this patch to facilitate generating CSV
files from the data tables.  These CSV files can be used with a spreadsheet
program to provide better visual comparision with screenshots gathered from
NI-MAX.  Tools are also added to regenerate the data tables from CSV
content--this greatly enhances updating data tables with large changes
(such as when adding devices).
Signed-off-by: default avatarSpencer E. Olson <olsonse@umich.edu>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d7569ad7
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0+
/* vim: set ts=8 sw=8 noet tw=80 nowrap: */
/*
* comedi/drivers/ni_routing/ni_device_routes.c
* List of valid routes for specific NI boards.
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 2016 Spencer E. Olson <olsonse@umich.edu>
*
* 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.
*/
/*
* The contents of this file are generated using the tools in
* comedi/drivers/ni_routing/tools
*
* Please use those tools to help maintain the contents of this file.
*/
#include "ni_device_routes.h"
#include "ni_device_routes/all.h"
struct ni_device_routes *const ni_device_routes_list[] = {
&ni_pxi_6030e_device_routes,
&ni_pci_6070e_device_routes,
&ni_pci_6220_device_routes,
&ni_pci_6221_device_routes,
&ni_pxi_6224_device_routes,
&ni_pxi_6225_device_routes,
&ni_pci_6229_device_routes,
&ni_pci_6251_device_routes,
&ni_pxi_6251_device_routes,
&ni_pxie_6251_device_routes,
&ni_pci_6254_device_routes,
&ni_pci_6259_device_routes,
&ni_pci_6534_device_routes,
&ni_pci_6602_device_routes,
&ni_pci_6713_device_routes,
&ni_pci_6723_device_routes,
&ni_pci_6733_device_routes,
&ni_pxi_6733_device_routes,
NULL,
};
/* SPDX-License-Identifier: GPL-2.0+ */
/* vim: set ts=8 sw=8 noet tw=80 nowrap: */
/*
* comedi/drivers/ni_routing/ni_device_routes.c
* List of valid routes for specific NI boards.
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 2016 Spencer E. Olson <olsonse@umich.edu>
*
* 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.
*/
/*
* This file is meant to be included by comedi/drivers/ni_routes.c
*/
#ifndef _COMEDI_DRIVERS_NI_ROUTINT_NI_DEVICE_ROUTES_H
#define _COMEDI_DRIVERS_NI_ROUTINT_NI_DEVICE_ROUTES_H
#include "../ni_routes.h"
extern struct ni_device_routes *const ni_device_routes_list[];
#endif /* _COMEDI_DRIVERS_NI_ROUTINT_NI_DEVICE_ROUTES_H */
/* SPDX-License-Identifier: GPL-2.0+ */
/* vim: set ts=8 sw=8 noet tw=80 nowrap: */
/*
* comedi/drivers/ni_routing/ni_device_routes/all.h
* List of valid routes for specific NI boards.
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 2016 Spencer E. Olson <olsonse@umich.edu>
*
* 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.
*/
/*
* The contents of this file are generated using the tools in
* comedi/drivers/ni_routing/tools
*
* Please use those tools to help maintain the contents of this file.
*/
#ifndef _COMEDI_DRIVERS_NI_ROUTING_NI_DEVICE_ROUTES_EXTERN_H
#define _COMEDI_DRIVERS_NI_ROUTING_NI_DEVICE_ROUTES_EXTERN_H
#include "../ni_device_routes.h"
extern struct ni_device_routes ni_pxi_6030e_device_routes;
extern struct ni_device_routes ni_pci_6070e_device_routes;
extern struct ni_device_routes ni_pci_6220_device_routes;
extern struct ni_device_routes ni_pci_6221_device_routes;
extern struct ni_device_routes ni_pxi_6224_device_routes;
extern struct ni_device_routes ni_pxi_6225_device_routes;
extern struct ni_device_routes ni_pci_6229_device_routes;
extern struct ni_device_routes ni_pci_6251_device_routes;
extern struct ni_device_routes ni_pxi_6251_device_routes;
extern struct ni_device_routes ni_pxie_6251_device_routes;
extern struct ni_device_routes ni_pci_6254_device_routes;
extern struct ni_device_routes ni_pci_6259_device_routes;
extern struct ni_device_routes ni_pci_6534_device_routes;
extern struct ni_device_routes ni_pxie_6535_device_routes;
extern struct ni_device_routes ni_pci_6602_device_routes;
extern struct ni_device_routes ni_pci_6713_device_routes;
extern struct ni_device_routes ni_pci_6723_device_routes;
extern struct ni_device_routes ni_pci_6733_device_routes;
extern struct ni_device_routes ni_pxi_6733_device_routes;
extern struct ni_device_routes ni_pxie_6738_device_routes;
#endif //_COMEDI_DRIVERS_NI_ROUTING_NI_DEVICE_ROUTES_EXTERN_H
// SPDX-License-Identifier: GPL-2.0+
/* vim: set ts=8 sw=8 noet tw=80 nowrap: */
/*
* comedi/drivers/ni_routing/ni_device_routes/pci-6534.c
* List of valid routes for specific NI boards.
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 2016 Spencer E. Olson <olsonse@umich.edu>
*
* 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.
*/
/*
* The contents of this file are generated using the tools in
* comedi/drivers/ni_routing/tools
*
* Please use those tools to help maintain the contents of this file.
*/
#include "../ni_device_routes.h"
#include "all.h"
struct ni_device_routes ni_pci_6534_device_routes = {
.device = "pci-6534",
.routes = (struct ni_route_set[]){
{
.dest = NI_PFI(0),
.src = (int[]){
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = NI_PFI(1),
.src = (int[]){
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = NI_PFI(2),
.src = (int[]){
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = NI_PFI(3),
.src = (int[]){
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = NI_PFI(4),
.src = (int[]){
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = NI_PFI(5),
.src = (int[]){
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = NI_PFI(6),
.src = (int[]){
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = NI_PFI(7),
.src = (int[]){
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(0),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(1),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
TRIGGER_LINE(0),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(2),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(3),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(4),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(5),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(6),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(7),
.src = (int[]){
NI_20MHzTimebase,
0, /* Termination */
}
},
{
.dest = NI_MasterTimebase,
.src = (int[]){
TRIGGER_LINE(7),
NI_20MHzTimebase,
0, /* Termination */
}
},
{ /* Termination of list */
.dest = 0,
},
},
};
// SPDX-License-Identifier: GPL-2.0+
/* vim: set ts=8 sw=8 noet tw=80 nowrap: */
/*
* comedi/drivers/ni_routing/ni_device_routes/pci-6713.c
* List of valid routes for specific NI boards.
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 2016 Spencer E. Olson <olsonse@umich.edu>
*
* 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.
*/
/*
* The contents of this file are generated using the tools in
* comedi/drivers/ni_routing/tools
*
* Please use those tools to help maintain the contents of this file.
*/
#include "../ni_device_routes.h"
#include "all.h"
struct ni_device_routes ni_pci_6713_device_routes = {
.device = "pci-6713",
.routes = (struct ni_route_set[]){
{
.dest = NI_PFI(3),
.src = (int[]){
NI_CtrSource(1),
0, /* Termination */
}
},
{
.dest = NI_PFI(4),
.src = (int[]){
NI_CtrGate(1),
0, /* Termination */
}
},
{
.dest = NI_PFI(5),
.src = (int[]){
NI_AO_SampleClock,
0, /* Termination */
}
},
{
.dest = NI_PFI(6),
.src = (int[]){
NI_AO_StartTrigger,
0, /* Termination */
}
},
{
.dest = NI_PFI(8),
.src = (int[]){
NI_CtrSource(0),
0, /* Termination */
}
},
{
.dest = NI_PFI(9),
.src = (int[]){
NI_CtrGate(0),
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(0),
.src = (int[]){
NI_CtrSource(0),
NI_CtrGate(0),
NI_CtrInternalOutput(0),
NI_CtrOut(0),
NI_AO_SampleClock,
NI_AO_StartTrigger,
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(1),
.src = (int[]){
NI_CtrSource(0),
NI_CtrGate(0),
NI_CtrInternalOutput(0),
NI_CtrOut(0),
NI_AO_SampleClock,
NI_AO_StartTrigger,
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(2),
.src = (int[]){
NI_CtrSource(0),
NI_CtrGate(0),
NI_CtrInternalOutput(0),
NI_CtrOut(0),
NI_AO_SampleClock,
NI_AO_StartTrigger,
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(3),
.src = (int[]){
NI_CtrSource(0),
NI_CtrGate(0),
NI_CtrInternalOutput(0),
NI_CtrOut(0),
NI_AO_SampleClock,
NI_AO_StartTrigger,
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(4),
.src = (int[]){
NI_CtrSource(0),
NI_CtrGate(0),
NI_CtrInternalOutput(0),
NI_CtrOut(0),
NI_AO_SampleClock,
NI_AO_StartTrigger,
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(5),
.src = (int[]){
NI_CtrSource(0),
NI_CtrGate(0),
NI_CtrInternalOutput(0),
NI_CtrOut(0),
NI_AO_SampleClock,
NI_AO_StartTrigger,
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(6),
.src = (int[]){
NI_CtrSource(0),
NI_CtrGate(0),
NI_CtrInternalOutput(0),
NI_CtrOut(0),
NI_AO_SampleClock,
NI_AO_StartTrigger,
0, /* Termination */
}
},
{
.dest = TRIGGER_LINE(7),
.src = (int[]){
NI_20MHzTimebase,
0, /* Termination */
}
},
{
.dest = NI_CtrSource(0),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
NI_PFI(7),
NI_PFI(8),
NI_PFI(9),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
TRIGGER_LINE(7),
NI_MasterTimebase,
NI_20MHzTimebase,
NI_100kHzTimebase,
0, /* Termination */
}
},
{
.dest = NI_CtrSource(1),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
NI_PFI(7),
NI_PFI(8),
NI_PFI(9),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
TRIGGER_LINE(7),
NI_MasterTimebase,
NI_20MHzTimebase,
NI_100kHzTimebase,
0, /* Termination */
}
},
{
.dest = NI_CtrGate(0),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
NI_PFI(7),
NI_PFI(8),
NI_PFI(9),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
NI_CtrInternalOutput(1),
0, /* Termination */
}
},
{
.dest = NI_CtrGate(1),
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
NI_PFI(7),
NI_PFI(8),
NI_PFI(9),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
NI_CtrInternalOutput(0),
0, /* Termination */
}
},
{
.dest = NI_CtrOut(0),
.src = (int[]){
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
NI_CtrInternalOutput(0),
0, /* Termination */
}
},
{
.dest = NI_CtrOut(1),
.src = (int[]){
NI_CtrInternalOutput(1),
0, /* Termination */
}
},
{
.dest = NI_AO_SampleClock,
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
NI_PFI(7),
NI_PFI(8),
NI_PFI(9),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
NI_CtrInternalOutput(1),
NI_AO_SampleClockTimebase,
0, /* Termination */
}
},
{
.dest = NI_AO_SampleClockTimebase,
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
NI_PFI(7),
NI_PFI(8),
NI_PFI(9),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
TRIGGER_LINE(7),
NI_MasterTimebase,
NI_20MHzTimebase,
NI_100kHzTimebase,
0, /* Termination */
}
},
{
.dest = NI_AO_StartTrigger,
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
NI_PFI(7),
NI_PFI(8),
NI_PFI(9),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = NI_AO_PauseTrigger,
.src = (int[]){
NI_PFI(0),
NI_PFI(1),
NI_PFI(2),
NI_PFI(3),
NI_PFI(4),
NI_PFI(5),
NI_PFI(6),
NI_PFI(7),
NI_PFI(8),
NI_PFI(9),
TRIGGER_LINE(0),
TRIGGER_LINE(1),
TRIGGER_LINE(2),
TRIGGER_LINE(3),
TRIGGER_LINE(4),
TRIGGER_LINE(5),
TRIGGER_LINE(6),
0, /* Termination */
}
},
{
.dest = NI_MasterTimebase,
.src = (int[]){
TRIGGER_LINE(7),
NI_20MHzTimebase,
0, /* Termination */
}
},
{ /* Termination of list */
.dest = 0,
},
},
};
// SPDX-License-Identifier: GPL-2.0+
/* vim: set ts=8 sw=8 noet tw=80 nowrap: */
/*
* comedi/drivers/ni_routing/ni_route_values.c
* Route information for NI boards.
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 2016 Spencer E. Olson <olsonse@umich.edu>
*
* 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.
*/
/*
* This file includes the tables that are a list of all the values of various
* signals routes available on NI hardware. In many cases, one does not
* explicitly make these routes, rather one might indicate that something is
* used as the source of one particular trigger or another (using
* *_src=TRIG_EXT).
*
* The contents of this file are generated using the tools in
* comedi/drivers/ni_routing/tools
*
* Please use those tools to help maintain the contents of this file.
*/
#include "ni_route_values.h"
#include "ni_route_values/all.h"
const struct family_route_values *const ni_all_route_values[] = {
&ni_660x_route_values,
&ni_eseries_route_values,
&ni_mseries_route_values,
NULL,
};
/* SPDX-License-Identifier: GPL-2.0+ */
/* vim: set ts=8 sw=8 noet tw=80 nowrap: */
/*
* comedi/drivers/ni_routing/ni_route_values.h
* Route information for NI boards.
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 2016 Spencer E. Olson <olsonse@umich.edu>
*
* 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.
*/
#ifndef _COMEDI_DRIVERS_NI_ROUTINT_NI_ROUTE_VALUES_H
#define _COMEDI_DRIVERS_NI_ROUTINT_NI_ROUTE_VALUES_H
#include "../../comedi.h"
#include <linux/types.h>
/*
* This file includes the tables that are a list of all the values of various
* signals routes available on NI hardware. In many cases, one does not
* explicitly make these routes, rather one might indicate that something is
* used as the source of one particular trigger or another (using
* *_src=TRIG_EXT).
*
* This file is meant to be included by comedi/drivers/ni_routes.c
*/
#define B(x) ((x) - NI_NAMES_BASE)
/** Marks a register value as valid, implemented, and tested. */
#define V(x) (((x) & 0x7f) | 0x80)
#ifndef NI_ROUTE_VALUE_EXTERNAL_CONVERSION
/** Marks a register value as implemented but needing testing. */
#define I(x) V(x)
/** Marks a register value as not implemented. */
#define U(x) 0x0
typedef u8 register_type;
#else
/** Marks a register value as implemented but needing testing. */
#define I(x) (((x) & 0x7f) | 0x100)
/** Marks a register value as not implemented. */
#define U(x) (((x) & 0x7f) | 0x200)
/** Tests whether a register is marked as valid/implemented/tested */
#define MARKED_V(x) (((x) & 0x80) != 0)
/** Tests whether a register is implemented but not tested */
#define MARKED_I(x) (((x) & 0x100) != 0)
/** Tests whether a register is not implemented */
#define MARKED_U(x) (((x) & 0x200) != 0)
/* need more space to store extra marks */
typedef u16 register_type;
#endif
/* Mask out the marking bit(s). */
#define UNMARK(x) ((x) & 0x7f)
/*
* Gi_SRC(x,1) implements Gi_Src_SubSelect = 1
*
* This appears to only really be a valid MUX for m-series devices.
*/
#define Gi_SRC(val, subsel) ((val) | ((subsel) << 6))
/**
* struct family_route_values - Register values for all routes for a particular
* family.
* @family: lower-case string representation of a specific series or family of
* devices from National Instruments where each member of this family
* shares the same register values for the various signal MUXes. It
* should be noted that not all devices of any family have access to
* all routes defined.
* @register_values: Table of all register values for various signal MUXes on
* National Instruments devices. The first index of this table is the
* signal destination (i.e. identification of the signal MUX). The
* second index of this table is the signal source (i.e. input of the
* signal MUX).
*/
struct family_route_values {
const char *family;
const register_type register_values[NI_NUM_NAMES][NI_NUM_NAMES];
};
extern const struct family_route_values *const ni_all_route_values[];
#endif /* _COMEDI_DRIVERS_NI_ROUTINT_NI_ROUTE_VALUES_H */
/* SPDX-License-Identifier: GPL-2.0+ */
/* vim: set ts=8 sw=8 noet tw=80 nowrap: */
/*
* comedi/drivers/ni_routing/ni_route_values/all.h
* List of valid routes for specific NI boards.
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 2016 Spencer E. Olson <olsonse@umich.edu>
*
* 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.
*/
/*
* The contents of this file are generated using the tools in
* comedi/drivers/ni_routing/tools
*
* Please use those tools to help maintain the contents of this file.
*/
#ifndef _COMEDI_DRIVERS_NI_ROUTING_NI_ROUTE_VALUES_EXTERN_H
#define _COMEDI_DRIVERS_NI_ROUTING_NI_ROUTE_VALUES_EXTERN_H
#include "../ni_route_values.h"
extern const struct family_route_values ni_660x_route_values;
extern const struct family_route_values ni_eseries_route_values;
extern const struct family_route_values ni_mseries_route_values;
#endif //_COMEDI_DRIVERS_NI_ROUTING_NI_ROUTE_VALUES_EXTERN_H
comedi_h.py
*.pyc
ni_values.py
convert_c_to_py
c/
csv/
all_cfiles.c
# this make file is simply to help autogenerate these files:
# ni_route_values.h
# ni_device_routes.h
# in order to do this, we are also generating a python representation (using
# ctypesgen) of ../../comedi.h.
# This allows us to sort NI signal/terminal names numerically to use a binary
# search through the device_routes tables to find valid routes.
ALL:
@echo Typical targets:
@echo "\`make csv-files\`"
@echo " Creates new csv-files using content of c-files of existing"
@echo " ni_routing/* content. New csv files are placed in csv"
@echo " sub-directory."
@echo "\`make c-files\`"
@echo " Creates new c-files using content of csv sub-directory. These"
@echo " new c-files can be compared to the active content in the"
@echo " ni_routing directory."
@echo "\`make csv-blank\`"
@echo " Create a new blank csv file. This is useful for establishing a"
@echo " new data table for either a device family \(less likely\) or a"
@echo " specific board of an existing device family \(more likely\)."
@echo "\`make clean-partial\`"
@echo " Remove all generated files/directories EXCEPT for csv/c files."
@echo "\`make clean\`"
@echo " Remove all generated files/directories."
@echo "\`make everything\`"
@echo " Build all csv-files, then all new c-files."
everything : csv-files c-files csv-blank
CPPFLAGS=-D"BIT(x)=(1UL<<(x))" -D__user=
comedi_h.py : ../../../comedi.h
ctypesgen $< --include "sys/ioctl.h" --cpp 'gcc -E $(CPPFLAGS)' -o $@
convert_c_to_py: all_cfiles.c
gcc -g convert_c_to_py.c -o convert_c_to_py -std=c99
ni_values.py: convert_c_to_py
./convert_c_to_py
csv-files : ni_values.py comedi_h.py
./convert_py_to_csv.py
csv-blank :
./make_blank_csv.py
@echo New blank csv signal table in csv/blank_route_table.csv
c-files : comedi_h.py
./convert_csv_to_c.py --route_values --device_routes
ROUTE_VALUES_SRC=$(wildcard ../ni_route_values/*.c)
DEVICE_ROUTES_SRC=$(wildcard ../ni_device_routes/*.c)
all_cfiles.c : $(DEVICE_ROUTES_SRC) $(ROUTE_VALUES_SRC)
@for i in $(DEVICE_ROUTES_SRC) $(ROUTE_VALUES_SRC); do \
echo "#include \"$$i\"" >> all_cfiles.c; \
done
clean-partial :
$(RM) -rf comedi_h.py ni_values.py convert_c_to_py all_cfiles.c *.pyc \
__pycache__/
clean : partial_clean
$(RM) -rf c/ csv/
# Note: One could also use ctypeslib in order to generate these files. The
# caveat is that ctypeslib does not do a great job at handling macro functions.
# The make rules are as follows:
# comedi.h.xml : ../../comedi.h
# # note that we have to use PWD here to avoid h2xml finding a system
# # installed version of the comedilib/comedi.h file
# h2xml ${PWD}/../../comedi.h -c -D__user="" -D"BIT(x)=(1<<(x))" \
# -o comedi.h.xml
#
# comedi_h.py : comedi.h.xml
# xml2py ./comedi.h.xml -o comedi_h.py
# clean :
# rm -f comedi.h.xml comedi_h.py comedi_h.pyc
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment