RTL2832_NAMESPACE::demod Class Reference

`#include <rtl2832.h>`

Inheritance diagram for RTL2832_NAMESPACE::demod:
[legend]

## Classes

struct | params

## Public Types

typedef struct RTL2832_NAMESPACE::demod::params | PARAMS
typedef struct RTL2832_NAMESPACE::demod::params * | PPARAMS

## Public Member Functions

| demod ()
virtual | ~demod ()
int | initialise (PPARAMS params=NULL)
const char * | name () const
void | destroy ()
int | reset ()
int | set_sample_rate (uint32_t samp_rate, double *real_rate=NULL)
int | set_if (double frequency)
int | read_samples (unsigned char *buffer, uint32_t buffer_size, int *bytes_read, int timeout=-1)
int | check_libusb_result (int res, bool zero_okay, const char *function_name=NULL, int line_number=-1, const char *line=NULL)
void | log (const char *message,...)
int | set_i2c_repeater (bool on=true, const char *function_name=NULL, int line_number=-1, const char *line=NULL)
int | i2c_read (uint8_t i2c_addr, uint8_t *buffer, int len)
int | i2c_write (uint8_t i2c_addr, uint8_t *buffer, int len)
int | i2c_write_reg (uint8_t i2c_addr, uint8_t reg, uint8_t val)
int | i2c_read_reg (uint8_t i2c_addr, uint8_t reg, uint8_t &data)
int | set_gpio_output (uint8_t gpio)
int | set_gpio_bit (uint8_t gpio, int val)
tuner * | active_tuner () const
double | sample_rate () const
uint32_t | crystal_frequency () const
range_t | sample_rate_range () const
virtual int | set_i2c_repeater (bool on=true, const char *function_name=NULL, int line_number=-1, const char *line=NULL)=0
virtual int | i2c_read (uint8_t i2c_addr, uint8_t *buffer, int len)=0
virtual int | i2c_write (uint8_t i2c_addr, uint8_t *buffer, int len)=0
virtual int | i2c_write_reg (uint8_t i2c_addr, uint8_t reg, uint8_t val)=0
virtual int | i2c_read_reg (uint8_t i2c_addr, uint8_t reg, uint8_t &data)=0
virtual const char * | name () const =0

## Protected Types

enum | usb_reg { USB_SYSCTL = 0x2000 , USB_CTRL = 0x2010 , USB_STAT = 0x2014 , USB_EPA_CFG = 0x2144 , USB_EPA_CTL = 0x2148 , USB_EPA_MAXPKT = 0x2158 , USB_EPA_MAXPKT_2 = 0x215a , USB_EPA_FIFO_CFG = 0x2160 }
enum | sys_reg { DEMOD_CTL = 0x3000 , GPO = 0x3001 , GPI = 0x3002 , GPOE = 0x3003 , GPD = 0x3004 , SYSINTE = 0x3005 , SYSINTS = 0x3006 , GP_CFG0 = 0x3007 , GP_CFG1 = 0x3008 , SYSINTE_1 = 0x3009 , SYSINTS_1 = 0x300a , DEMOD_CTL_1 = 0x300b , IR_SUSPEND = 0x300c }
enum | blocks { DEMODB = 0 , USBB = 1 , SYSB = 2 , TUNB = 3 , ROMB = 4 , IRB = 5 , IICB = 6 }

## Protected Member Functions

int | find_device ()
int | init_demod ()
int | demod_write_reg (uint8_t page, uint16_t addr, uint16_t val, uint8_t len)
int | demod_read_reg (uint8_t page, uint8_t addr, uint8_t len, uint16_t &reg)
int | write_reg (uint8_t block, uint16_t addr, uint16_t val, uint8_t len)
int | read_reg (uint8_t block, uint16_t addr, uint8_t len, uint16_t &reg)
int | write_array (uint8_t block, uint16_t addr, uint8_t *array, uint8_t len)
int | read_array (uint8_t block, uint16_t addr, uint8_t *array, uint8_t len)

## Protected Attributes

struct libusb_device_handle * | m_devh
PDEVICE_INFO | m_current_info
tuner * | m_tuner
tuner * | m_dummy_tuner
bool | m_libusb_init_done
PARAMS | m_params
range_t | m_sample_rate_range
double | m_sample_rate
uint32_t | m_crystal_frequency
bool | m_tuner_was_active

