X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=hardware%2Fzeroplus-logic-cube%2Fgl_usb.c;h=20993286d275ffde471cebbe9809b4ef850c76f7;hp=944882a6262b389ceaafe6366a1853177868795c;hb=43cd4637285833706f8a404ca027bcf0ee75b9ae;hpb=6d1161142dfce461c8e54c09d821443c68916df8 diff --git a/hardware/zeroplus-logic-cube/gl_usb.c b/hardware/zeroplus-logic-cube/gl_usb.c index 944882a6..20993286 100644 --- a/hardware/zeroplus-logic-cube/gl_usb.c +++ b/hardware/zeroplus-logic-cube/gl_usb.c @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrok project. * * Copyright (C) 2010 Sven Peter * Copyright (C) 2010 Haxx Enterprises @@ -132,3 +132,21 @@ SR_PRIV int gl_reg_read(libusb_device_handle *devh, unsigned int reg) ret = gl_read_data(devh); return ret; } + +SR_PRIV int gl_reg_read_buf(libusb_device_handle *devh, unsigned int reg, + unsigned char *buf, unsigned int len) +{ + int ret; + unsigned int i; + + ret = gl_write_address(devh, reg); + if (ret < 0) + return ret; + for (i = 0; i < len; i++) { + ret = gl_read_data(devh); + if (ret < 0) + return ret; + buf[i] = ret; + } + return 0; +}