[][src]Struct si4703::Si4703

pub struct Si4703<I2C, IC> { /* fields omitted */ }

Si4703 device driver

Methods

impl<I2C, E> Si4703<I2C, Si4703> where
    I2C: Write<Error = E> + Read<Error = E>, 
[src]

pub fn new(i2c: I2C) -> Self[src]

Create new instance of a Si4703 device

impl<I2C, E> Si4703<I2C, Si4702> where
    I2C: Write<Error = E> + Read<Error = E>, 
[src]

pub fn new_si4702(i2c: I2C) -> Self[src]

Create new instance of a Si4702 device

impl<I2C, IC> Si4703<I2C, IC>[src]

pub fn destroy(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

impl<I2C, E, IC> Si4703<I2C, IC> where
    I2C: Write<Error = E> + Read<Error = E>, 
[src]

pub fn enable_oscillator(&mut self) -> Result<(), Error<E>>[src]

Enable the oscillator.

This must be called before enabling the device. After calling this, a minimum of 500ms must be waited in order for the oscillator to power up.

pub fn enable(&mut self) -> Result<(), Error<E>>[src]

Enable the device.

After calling this it must be waited for the device to power up. See: Powerup time in the datasheet. On the Si4703, this is a maximum of 110ms.

pub fn disable(&mut self) -> Result<(), Error<E>>[src]

Disable the device (power down).

pub fn unmute(&mut self) -> Result<(), Error<E>>[src]

Unmute (disable mute)

pub fn mute(&mut self) -> Result<(), Error<E>>[src]

Mute (enable mute)

pub fn enable_softmute(
    &mut self,
    rate: SoftmuteRate,
    attenuation: SoftmuteAttenuation
) -> Result<(), Error<E>>
[src]

Enable softmute

pub fn disable_softmute(&mut self) -> Result<(), Error<E>>[src]

Disable softmute

pub fn output_mode(&mut self) -> Result<OutputMode, Error<E>>[src]

Get output mode: Stereo/Mono

pub fn set_output_mode(&mut self, mode: OutputMode) -> Result<(), Error<E>>[src]

Set output mode: Stereo/Mono

pub fn set_deemphasis(&mut self, de: DeEmphasis) -> Result<(), Error<E>>[src]

Set de-emphasis

pub fn set_volume(&mut self, volume: Volume) -> Result<(), Error<E>>[src]

Set the volume

This will automatically activate or deactivate the extended volume range as appropriate.

pub fn set_band(&mut self, band: Band) -> Result<(), Error<E>>[src]

Set band

pub fn set_channel_spacing(
    &mut self,
    spacing: ChannelSpacing
) -> Result<(), Error<E>>
[src]

Set channel spacing

pub fn enable_stc_interrupts(&mut self) -> Result<(), Error<E>>[src]

Enable generating STC interrupts.

For this to be useful, gpio2 pin must be configured to be used as STC/RDS interrupt.

pub fn disable_stc_interrupts(&mut self) -> Result<(), Error<E>>[src]

Disable generating STC interrupts.

pub fn set_gpio1(&mut self, config: Gpio1Config) -> Result<(), Error<E>>[src]

Set the GPIO1

pub fn set_gpio2(&mut self, config: Gpio2Config) -> Result<(), Error<E>>[src]

Set GPIO2 function / status

pub fn set_gpio3(&mut self, config: Gpio3Config) -> Result<(), Error<E>>[src]

Set the GPIO3

pub fn enable_auto_gain_control(&mut self) -> Result<(), Error<E>>[src]

Enable automatic gain control (default).

pub fn disable_auto_gain_control(&mut self) -> Result<(), Error<E>>[src]

Disable automatic gain control.

pub fn set_stereo_to_mono_blend_level(
    &mut self,
    level: StereoToMonoBlendLevel
) -> Result<(), Error<E>>
[src]

Set the stereo to mono blend level

pub fn enable_audio_high_z(&mut self) -> Result<(), Error<E>>[src]

Enable the audio High-Z.

This must be called before enabling the device.

pub fn disable_audio_high_z(&mut self) -> Result<(), Error<E>>[src]

Disable the audio High-Z.

This must be called before enabling the device.

pub fn channel(&mut self) -> Result<f32, Error<E>>[src]

Read the channel

pub fn device_id(&mut self) -> Result<(u8, u16), Error<E>>[src]

Get the device ID

Returns the (part number, manufacturer ID) as a tuple

pub fn chip_id(&mut self) -> Result<(u8, u8, u8), Error<E>>[src]

Get the chip ID

Returns the (revision, device, firmware) as a tuple

impl<I2C, E, IC> Si4703<I2C, IC> where
    I2C: Write<Error = E> + Read<Error = E>,
    IC: WithRds, 
[src]

pub fn enable_rds(&mut self, mode: RdsMode) -> Result<(), Error<E>>[src]

Enable RDS.

pub fn disable_rds(&mut self) -> Result<(), Error<E>>[src]

Disable RDS.

pub fn enable_rds_interrupts(&mut self) -> Result<(), Error<E>>[src]

Enable RDS interrupts.

pub fn disable_rds_interrupts(&mut self) -> Result<(), Error<E>>[src]

Disable RDS interrupts.

pub fn rds_ready(&mut self) -> Result<bool, Error<E>>[src]

Get whether a new RDS group is ready.

pub fn rds_synchronized(&mut self) -> Result<bool, Error<E>>[src]

Get RDS synchronization status (only available in RDS verbose mode).

pub fn rds_data(&mut self) -> Result<RdsData, Error<E>>[src]

Get RDS data.

impl<I2C, E, IC> Si4703<I2C, IC> where
    I2C: Write<Error = E> + Read<Error = E>, 
[src]

pub fn configure_seek(
    &mut self,
    rssi_threshold: u8,
    snr_threshold: SeekSnrThreshold,
    fm_impulse_threshold: SeekFmImpulseThreshold
) -> Result<(), Error<E>>
[src]

Configure seek RSSI, SNR and FM impulse detection thresholds

pub fn seek(
    &mut self,
    mode: SeekMode,
    direction: SeekDirection
) -> Result<(), Error<E>>
[src]

Seek

It is not recommended to call this again this while the seeking is not finished. It should be waited on the STC interrupt pin.

pub fn seek_with_stc_int_pin<PinE, P: InputPin<Error = PinE>>(
    &mut self,
    mode: SeekMode,
    direction: SeekDirection,
    stc_int_pin: &P
) -> Result<(), ErrorWithPin<E, PinE>>
[src]

Seek using GPIO2 as STC interrupt pin (recommended)

This will configure GPIO2 as STC interrupt pin and enable STC interrupts if appropriate.

impl<I2C, E, IC> Si4703<I2C, IC> where
    I2C: Write<Error = E> + Read<Error = E>, 
[src]

pub fn tune(&mut self, channel: TuneChannel) -> Result<(), Error<E>>[src]

Tune to a certain frequency

It is not recommended to call this again this while the tuning is not finished. It should be waited on the STC interrupt pin.

pub fn tune_with_stc_int_pin<PinE, P: InputPin<Error = PinE>>(
    &mut self,
    channel: TuneChannel,
    stc_int_pin: &P
) -> Result<(), ErrorWithPin<E, PinE>>
[src]

Tune using GPIO2 as STC interrupt pin (recommended)

This will configure GPIO2 as STC interrupt pin and enable STC interrupts if appropriate.

Trait Implementations

impl<I2C: Debug, IC: Debug> Debug for Si4703<I2C, IC>[src]

Auto Trait Implementations

impl<I2C, IC> Unpin for Si4703<I2C, IC> where
    I2C: Unpin,
    IC: Unpin

impl<I2C, IC> Send for Si4703<I2C, IC> where
    I2C: Send,
    IC: Send

impl<I2C, IC> Sync for Si4703<I2C, IC> where
    I2C: Sync,
    IC: Sync

impl<I2C, IC> UnwindSafe for Si4703<I2C, IC> where
    I2C: UnwindSafe,
    IC: UnwindSafe

impl<I2C, IC> RefUnwindSafe for Si4703<I2C, IC> where
    I2C: RefUnwindSafe,
    IC: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]