## Member Typedef Documentation

## PARAMS

typedef struct RTL2832_NAMESPACE::demod::params RTL2832_NAMESPACE::demod::PARAMS

## PPARAMS

typedef struct RTL2832_NAMESPACE::demod::params * RTL2832_NAMESPACE::demod::PPARAMS

## Member Enumeration Documentation

## blocks

enum RTL2832_NAMESPACE::demod::blocks

protected

Enumerator
DEMODB |
USBB |
SYSB |
TUNB |
ROMB |
IRB |
IICB |

## sys_reg

enum RTL2832_NAMESPACE::demod::sys_reg

protected

Enumerator
DEMOD_CTL |
GPO |
GPI |
GPOE |
GPD |
SYSINTE |
SYSINTS |
GP_CFG0 |
GP_CFG1 |
SYSINTE_1 |
SYSINTS_1 |
DEMOD_CTL_1 |
IR_SUSPEND |

## usb_reg

enum RTL2832_NAMESPACE::demod::usb_reg

protected

Enumerator
USB_SYSCTL |
USB_CTRL |
USB_STAT |
USB_EPA_CFG |
USB_EPA_CTL |
USB_EPA_MAXPKT |
USB_EPA_MAXPKT_2 |
USB_EPA_FIFO_CFG |

## Constructor & Destructor Documentation

## demod()

RTL2832_NAMESPACE::demod::demod | ( |  | ) |

## ~demod()

virtual RTL2832_NAMESPACE::demod::~demod | ( |  | ) |

virtual

## Member Function Documentation

## active_tuner()

tuner * RTL2832_NAMESPACE::demod::active_tuner | ( |  | ) | const

inline

Referenced by baz_rtl_source_c::auto_gain_mode(), baz_rtl_source_c::bandwidth(), baz_rtl_source_c::bandwidth_range(), baz_rtl_source_c::bandwidth_values(), baz_rtl_source_c::calc_appropriate_gain_mode(), baz_rtl_source_c::frequency(), baz_rtl_source_c::frequency_range(), baz_rtl_source_c::gain(), baz_rtl_source_c::gain_mode(), baz_rtl_source_c::gain_modes(), baz_rtl_source_c::gain_range(), and baz_rtl_source_c::gain_values().

## check_libusb_result()

int RTL2832_NAMESPACE::demod::check_libusb_result | ( | int | res,
|  | bool | zero_okay,
|  | const char * | function_name = `NULL`,
|  | int | line_number = `-1`,
|  | const char * | line = `NULL`
| ) |  |

## crystal_frequency()

uint32_t RTL2832_NAMESPACE::demod::crystal_frequency | ( |  | ) | const

inline

## demod_read_reg()

int RTL2832_NAMESPACE::demod::demod_read_reg | ( | uint8_t | page,
|  | uint8_t | addr,
|  | uint8_t | len,
|  | uint16_t & | reg
| ) |  |

protected

## demod_write_reg()

int RTL2832_NAMESPACE::demod::demod_write_reg | ( | uint8_t | page,
|  | uint16_t | addr,
|  | uint16_t | val,
|  | uint8_t | len
| ) |  |

protected

## destroy()

void RTL2832_NAMESPACE::demod::destroy | ( |  | ) |

## find_device()

int RTL2832_NAMESPACE::demod::find_device | ( |  | ) |

protected

## i2c_read()

int RTL2832_NAMESPACE::demod::i2c_read | ( | uint8_t | i2c_addr,
|  | uint8_t * | buffer,
|  | int | len
| ) |  |

virtual

Implements RTL2832_NAMESPACE::i2c_interface.

## i2c_read_reg()

int RTL2832_NAMESPACE::demod::i2c_read_reg | ( | uint8_t | i2c_addr,
|  | uint8_t | reg,
|  | uint8_t & | data
| ) |  |

virtual

Implements RTL2832_NAMESPACE::i2c_interface.

## i2c_write()

int RTL2832_NAMESPACE::demod::i2c_write | ( | uint8_t | i2c_addr,
|  | uint8_t * | buffer,
|  | int | len
| ) |  |

virtual

Implements RTL2832_NAMESPACE::i2c_interface.

## i2c_write_reg()

int RTL2832_NAMESPACE::demod::i2c_write_reg | ( | uint8_t | i2c_addr,
|  | uint8_t | reg,
|  | uint8_t | val
| ) |  |

