Rename 'ft2232h' driver to 'ftdi-la'.

The driver already supports more than just the FT2232H chip.
This commit is contained in:
Uwe Hermann 2016-04-02 18:36:52 +02:00
parent dba986ab0a
commit f227338297
6 changed files with 21 additions and 21 deletions

View File

@ -269,11 +269,11 @@ libsigrok_la_SOURCES += \
src/hardware/fluke-dmm/fluke.c \
src/hardware/fluke-dmm/api.c
endif
if HW_FT2232H
if HW_FTDI_LA
libsigrok_la_SOURCES += \
src/hardware/ft2232h/protocol.h \
src/hardware/ft2232h/protocol.c \
src/hardware/ft2232h/api.c
src/hardware/ftdi-la/protocol.h \
src/hardware/ftdi-la/protocol.c \
src/hardware/ftdi-la/api.c
endif
if HW_FX2LAFW
libsigrok_la_SOURCES += \

View File

@ -232,7 +232,7 @@ SR_DRIVER([Conrad DIGI 35 CPU], [conrad-digi-35-cpu], [libserialport])
SR_DRIVER([DER EE DE-5000], [deree-de5000], [libserialport])
SR_DRIVER([demo], [demo])
SR_DRIVER([Fluke DMM], [fluke-dmm], [libserialport])
SR_DRIVER([FTDI FT2232H], [ft2232h], [libusb libftdi])
SR_DRIVER([FTDI LA], [ftdi-la], [libusb libftdi])
SR_DRIVER([fx2lafw], [fx2lafw], [libusb])
SR_DRIVER([GMC MH 1x/2x], [gmc-mh-1x-2x], [libserialport])
SR_DRIVER([GW Instek GDS-800], [gwinstek-gds-800], [libserialport])

View File

@ -74,8 +74,8 @@ extern SR_PRIV struct sr_dev_driver deree_de5000_driver_info;
#ifdef HAVE_HW_FLUKE_DMM
extern SR_PRIV struct sr_dev_driver flukedmm_driver_info;
#endif
#ifdef HAVE_HW_FT2232H
extern SR_PRIV struct sr_dev_driver ft2232h_driver_info;
#ifdef HAVE_HW_FTDI_LA
extern SR_PRIV struct sr_dev_driver ftdi_la_driver_info;
#endif
#ifdef HAVE_HW_FX2LAFW
extern SR_PRIV struct sr_dev_driver fx2lafw_driver_info;
@ -247,8 +247,8 @@ SR_PRIV struct sr_dev_driver **drivers_lists[] = {
#ifdef HAVE_HW_FLUKE_DMM
(DRVS) {&flukedmm_driver_info, NULL},
#endif
#ifdef HAVE_HW_FT2232H
(DRVS) {&ft2232h_driver_info, NULL},
#ifdef HAVE_HW_FTDI_LA
(DRVS) {&ftdi_la_driver_info, NULL},
#endif
#ifdef HAVE_HW_FX2LAFW
(DRVS) {&fx2lafw_driver_info, NULL},

View File

@ -21,7 +21,7 @@
#include <libusb.h>
#include "protocol.h"
SR_PRIV struct sr_dev_driver ft2232h_driver_info;
SR_PRIV struct sr_dev_driver ftdi_la_driver_info;
static const uint32_t scanopts[] = {
/* TODO: SR_CONF_CONN to be able to specify the USB address. */
@ -298,7 +298,7 @@ static int config_get(uint32_t key, GVariant **data,
return ret;
}
static int ft2232h_set_samplerate(struct dev_context *devc)
static int ftdi_la_set_samplerate(struct dev_context *devc)
{
int ret;
@ -343,7 +343,7 @@ static int config_set(uint32_t key, GVariant *data,
if (value < 3600)
return SR_ERR_SAMPLERATE;
devc->cur_samplerate = value;
return ft2232h_set_samplerate(devc);
return ftdi_la_set_samplerate(devc);
default:
ret = SR_ERR_NA;
}
@ -412,7 +412,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
/* Hook up a dummy handler to receive data from the device. */
sr_session_source_add(sdi->session, -1, G_IO_IN, 0,
ft2232h_receive_data, (void *)sdi);
ftdi_la_receive_data, (void *)sdi);
return SR_OK;
}
@ -437,9 +437,9 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
return SR_OK;
}
SR_PRIV struct sr_dev_driver ft2232h_driver_info = {
.name = "ft2232h",
.longname = "FT2232H",
SR_PRIV struct sr_dev_driver ftdi_la_driver_info = {
.name = "ftdi-la",
.longname = "FTDI LA",
.api_version = 1,
.init = init,
.cleanup = cleanup,

View File

@ -38,7 +38,7 @@ static void send_samples(struct dev_context *devc, uint64_t samples_to_send)
devc->bytes_received -= samples_to_send;
}
SR_PRIV int ft2232h_receive_data(int fd, int revents, void *cb_data)
SR_PRIV int ftdi_la_receive_data(int fd, int revents, void *cb_data)
{
struct sr_dev_inst *sdi;
struct dev_context *devc;

View File

@ -17,15 +17,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBSIGROK_HARDWARE_FT2232H_PROTOCOL_H
#define LIBSIGROK_HARDWARE_FT2232H_PROTOCOL_H
#ifndef LIBSIGROK_HARDWARE_FTID_LA_PROTOCOL_H
#define LIBSIGROK_HARDWARE_FTID_LA_PROTOCOL_H
#include <stdint.h>
#include <glib.h>
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
#define LOG_PREFIX "ft2232h"
#define LOG_PREFIX "ftdi-la"
#define DATA_BUF_SIZE (16 * 1024)
@ -51,6 +51,6 @@ struct dev_context {
void *cb_data;
};
SR_PRIV int ft2232h_receive_data(int fd, int revents, void *cb_data);
SR_PRIV int ftdi_la_receive_data(int fd, int revents, void *cb_data);
#endif