![]() |
PU2CLR RDA5807 Arduino Library 1.1.4
Arduino Library for RDA5807 Devices - By Ricardo Lima Caratti
|
Functions | |
void | RDA5807::setFrequencyToBeginBand () |
Tunes the receiver at the first channel/frequency of the current band. | |
void | RDA5807::setFrequencyToEndBand () |
Tunes the receiver at the last channel/frequency of the current band. | |
uint8_t | RDA5807::getSpace () |
Returns the current Band Space. | |
bool | RDA5807::isFmTrue () |
Returns true if the current channel is a station. | |
bool | RDA5807::isFmReady () |
Returns true if the FM is ready. | |
void | RDA5807::setSoftBlendEnable (bool value) |
Sets Soft Blend. | |
void | RDA5807::setAFC (bool value) |
Sets AFC true or false. | |
void | RDA5807::setChannel (uint16_t channel) |
Sets the channel. | |
void | RDA5807::setFrequency (uint16_t frequency) |
Sets the frequency. | |
void | RDA5807::setFrequencyUp () |
Increments the current frequency. | |
void | RDA5807::setFrequencyDown () |
Decrements the current frequency. | |
uint16_t | RDA5807::getFrequency () |
Gets the current frequency. | |
uint16_t | RDA5807::getRealChannel () |
Gets the current channel stored in 0x0A status register. | |
uint16_t | RDA5807::getRealFrequency () |
Gets the current frequency bases on the current channel. | |
void | RDA5807::seek (uint8_t seek_mode, uint8_t direction) |
Seek function. | |
void | RDA5807::seek (uint8_t seek_mode, uint8_t direction, void(*showFunc)()) |
Seek function. | |
void | RDA5807::setSeekThreshold (uint8_t value) |
Sets RSSI Seek Threshold. | |
void | RDA5807::setBand (uint8_t band=0) |
Sets the FM band. See table below. | |
void | RDA5807::setSpace (uint8_t space=0) |
Sets the FM channel space. | |
void | RDA5807::setStep (uint8_t step=100) |
Sets the FM Step;. | |
void | RDA5807::setFmDeemphasis (uint8_t de) |
Sets De-emphasis. | |
|
inline |
Tunes the receiver at the first channel/frequency of the current band.
If the current band is 0, the lowest frequency is 87Mhz (8700)
|
inline |
Tunes the receiver at the last channel/frequency of the current band.
If the current band is 0, the highest frequency is 108MHz (10800)
|
inline |
|
inline |
|
inline |
void RDA5807::setSoftBlendEnable | ( | bool | value | ) |
void RDA5807::setAFC | ( | bool | value | ) |
void RDA5807::setChannel | ( | uint16_t | channel | ) |
Sets the channel.
This method tunes the rteceiver in a given channel.
The channel can be calculated by using the follow formula
channel = (desired frequency - start band frequency) / space channel in use / 10.0);
channel |
Definition at line 303 of file RDA5807.cpp.
References RDA5807::waitAndFinishTune().
void RDA5807::setFrequency | ( | uint16_t | frequency | ) |
void RDA5807::setFrequencyUp | ( | ) |
Increments the current frequency.
The increment uses the band space as step. See array: uint16_t fmSpace[4] = {100/10, 200/10, 50/10, 25/10};
Definition at line 331 of file RDA5807.cpp.
void RDA5807::setFrequencyDown | ( | ) |
Decrements the current frequency.
The drecrement uses the band space as step. See array: uint16_t fmSpace[4] = {20, 10, 5, 1};
Definition at line 346 of file RDA5807.cpp.
uint16_t RDA5807::getFrequency | ( | ) |
uint16_t RDA5807::getRealChannel | ( | ) |
Gets the current channel stored in 0x0A status register.
Definition at line 377 of file RDA5807.cpp.
uint16_t RDA5807::getRealFrequency | ( | ) |
Gets the current frequency bases on the current channel.
The current channel is stored in the 0x0A register. This value is updated after a tune or seek operation.
The current frequency can be calculated by the formula below
Band | Formula |
---|---|
0 | Frequency = Channel Spacing (kHz) x READCHAN[9:0]+ 87.0 MHz |
1 or 2 | Frequency = Channel Spacing (kHz) x READCHAN[9:0]+ 76.0 MHz |
3 | Frequency = Channel Spacing (kHz) x READCHAN[9:0]+ 65.0 MHz |
Definition at line 399 of file RDA5807.cpp.
void RDA5807::seek | ( | uint8_t | seek_mode, |
uint8_t | direction | ||
) |
Seek function.
seek_mode | if 0, wrap at the upper or lower band limit and continue seeking; 1 = stop seeking at the upper or lower band limit |
direction | if 0, seek down; if 1, seek up. |
Definition at line 410 of file RDA5807.cpp.
void RDA5807::seek | ( | uint8_t | seek_mode, |
uint8_t | direction, | ||
void(*)() | showFunc | ||
) |
Seek function.
Seeks a station up or down.
Seek up or down a station and call a function defined by the user to show the frequency during the seek process.
Seek begins at the current channel, and goes in the direction specified with the SEEKUP bit. Seek operation stops when a channel is qualified as valid according to the seek parameters, the entire band has been searched (SKMODE = 0), or the upper or lower band limit has been reached (SKMODE = 1).
The STC bit is set high when the seek operation completes and/or the SF/BL bit is set high if the seek operation was unable to find a channel qualified as valid according to the seek parameters. The STC and SF/BL bits must be set low by setting the SEEK bit low before the next seek or tune may begin.
The SEEK bit is set low and the STC bit is set high when the seek operation completes.
It is important to say you have to implement a show frequency function. This function have to get the frequency via getFrequency function.
Example:
seek_mode | Seek Mode; 0 = Wrap at the upper or lower band limit and continue seeking (default); 1 = Stop seeking at the upper or lower band limit. |
direction | Seek Direction; 0 = Seek down (default); 1 = Seek up. |
showFunc | function that you have to implement to show the frequency during the seeking process. Set NULL if you do not want to show the progress. |
Definition at line 450 of file RDA5807.cpp.
References RDA5807::waitAndFinishTune().
void RDA5807::setSeekThreshold | ( | uint8_t | value | ) |
void RDA5807::setBand | ( | uint8_t | band = 0 | ) |
Sets the FM band. See table below.
FM band table
Value | Description |
---|---|
00 | 87–108 MHz (US/Europe) |
01 | 76–91 MHz (Japan) |
10 | 76–108 MHz (world wide) |
11 | 65 –76 MHz (East Europe) or 50-65MHz (see bit 9 of gegister 0x06) |
band | FM band index. See table above. |
Definition at line 499 of file RDA5807.cpp.
void RDA5807::setSpace | ( | uint8_t | space = 0 | ) |
Sets the FM channel space.
Channel space table
Value | Description |
---|---|
00 | 100KHz |
01 | 200KHz |
10 | 50KHz |
11 | 25KHz |
space | FM channel space. See table above. |
Definition at line 522 of file RDA5807.cpp.
void RDA5807::setStep | ( | uint8_t | step = 100 | ) |
Sets the FM Step;.
step | 25, 50, 100 or 200 kHz |
Definition at line 536 of file RDA5807.cpp.
void RDA5807::setFmDeemphasis | ( | uint8_t | de | ) |
Sets De-emphasis.
75 μs. Used in USA (default); 50 μs. Used in Europe, Australia, Japan.
de | 0 = 75 μs; 1 = 50 μs |
Definition at line 566 of file RDA5807.cpp.