lib: revert implementing RGB233 mode

We will soon have support for a palette mode,
which can replicate the RGB233 mode if required,
or any custom arrangement of bits per color.

Furthermore, the RGB233 mode did not work correctly
in this state, as we did not implement swapping of
the 32 bit words.

This reverts the following commits:
58de0a5bcc
3f44f8fc22
b82303f44f
master
Steve Markgraf 3 years ago
parent b11fc430f3
commit 197f421c98
  1. 16
      include/osmo-fl2k.h
  2. 26
      src/libosmo-fl2k.c

@ -54,7 +54,6 @@ typedef struct fl2k_data_info {
char *r_buf; /* pointer to red buffer */
char *g_buf; /* pointer to green buffer */
char *b_buf; /* pointer to blue buffer */
char *raw_buf; /* pointer to pre-arranged buffer */
} fl2k_data_info_t;
typedef struct fl2k_dev fl2k_dev_t;
@ -70,13 +69,6 @@ typedef struct fl2k_dev fl2k_dev_t;
#define FL2K_BUF_LEN (1280 * 1024)
#define FL2K_XFER_LEN (FL2K_BUF_LEN * 3)
/** Utility macros for 8 bit per sample mode */
#define RGB332_TO_R(x) (((x) & 3) << 6)
#define RGB332_TO_G(x) (((x) & 7) << 3)
#define RGB332_TO_B(x) (((x) & 7) << 0)
#define RGB332_TO_RGB(r, g, b) (RGB332_TO_R(r) | RGB332_TO_G(g) | RGB332_TO_B(b))
FL2K_API uint32_t fl2k_get_device_count(void);
FL2K_API const char* fl2k_get_device_name(uint32_t index);
@ -97,14 +89,6 @@ FL2K_API int fl2k_close(fl2k_dev_t *dev);
*/
FL2K_API int fl2k_set_sample_rate(fl2k_dev_t *dev, uint32_t target_freq);
/*!
* Set RGB332 sample format
*
* \param dev the device handle given by fl2k_open()
* \return 0 on success
*/
FL2K_API int fl2k_set_rgb332(fl2k_dev_t *dev);
/*!
* Get actual sample rate the device is configured to.
*

@ -204,13 +204,6 @@ int fl2k_deinit_device(fl2k_dev_t *dev)
return r;
}
int fl2k_set_rgb332(fl2k_dev_t *dev)
{
uint32_t reg;
fl2k_read_reg(dev, 0x8004, &reg);
return fl2k_write_reg(dev, 0x8004, reg | (1 << 25));
}
static double fl2k_reg_to_freq(uint32_t reg)
{
double sample_clock, offset, offs_div;
@ -921,20 +914,15 @@ static void *fl2k_sample_worker(void *arg)
xfer_info = (fl2k_xfer_info_t *)xfer->user_data;
out_buf = (char *)xfer->buffer;
if (data_info.raw_buf) {
/* Shove a pre-arranged buffer into the DACs */
memcpy(out_buf, data_info.raw_buf, dev->xfer_buf_len);
} else {
/* Re-arrange and copy bytes in buffer for DACs */
fl2k_convert_r(out_buf, data_info.r_buf, dev->xfer_buf_len,
data_info.sampletype_signed ? 128 : 0);
/* Re-arrange and copy bytes in buffer for DACs */
fl2k_convert_r(out_buf, data_info.r_buf, dev->xfer_buf_len,
data_info.sampletype_signed ? 128 : 0);
fl2k_convert_g(out_buf, data_info.g_buf, dev->xfer_buf_len,
data_info.sampletype_signed ? 128 : 0);
fl2k_convert_g(out_buf, data_info.g_buf, dev->xfer_buf_len,
data_info.sampletype_signed ? 128 : 0);
fl2k_convert_b(out_buf, data_info.b_buf, dev->xfer_buf_len,
data_info.sampletype_signed ? 128 : 0);
}
fl2k_convert_b(out_buf, data_info.b_buf, dev->xfer_buf_len,
data_info.sampletype_signed ? 128 : 0);
xfer_info->seq = buf_cnt++;
xfer_info->state = BUF_FILLED;

Loading…
Cancel
Save