*data = std_gvar_samplerates(ARRAY_AND_SIZE(rates_500mhz));
else if (devc->model->samplerate == SR_MHZ(200))
*data = std_gvar_samplerates(ARRAY_AND_SIZE(rates_200mhz));
- else
+ else if (devc->model->samplerate == SR_MHZ(100))
*data = std_gvar_samplerates(ARRAY_AND_SIZE(rates_100mhz));
+ else
+ return SR_ERR_BUG;
break;
case SR_CONF_LIMIT_SAMPLES:
*data = std_gvar_tuple_u64(0, LA2016_NUM_SAMPLES_MAX);
struct drv_context *drvc;
struct sr_context *ctx;
struct dev_context *devc;
+ size_t unitsize;
double voltage;
int ret;
devc = sdi->priv;
if (!devc->feed_queue) {
+ if (devc->model->channel_count == 32)
+ unitsize = sizeof(uint32_t);
+ else if (devc->model->channel_count == 16)
+ unitsize = sizeof(uint16_t);
+ else
+ return SR_ERR_ARG;
devc->feed_queue = feed_queue_logic_alloc(sdi,
- LA2016_CONVBUFFER_SIZE, sizeof(uint16_t));
+ LA2016_CONVBUFFER_SIZE, unitsize);
if (!devc->feed_queue) {
sr_err("Cannot allocate buffer for session feed.");
return SR_ERR_MALLOC;
return SR_OK;
}
-static uint16_t get_channels_mask(const struct sr_dev_inst *sdi)
+static uint32_t get_channels_mask(const struct sr_dev_inst *sdi)
{
- uint16_t channels;
+ uint32_t channels;
GSList *l;
struct sr_channel *ch;
GSList *channel;
struct sr_trigger_stage *stage1;
struct sr_trigger_match *match;
- uint16_t ch_mask;
+ uint32_t ch_mask;
int ret;
uint8_t buf[REG_UNKNOWN_30 - REG_TRIGGER]; /* Width of REG_TRIGGER. */
uint8_t *wrptr;
struct dev_context *devc;
size_t num_pkts;
const uint8_t *rp;
- uint16_t sample_value;
+ uint32_t sample_value;
size_t repetitions;
uint8_t sample_buff[sizeof(sample_value)];
devc->trigger_marked = TRUE;
}
+ sample_value = 0;
rp = packets;
while (num_xfers--) {
+ /* XXX model dependent? 5 or 3? */
num_pkts = NUM_PACKETS_IN_CHUNK;
while (num_pkts--) {
- sample_value = read_u16le_inc(&rp);
+ /* TODO Verify 32channel layout. */
+ if (devc->model->channel_count == 32)
+ sample_value = read_u32le_inc(&rp);
+ else if (devc->model->channel_count == 16)
+ sample_value = read_u16le_inc(&rp);
repetitions = read_u8_inc(&rp);
devc->total_samples += repetitions;
- write_u16le(sample_buff, sample_value);
+ write_u32le(sample_buff, sample_value);
feed_queue_logic_submit(devc->feed_queue,
sample_buff, repetitions);
sr_sw_limits_update_samples_read(&devc->sw_limits,