virtual

Implements RTL2832_NAMESPACE::i2c_interface.

## init_demod()

int RTL2832_NAMESPACE::demod::init_demod | ( |  | ) |

protected

## initialise()

int RTL2832_NAMESPACE::demod::initialise | ( | PPARAMS | params = `NULL` | ) |

## log()

void RTL2832_NAMESPACE::demod::log | ( | const char * | message,
|  |  | ...
| ) |  |

## name()

const char * RTL2832_NAMESPACE::demod::name | ( |  | ) | const

virtual

Implements RTL2832_NAMESPACE::named_interface.

Referenced by baz_rtl_source_c::name().

## read_array()

int RTL2832_NAMESPACE::demod::read_array | ( | uint8_t | block,
|  | uint16_t | addr,
|  | uint8_t * | array,
|  | uint8_t | len
| ) |  |

protected

## read_reg()

int RTL2832_NAMESPACE::demod::read_reg | ( | uint8_t | block,
|  | uint16_t | addr,
|  | uint8_t | len,
|  | uint16_t & | reg
| ) |  |

protected

## read_samples()

int RTL2832_NAMESPACE::demod::read_samples | ( | unsigned char * | buffer,
|  | uint32_t | buffer_size,
|  | int * | bytes_read,
|  | int | timeout = `-1`
| ) |  |

## reset()

int RTL2832_NAMESPACE::demod::reset | ( |  | ) |

## sample_rate()

double RTL2832_NAMESPACE::demod::sample_rate | ( |  | ) | const

inline

Referenced by baz_rtl_source_c::sample_rate().

## sample_rate_range()

range_t RTL2832_NAMESPACE::demod::sample_rate_range | ( |  | ) | const

inline

Referenced by baz_rtl_source_c::sample_rate_range().

## set_gpio_bit()

int RTL2832_NAMESPACE::demod::set_gpio_bit | ( | uint8_t | gpio,
|  | int | val
| ) |  |

## set_gpio_output()

int RTL2832_NAMESPACE::demod::set_gpio_output | ( | uint8_t | gpio | ) |

## set_i2c_repeater()

int RTL2832_NAMESPACE::demod::set_i2c_repeater | ( | bool | on = `true`,
|  | const char * | function_name = `NULL`,
|  | int | line_number = `-1`,
|  | const char * | line = `NULL`
| ) |  |

virtual

Implements RTL2832_NAMESPACE::i2c_interface.

## set_if()

int RTL2832_NAMESPACE::demod::set_if | ( | double | frequency | ) |

## set_sample_rate()

int RTL2832_NAMESPACE::demod::set_sample_rate | ( | uint32_t | samp_rate,
|  | double * | real_rate = `NULL`
| ) |  |

## write_array()

int RTL2832_NAMESPACE::demod::write_array | ( | uint8_t | block,
|  | uint16_t | addr,
|  | uint8_t * | array,
|  | uint8_t | len
| ) |  |

protected

## write_reg()

int RTL2832_NAMESPACE::demod::write_reg | ( | uint8_t | block,
|  | uint16_t | addr,
|  | uint16_t | val,
|  | uint8_t | len
| ) |  |

protected

## Member Data Documentation

## m_crystal_frequency

uint32_t RTL2832_NAMESPACE::demod::m_crystal_frequency

protected

## m_current_info

PDEVICE_INFO RTL2832_NAMESPACE::demod::m_current_info

protected

## m_devh

struct libusb_device_handle* RTL2832_NAMESPACE::demod::m_devh

protected

## m_dummy_tuner

tuner * RTL2832_NAMESPACE::demod::m_dummy_tuner

protected

## m_libusb_init_done

bool RTL2832_NAMESPACE::demod::m_libusb_init_done

protected

## m_params

PARAMS RTL2832_NAMESPACE::demod::m_params

protected

## m_sample_rate

double RTL2832_NAMESPACE::demod::m_sample_rate

protected

## m_sample_rate_range

range_t RTL2832_NAMESPACE::demod::m_sample_rate_range

protected

## m_tuner

tuner* RTL2832_NAMESPACE::demod::m_tuner

protected

## m_tuner_was_active

bool RTL2832_NAMESPACE::demod::m_tuner_was_active

protected

The documentation for this class was generated from the following file:

- rtl2832.h