#include <config.h>
#include "protocol.h"
-static const uint32_t ipdbg_la_drvopts[] = {
+static const uint32_t drvopts[] = {
SR_CONF_LOGIC_ANALYZER,
};
-static const uint32_t ipdbg_la_scanopts[] = {
+static const uint32_t scanopts[] = {
SR_CONF_CONN,
};
-static const uint32_t ipdbg_la_devopts[] = {
+static const uint32_t devopts[] = {
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST | SR_CONF_SET,
SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET,
};
-static const int32_t ipdbg_la_trigger_matches[] = {
+static const int32_t trigger_matches[] = {
SR_TRIGGER_ZERO,
SR_TRIGGER_ONE,
SR_TRIGGER_RISING,
sdi->version = g_strdup("v1.0");
sdi->driver = di;
- struct ipdbg_la_dev_context *devc = ipdbg_la_dev_new();
+ struct dev_context *devc = ipdbg_la_dev_new();
sdi->priv = devc;
ipdbg_la_get_addrwidth_and_datawidth(tcp, devc);
(void)cg;
- struct ipdbg_la_dev_context *devc = sdi->priv;
+ struct dev_context *devc = sdi->priv;
switch (key) {
case SR_CONF_CAPTURE_RATIO:
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- struct ipdbg_la_dev_context *devc = sdi->priv;
+ struct dev_context *devc = sdi->priv;
switch (key) {
case SR_CONF_CAPTURE_RATIO:
switch (key) {
case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- ipdbg_la_scanopts,
- ARRAY_SIZE
- (ipdbg_la_scanopts),
- sizeof(uint32_t));
+ scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
break;
case SR_CONF_DEVICE_OPTIONS:
if (!sdi)
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- ipdbg_la_drvopts,
- ARRAY_SIZE
- (ipdbg_la_drvopts),
- sizeof(uint32_t));
+ drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
else
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- ipdbg_la_devopts,
- ARRAY_SIZE
- (ipdbg_la_devopts),
- sizeof(uint32_t));
+ devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break;
case SR_CONF_TRIGGER_MATCH:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
- ipdbg_la_trigger_matches,
- ARRAY_SIZE
- (ipdbg_la_trigger_matches),
- sizeof(int32_t));
+ trigger_matches, ARRAY_SIZE(trigger_matches), sizeof(int32_t));
break;
default:
return SR_ERR_NA;
return SR_ERR_DEV_CLOSED;
struct ipdbg_la_tcp *tcp = sdi->conn;
- struct ipdbg_la_dev_context *devc = sdi->priv;
+ struct dev_context *devc = sdi->priv;
ipdbg_la_convert_trigger(sdi);
ipdbg_la_send_trigger(devc, tcp);
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
struct ipdbg_la_tcp *tcp = sdi->conn;
- struct ipdbg_la_dev_context *devc = sdi->priv;
+ struct dev_context *devc = sdi->priv;
uint8_t byte;
SR_PRIV int ipdbg_la_convert_trigger(const struct sr_dev_inst *sdi)
{
- struct ipdbg_la_dev_context *devc;
+ struct dev_context *devc;
struct sr_trigger *trigger;
struct sr_trigger_stage *stage;
struct sr_trigger_match *match;
SR_PRIV int ipdbg_la_receive_data(int fd, int revents, void *cb_data)
{
const struct sr_dev_inst *sdi;
- struct ipdbg_la_dev_context *devc;
+ struct dev_context *devc;
(void)fd;
(void)revents;
return TRUE;
}
-SR_PRIV int ipdbg_la_send_delay(struct ipdbg_la_dev_context *devc,
+SR_PRIV int ipdbg_la_send_delay(struct dev_context *devc,
struct ipdbg_la_tcp *tcp)
{
devc->delay_value = (devc->limit_samples / 100.0) * devc->capture_ratio;
return SR_OK;
}
-SR_PRIV int ipdbg_la_send_trigger(struct ipdbg_la_dev_context *devc,
+SR_PRIV int ipdbg_la_send_trigger(struct dev_context *devc,
struct ipdbg_la_tcp *tcp)
{
uint8_t buf;
}
SR_PRIV void ipdbg_la_get_addrwidth_and_datawidth(
- struct ipdbg_la_tcp *tcp, struct ipdbg_la_dev_context *devc)
+ struct ipdbg_la_tcp *tcp, struct dev_context *devc)
{
uint8_t buf[8];
uint8_t read_cmd = CMD_GET_BUS_WIDTHS;
devc->trigger_edge_mask = g_malloc0(devc->DATA_WIDTH_BYTES);
}
-SR_PRIV struct ipdbg_la_dev_context *ipdbg_la_dev_new(void)
+SR_PRIV struct dev_context *ipdbg_la_dev_new(void)
{
- struct ipdbg_la_dev_context *devc;
+ struct dev_context *devc;
- devc = g_malloc0(sizeof(struct ipdbg_la_dev_context));
+ devc = g_malloc0(sizeof(struct dev_context));
devc->capture_ratio = 50;
return devc;
};
/** Private, per-device-instance driver context. */
-struct ipdbg_la_dev_context {
+struct dev_context {
uint32_t DATA_WIDTH;
uint32_t DATA_WIDTH_BYTES;
uint32_t ADDR_WIDTH;
SR_PRIV int ipdbg_la_convert_trigger(const struct sr_dev_inst *sdi);
-SR_PRIV struct ipdbg_la_dev_context *ipdbg_la_dev_new(void);
+SR_PRIV struct dev_context *ipdbg_la_dev_new(void);
SR_PRIV void ipdbg_la_get_addrwidth_and_datawidth(
- struct ipdbg_la_tcp *tcp, struct ipdbg_la_dev_context *devc);
+ struct ipdbg_la_tcp *tcp, struct dev_context *devc);
SR_PRIV int send_escaping(struct ipdbg_la_tcp *tcp, uint8_t *dataToSend,
uint32_t length);
SR_PRIV int ipdbg_la_send_reset(struct ipdbg_la_tcp *tcp);
SR_PRIV int ipdbg_la_request_id(struct ipdbg_la_tcp *tcp);
SR_PRIV int ipdbg_la_send_start(struct ipdbg_la_tcp *tcp);
-SR_PRIV int ipdbg_la_send_trigger(struct ipdbg_la_dev_context *devc,
+SR_PRIV int ipdbg_la_send_trigger(struct dev_context *devc,
struct ipdbg_la_tcp *tcp);
-SR_PRIV int ipdbg_la_send_delay(struct ipdbg_la_dev_context *devc,
+SR_PRIV int ipdbg_la_send_delay(struct dev_context *devc,
struct ipdbg_la_tcp *tcp);
SR_PRIV int ipdbg_la_receive_data(int fd, int revents, void *cb_data);
SR_PRIV void ipdbg_la_abort_acquisition(const struct sr_dev_inst *sdi);