### setup Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a01.html Initializes and starts the device with specified configurations. ```APIDOC ## setup ### Description Initializes and starts the device with specified configurations. ### Method void ### Parameters #### Path Parameters - **clock_frequency** (uint8_t) - Optional - Description: Clock frequency setting. Defaults to CLOCK_32K. - **oscillator_type** (uint8_t) - Optional - Description: Oscillator type. Defaults to OSCILLATOR_TYPE_PASSIVE. - **rlck_no_calibrate** (uint8_t) - Optional - Description: RLCK no calibrate mode setting. Defaults to RLCK_NO_CALIBRATE_MODE_OFF. ### Endpoint N/A (This is a library function call) ### Request Example ```c setup(CLOCK_128K, OSCILLATOR_TYPE_ACTIVE, RLCK_NO_CALIBRATE_MODE_ON); ``` ### Response N/A (This function does not return a value) ### Success Response (200) N/A ### Response Example N/A ``` -------------------------------- ### setup Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA01.html Starts the device with specified clock frequency, oscillator type, and RLCK mode. ```APIDOC ## setup ### Description Starts the device with specified clock frequency, oscillator type, and RLCK mode. ### Method void ### Parameters #### Path Parameters - **clock_frequency** (uint8_t) - Optional - Description: Clock frequency (default CLOCK_32K). - **oscillator_type** (uint8_t) - Optional - Description: Oscillator type (default OSCILLATOR_TYPE_PASSIVE). - **rlck_no_calibrate** (uint8_t) - Optional - Description: RLCK no calibrate mode (default RLCK_NO_CALIBRATE_MODE_OFF). ### Endpoint N/A (This is a function call, not an HTTP endpoint) ### Response #### Success Response N/A (This function does not return a value) ### Request Example N/A ``` -------------------------------- ### Example: Setting up RDS and receiving data Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a04.html This example demonstrates how to initialize the RDA5807, enable RDS, set a frequency, and then check for RDS information. It assumes getRdsReady() is called before querying RDS data. ```cpp #include RDA5807 rx; void setup() { rx.setup(); // Starts the receiver with default parameters rx.setRDS(true); rx.setRdsFifo(true); rx.setFrequency(10390); // Station with RDS service } // ... later in the code, after checking rx.getRdsReady() ... // if (rx.hasRdsInfo() ) { // rdsMsg = rx.getRdsProgramInformation(); // stationName = rx.getRdsStationName(); // } ``` -------------------------------- ### Install RDA5807 Library via arduino-cli on Windows Source: https://github.com/pu2clr/rda5807/blob/master/README.md Installs the latest development version of the RDA5807 library from GitHub using the arduino-cli on Windows. This method installs the current version, which may not be the most stable. ```bash echo off curl -fsSL https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_64bit.zip --output arduinocli.zip tar -xf arduinocli.zip set ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true .\arduino-cli lib install --git-url https://github.com/pu2clr/RDA5807 ``` -------------------------------- ### Seek Station Example Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html Demonstrates how to use the seek function to find the next or previous available FM station. Requires Arduino setup for input pins and receiver initialization. ```cpp #include RDA5807 rx; void setup() { pinMode(4, INPUT_PULLUP); // Arduino pin 4 - Seek station down pinMode(5, INPUT_PULLUP); // Arduino pin 5 - Seek station up rx.setup(); // Starts the receiver with default parameters rx.setFrequency(10390); // Tunes at 103.9 MHz - Switch to your local favorite station } void loop() { if (digitalRead(4) == LOW) rx.seek(RDA_SEEK_WRAP,RDA_SEEK_DOWN); if (digitalRead(5) == LOW) rx.seek(RDA_SEEK_WRAP,RDA_SEEK_UP); delay(200); } ``` -------------------------------- ### Setup RDA5807 Device Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a02.html Initializes and starts the RDA5807 device with specified clock frequency, oscillator type, and calibration mode. ```cpp void RDA5807::setup(uint8_t clock_frequency = CLOCK_32K, uint8_t oscillator_type = OSCILLATOR_TYPE_PASSIVE, uint8_t rlck_no_calibrate = RLCK_NO_CALIBRATE_MODE_OFF) ``` -------------------------------- ### Basic RDA5807 Receiver Setup in Arduino Sketch Source: https://github.com/pu2clr/rda5807/blob/master/README.md Demonstrates the common way to use the RDA5807 library in an Arduino sketch. It includes starting the receiver, setting volume, and tuning to a specific frequency. ```cpp #include RDA5807 rx; void setup() { . . . // Start your receiver here rx.setup(); rx.setVolume(6); rx.setFrequency(some_frequency); // Example 10390 for 103,9 MHz . . . } void loop() { // Control your receiver here . . . } ``` -------------------------------- ### RDA5807 Radio Tuning Example Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a03.html Example demonstrating how to set an initial frequency and use buttons to increment or decrement it, controlling the RDA5807 radio module. ```cpp #include RDA5807 rx; void setup() { pinMode(4, INPUT_PULLUP); // Arduino pin 4 - Frequency Up pinMode(5, INPUT_PULLUP); // Arduino pin 5 - Frequency Down rx.setup(); rx.setFrequency(10390); // Tunes at 103.9 MHz } void loop() { if (digitalRead(4) == LOW) rx.setFrequencyUp(); if (digitalRead(5) == LOW) rx.setFrequencyDown(); delay(200); } ``` -------------------------------- ### Set Frequency Example (Arduino) Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html Example demonstrating how to set the frequency and use buttons to increment/decrement it in an Arduino environment. Requires including the RDA5807 library and setting up pins for button input. ```cpp #include RDA5807 rx; void setup() { pinMode(4, INPUT_PULLUP); // Arduino pin 4 - Frequency Up pinMode(5, INPUT_PULLUP); // Arduino pin 5 - Frequency Down rx.setup(); rx.setFrequency(10390); // Tunes at 103.9 MHz } void loop() { if (digitalRead(4) == LOW) rx.setFrequencyUp(); if (digitalRead(5) == LOW) rx.setFrequencyDown(); delay(200); } ``` -------------------------------- ### Install RDA5807 Library via arduino-cli on macOS/Linux Source: https://github.com/pu2clr/rda5807/blob/master/README.md Installs the latest development version of the RDA5807 library from GitHub using the arduino-cli. Ensure you have arduino-cli installed first. This method installs the current version, which may not be the most stable. ```bash curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh export ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true ./bin/arduino-cli lib install --git-url https://github.com/pu2clr/RDA5807 ``` -------------------------------- ### Set Receiver Frequency Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a03.html Tunes the receiver to a specific frequency. This example demonstrates basic setup and tuning using Arduino pins for frequency adjustment. ```cpp void RDA5807::setFrequency( uint16_t _frequency_ ) Sets the frequency. Tunes the receiver at a given frequency. Example: #include RDA5807 rx; void setup() { pinMode(4, INPUT_PULLUP); // Arduino pin 4 - Frequency Up pinMode(5, INPUT_PULLUP); // Arduino pin 5 - Frequency Down rx.setup(); rx.setFrequency(10390); // Tunes at 103.9 MHz } void loop() { if (digitalRead(4) == LOW) rx.setFrequencyUp(); if (digitalRead(5) == LOW) rx.setFrequencyDown(); delay(200); } RDA5807.h ``` -------------------------------- ### setup Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8h_source.html Initializes the RDA5807 module with specified clock frequency, oscillator type, and calibration mode. ```APIDOC ## setup ### Description Initializes the RDA5807 module with specified clock frequency, oscillator type, and calibration mode. ### Parameters - **clock_frequency** (uint8_t) - Optional - The desired clock frequency. Defaults to CLOCK_32K. - **oscillator_type** (uint8_t) - Optional - The type of oscillator to use. Defaults to OSCILLATOR_TYPE_PASSIVE. - **rlck_no_calibrate** (uint8_t) - Optional - The RLCK calibration mode. Defaults to RLCK_NO_CALIBRATE_MODE_OFF. ### Method void ### Endpoint N/A (Function Call) ``` -------------------------------- ### RDA5807::setup Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA02.html Initializes and starts the device with specified clock frequency, oscillator type, and RLCK calibration mode. ```APIDOC ## RDA5807::setup ### Description Initializes and starts the device with specified clock frequency, oscillator type, and RLCK calibration mode. ### Method void ### Parameters #### Path Parameters - **clock_frequency** (uint8_t) - Optional - Description: The clock frequency (default CLOCK_32K). - **oscillator_type** (uint8_t) - Optional - Description: The oscillator type (default OSCILLATOR_TYPE_PASSIVE). - **rlck_no_calibrate** (uint8_t) - Optional - Description: The RLCK calibration mode (default RLCK_NO_CALIBRATE_MODE_OFF). ### Endpoint N/A (Function Call) ``` -------------------------------- ### RDA5807::setup Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA02.html Starts the RDA5807 device. Allows selection of clock frequency, oscillator type, and calibration mode. ```APIDOC ## RDA5807::setup ### Description Starts the device. You can select the clock type and the frequency. The oscillator type can be set to OSCILLATOR_TYPE_CRYSTAL (passive crystal) or OSCILLATOR_TYPE_REFCLK (active crystal or signal generator). The clock type supports CLOCK_32K, CLOCK_12M, CLOCK_13M, CLOCK_19_2M, CLOCK_24M, CLOCK_26M, and CLOCK_38_4M. ### Method void setup(uint8_t clock_frequency=CLOCK_32K, uint8_t oscillator_type=OSCILLATOR_TYPE_PASSIVE, uint8_t rlck_no_calibrate=RLCK_NO_CALIBRATE_MODE_OFF) ### Parameters #### Optional Parameters - **clock_frequency** (uint8_t) - Optional - Clock frequency. Default is CLOCK_32K (32.768 kHz). - **oscillator_type** (uint8_t) - Optional - Sets the Oscillator type (passive or active crystal). Default is OSCILLATOR_TYPE_PASSIVE (passive Crystal). - **rlck_no_calibrate** (uint8_t) - Optional - If 0, RCLK clock is always supplied. If 1, RCLK clock is not always supplied when FM is working. ### Example Usage ```cpp #include RDA5807 rx; void setup() { rx.setup(); // Starts the receiver with default parameters // rx.setup(CLOCK_32K, OSCILLATOR_TYPE_ACTIVE); // 32.768kHz Active Crystal // rx.setup(CLOCK_12M, OSCILLATOR_TYPE_PASSIVE); // 12MHz passive crystal // rx.setup(CLOCK_38_4M, OSCILLATOR_TYPE_PASSIVE); // 38.4 MHz passive crystal rx.setFrequency(10390); // Tunes at 103.9 MHz } void loop() { } ``` ### See Also - [OSCILLATOR_TYPE_PASSIVE](RDA5807_8h.html#a0941eab712587842e5513eb6cd562717) - [OSCILLATOR_TYPE_ACTIVE](RDA5807_8h.html#a6231498726197328216bb70c6dfc21aa) - [RLCK_NO_CALIBRATE_MODE_ON](RDA5807_8h.html#a0bc18a7036f4f2571abdb66daa63c918) - [RLCK_NO_CALIBRATE_MODE_OFF](RDA5807_8h.html#acf26b27b8292674e78e04908e3c27bff) ``` -------------------------------- ### RDA5807::powerUp Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a02.html Powers the FM receiver on. This function is referenced by the setup() method. ```cpp void RDA5807::powerUp ( ) { // Implementation details omitted for brevity } ``` -------------------------------- ### RDA5807 Initialization with RDS Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA04.html Example of initializing the RDA5807 receiver, enabling RDS, and setting a frequency with an RDS service. Requires RDA5807.h. ```cpp #include RDA5807 rx; void setup() { rx.setup(); // Starts the receiver with default parameters rx.setRDS(true); rx.setRdsFifo(true); rx.setFrequency(10390); // Station with RDS service } ``` -------------------------------- ### RDA5807::getBand3Status Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Gets the status of the Band3 for the RDA5807 tuner. This indicates if the setup is within the 65 to 76 MHz range. ```APIDOC ## RDA5807::getBand3Status ### Description Gets the status of the Band3, indicating if the setup is for 65 to 76 MHz. ### Method `uint8_t RDA5807::getBand3Status()` ### Returns - `1`: If setup is 65 to 76 MHz. - `0`: If setup is 50 to 65 MHz. ``` -------------------------------- ### RDA5807::setup Example Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a02.html Initializes the RDA5807 receiver with default parameters or custom clock settings. It also demonstrates setting the initial frequency. ```cpp #include RDA5807 rx; void setup() { rx.setup(); // Starts the receiver with default parameters // rx.setup(CLOCK_32K, OSCILLATOR_TYPE_ACTIVE); // 32.768kHz Active Crystal // rx.setup(CLOCK_12M, OSCILLATOR_TYPE_PASSIVE); // 12MHz passive crystal // rx.setup(CLOCK_38_4M, OSCILLATOR_TYPE_PASSIVE); // 38.4 MHz passive crystal rx.setFrequency(10390); // Tunes at 103.9 MHz } void loop() { } ``` -------------------------------- ### Get Band 3 Status Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html Retrieves the current status of Band 3 for the RDA5807 module. Returns 1 if the setup is 65-76 MHz, and 0 if it is 50-65 MHz. ```cpp uint8_t RDA5807::getBand3Status() { rda_reg07 tmp; tmp.raw = getDirectRegister(0x07).raw; return tmp.refined.MODE_50_60; } ``` -------------------------------- ### RDA5807::setup Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html Initializes and starts the RDA5807 device. This function configures essential parameters such as clock frequency and oscillator type, preparing the receiver for operation. ```APIDOC ## RDA5807::setup ### Description Starts the device. ### Method void ### Parameters - **clock_frequency** (uint8_t) - Optional. The clock frequency for the device. Defaults to CLOCK_32K. - **oscillator_type** (uint8_t) - Optional. The type of oscillator to use. Defaults to OSCILLATOR_TYPE_PASSIVE. - **rlck_no_calibrate** (uint8_t) - Optional. RLCK calibration mode setting. Defaults to RLCK_NO_CALIBRATE_MODE_OFF. ``` -------------------------------- ### Get RDS Station Name Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8h_source.html Gets the station name from RDS data. ATTENTION: You must call getRdsReady() before calling this function. Returns a string with the station name. ```cpp inline char *getRdsStationName(void) { return getRdsText0A(); }; ``` -------------------------------- ### RDA5807 Seek with Callback Example Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Shows how to seek a station and execute a callback function to display the frequency during the seek process. Ensure the callback function retrieves the frequency using getFrequency(). ```cpp SI470X rx; void showFrequency() { uint16_t freq = rx.getFrequency(); Serial.print(freq); Serial.println("MHz "); } void loop() { . . rx.seek([RDA_SEEK_WRAP](RDA5807_8h.html#a52b8411f4955a310beb41daaa5f352af), [RDA_SEEK_UP](RDA5807_8h.html#a6cfac82e09114c1cdf276646ad595949), showFrequency); // Seek Up . . ``` -------------------------------- ### Implement Show Frequency Function for Seek Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a03.html This example demonstrates how to implement a `showFrequency` function that is called during the seek operation to display the current frequency. It requires the `getFrequency` function to retrieve the frequency. ```cpp SI470X rx; void showFrequency() { uint16_t freq = rx.getFrequency(); Serial.print(freq); Serial.println("MHz "); } void loop() { // ... rx.seek(RDA_SEEK_WRAP, RDA_SEEK_UP, showFrequency); // Seek Up // ... } ``` -------------------------------- ### Get RDS Program Information Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8h_source.html Gets the program information from RDS data. ATTENTION: You must call getRdsReady() before calling this function. Returns a char array with the program information (63 bytes). ```cpp inline char *getRdsProgramInformation(void) { return getRdsText2A(); }; ``` -------------------------------- ### getFrequency Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA01.html Gets the current frequency of the receiver. ```APIDOC ## getFrequency ### Description Gets the current frequency of the receiver. ### Method uint16_t ### Endpoint N/A (This is a function call, not an HTTP endpoint) ### Response #### Success Response - **return value** (uint16_t) - Description: The current frequency. ### Request Example N/A ``` -------------------------------- ### getLnaIcSel Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA01.html Gets the current value of the LNA_ICSEL_BIT. ```APIDOC ## getLnaIcSel ### Description Gets the current value of the LNA_ICSEL_BIT. ### Method uint8_t ### Endpoint N/A (This is a function call, not an HTTP endpoint) ### Response #### Success Response - **return value** (uint8_t) - Description: The current value of LNA_ICSEL_BIT. ### Request Example N/A ``` -------------------------------- ### RDA5807::getBand3Status Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Gets the status of the Band3. ```APIDOC ## RDA5807::getBand3Status ### Description Retrieves the current status of Band 3. ### Method uint8_t ### Parameters None ### Response - **status** (uint8_t) - The status of Band 3. ``` -------------------------------- ### RDA5807::getFrequency Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Gets the current frequency. ```APIDOC ## RDA5807::getFrequency ### Description Retrieves the current FM frequency the receiver is tuned to. ### Method uint16_t ### Parameters None ### Response - **frequency** (uint16_t) - The current frequency in kHz. ``` -------------------------------- ### waitAndFinishTune Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8h_source.html Waits for and finishes the tuning process. ```APIDOC ## waitAndFinishTune ### Description Waits for and finishes the tuning process. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method `void` ### Endpoint N/A (Function call) ### Parameters None ### Request Example ```c waitAndFinishTune(); ``` ### Response None (void function) ``` -------------------------------- ### Set Volume Up Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA07.html Increments the audio volume level. ```cpp void RDA5807::setVolumeUp() ``` -------------------------------- ### isMuted Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a01.html Gets the current audio mute status. ```APIDOC ## isMuted ### Description Gets Audio Mute Status. ### Method bool ### Response #### Success Response (200) - **return value** (bool) - Description: True if audio is muted, false otherwise. ``` -------------------------------- ### getBass Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/functions_func.html Retrieves the current bass boost setting. ```APIDOC ## getBass ### Description Retrieves the current bass boost setting. ### Method Not specified (likely a member function call). ### Endpoint Not applicable. ### Parameters None. ### Response Returns the bass boost setting (type: RDA5807). ``` -------------------------------- ### RDA5807::getRdsSync Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA04.html Gets the RDS synchronization status. ```APIDOC ## RDA5807::getRdsSync ### Description Gets the RDS synchronization status. ### Method `RDA5807::getRdsSync()` ### Parameters None ### Response - **bool**: The RDS synchronization status. ``` -------------------------------- ### RDA5807 Setup with Frequency and De-emphasis Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Initializes the RDA5807 module, tunes to a specific frequency, and sets the FM de-emphasis to 50 μs, commonly used in Europe, Australia, and Japan. ```cpp #include [RDA5807](group__GA01.html#classRDA5807) rx; void [setup](group__GA02.html#ga272444216a784ea5317c83783eb2bfe7)() { rx.[setup](group__GA02.html#ga272444216a784ea5317c83783eb2bfe7)(); rx.[setFrequency](group__GA03.html#gad16a6afa9520b77498b17a72c226305a)(10390); // Tunes at 103.9 MHz rx.[setFmDeemphasis](group__GA03.html#ga4f8fe00a561c39d2dc9a0a143b1866e9)(1); // Sets to 50 μs. Used in Europe, Australia, Japan. } void loop() { } ``` -------------------------------- ### RDA5807::getDeviceId Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA02.html Gets the device identification number. ```APIDOC ## RDA5807::getDeviceId ### Description Gets the device identification number. ### Method uint16_t ### Returns - **device number Id** (uint16_t) - The identification number of the device. ### Endpoint N/A (Function Call) ``` -------------------------------- ### Initialize RDA5807 Receiver with Default Parameters Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html Starts the RDA5807 receiver with default parameters. This function initializes the Wire library, powers up the device, and sets a delay. Optional parameters for clock frequency and oscillator type can be provided. ```cpp #include RDA5807 rx; void setup() { rx.setup(); // Starts the receiver with default parameters // rx.setup(CLOCK_32K, OSCILLATOR_TYPE_ACTIVE); // 32.768kHz Active Crystal // rx.setup(CLOCK_12M, OSCILLATOR_TYPE_PASSIVE); // 12MHz passive crystal // rx.setup(CLOCK_38_4M, OSCILLATOR_TYPE_PASSIVE); // 38.4 MHz passive crystal rx.setFrequency(10390); // Tunes at 103.9 MHz } void loop() { } ``` -------------------------------- ### getStatus Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a01.html Gets the register content of a given status register. ```APIDOC ## getStatus ### Description Gets the register content of a given status register (from 0x0A to 0x0F). ### Method void* ### Parameters #### Path Parameters - **reg** (uint8_t) - Description: The status register address to read from. ### Endpoint N/A (This is a library function call) ### Request Example ```c void* statusData = getStatus(0x0A); ``` ### Response - **statusData** (void*) - Description: A pointer to the status register content. ### Success Response (200) N/A ### Response Example N/A ``` -------------------------------- ### setI2SAllParameters Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8h_source.html Configures all parameters for the I2S audio interface. This function allows for fine-grained control over I2S settings. ```APIDOC ## setI2SAllParameters ### Description Configures all parameters for the I2S audio interface. This function allows for fine-grained control over I2S settings. ### Parameters #### Query Parameters - **R_DELY** (uint8_t) - Required - Right channel delay. - **L_DELY** (uint8_t) - Required - Left channel delay. - **SCLK_O_EDGE** (uint8_t) - Required - SCLK output edge. - **SW_O_EDGE** (uint8_t) - Required - SW output edge. - **I2S_SW_CNT** (uint8_t) - Required - I2S SW count. - **WS_I_EDGE** (uint8_t) - Required - WS input edge. - **DATA_SIGNED** (uint8_t) - Required - Data signed setting. - **SCLK_I_EDGE** (uint8_t) - Required - SCLK input edge. - **WS_LR** (uint8_t) - Required - WS LR setting. - **SLAVE_MASTER** (uint8_t) - Required - Slave or Master mode. - **OPEN_MODE** (uint8_t) - Required - Open mode setting. ``` -------------------------------- ### getRealFrequency Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA01.html Gets the current frequency based on the current channel. ```APIDOC ## getRealFrequency ### Description Gets the current frequency based on the current channel. ### Method uint16_t ### Endpoint N/A (This is a function call, not an HTTP endpoint) ### Response #### Success Response - **return value** (uint16_t) - Description: The current frequency based on the channel. ### Request Example N/A ``` -------------------------------- ### RDA5807 Seek Example Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html Demonstrates how to use the seek function to find a radio station. A callback function `showFrequency` is provided to display the current frequency during the seek operation. The seek operation can be configured to wrap around the band or stop at the limits, and can search up or down. ```cpp SI470X rx; void showFrequency() { uint16_t freq = rx.getFrequency(); Serial.print(freq); Serial.println("MHz "); } void loop() { ... rx.seek(RDA_SEEK_WRAP, RDA_SEEK_UP, showFrequency); // Seek Up ... } ``` -------------------------------- ### RDA5807::getMinimumFrequencyOfTheBand Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Gets the minimum frequency of the current band. ```APIDOC ## RDA5807::getMinimumFrequencyOfTheBand ### Description Retrieves the minimum frequency supported by the current FM band. ### Method uint16_t ### Parameters None ### Response - **frequency** (uint16_t) - The minimum frequency of the current band. ``` -------------------------------- ### Minimal RDA5807 Receiver Implementation Source: https://github.com/pu2clr/rda5807/blob/master/README.md Shows the most basic implementation using the RDA5807 library. It initializes the receiver with default parameters and tunes to a specified frequency. ```cpp #include RDA5807 rx; void setup() { rx.setup(); // Starts the receiver with default parameters rx.setFrequency(10390); // Tunes in 103.9 MHz - Switch to your local favorite station } void loop() { } ``` -------------------------------- ### RDA5807::getMaximunFrequencyOfTheBand Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Gets the maximum frequency of the current band. ```APIDOC ## RDA5807::getMaximunFrequencyOfTheBand ### Description Retrieves the maximum frequency supported by the current FM band. ### Method uint16_t ### Parameters None ### Response - **frequency** (uint16_t) - The maximum frequency of the current band. ``` -------------------------------- ### isFmReady() Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a03.html Checks if the FM receiver is ready for operation. Returns true if the FM module is ready, false otherwise. ```APIDOC ## isFmReady() ### Description Returns true if the FM is ready. ### Returns - bool: true if the FM module is ready, false otherwise. ``` -------------------------------- ### Get RDA5807 Frequency Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a03.html Retrieves the current frequency the RDA5807 is tuned to. ```cpp uint16_t RDA5807::getFrequency() ``` -------------------------------- ### Populating RDS Data Pointers Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html This snippet demonstrates how to call getRdsAllData to populate character pointers with station name, information, program information, and UTC time. Ensure setRDS(true) and setRdsFifo(true) are called beforehand. ```cpp char *stationName, *stationInfo, *programInfo, *rdsTime; // The char pointers above will be populate by the call below. So, the char pointers need to be passed by reference (pointer to pointer). if (rx.getRdsAllData(&stationName, &stationInfo , &programInfo, &rdsTime) ) { showProgramaInfo(programInfo); showStationName(stationName); showStationInfo(stationInfo); showUtcTime(rdsTime); } ``` -------------------------------- ### getRealChannel Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA01.html Gets the current channel stored in the 0x0A status register. ```APIDOC ## getRealChannel ### Description Gets the current channel stored in the 0x0A status register. ### Method uint16_t ### Endpoint N/A (This is a function call, not an HTTP endpoint) ### Response #### Success Response - **return value** (uint16_t) - Description: The current channel. ### Request Example N/A ``` -------------------------------- ### RDA5807::getRdsLocalTime Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA04.html Gets the RDS time converted to local time. ```APIDOC ## RDA5807::getRdsLocalTime ### Description Gets the RDS time converted to local time. ### Method `RDA5807::getRdsLocalTime()` ### Parameters None ### Response - **char***: A pointer to a character array containing the local time. ``` -------------------------------- ### setBass Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a07.html Sets the Bass Boost feature for the audio output. ```APIDOC ## setBass ### Description Sets Bass Boost. ### Method N/A (This is a setter method) ### Endpoint N/A ### Parameters #### Request Body - **value** (bool) - Required - true to enable Bass Boost, false to disable. ### Request Example ```json { "value": true } ``` ### Response #### Success Response (200) No specific response body is detailed, indicating a void return type or successful execution. ### Response Example ```json null ``` ``` -------------------------------- ### RDA5807::getRealFrequency Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Gets the current frequency bases on the current channel. ```APIDOC ## RDA5807::getRealFrequency ### Description Calculates and retrieves the current FM frequency based on the current channel setting. ### Method uint16_t ### Parameters None ### Response - **frequency** (uint16_t) - The calculated current frequency in kHz. ``` -------------------------------- ### Set GPIO Pins Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a02.html Configures the device's GPIO pins. Allows specifying the pin, its setup, and an optional MCU pin mapping. ```cpp void RDA5807::setGpio(uint8_t gpioPin, uint8_t gpioSetup = 0, int mcuPin = -1) ``` -------------------------------- ### Get Device ID Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a02.html Retrieves the unique identification of the RDA5807 device. ```cpp uint16_t RDA5807::getDeviceId() ``` -------------------------------- ### Get Current Frequency Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html Returns the currently set frequency of the FM receiver. ```cpp uint16_t RDA5807::getFrequency() { return this->currentFrequency; } ``` -------------------------------- ### Configure All I2S Parameters Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html Configures all parameters for I2S communication, including data delay, clock edge, sample rate, and master/slave mode. Ensure I2S is enabled separately using setI2SOn. ```C++ void RDA5807::setI2SAllParameters(uint8_t R_DELY, uint8_t L_DELY, uint8_t SCLK_O_EDGE, uint8_t SW_O_EDGE, uint8_t I2S_SW_CNT, uint8_t WS_I_EDGE, uint8_t DATA_SIGNED, uint8_t SCLK_I_EDGE, uint8_t WS_LR, uint8_t SLAVE_MASTER, uint8_t OPEN_MODE) { reg06->refined.R_DELY = R_DELY; reg06->refined.L_DELY = L_DELY; reg06->refined.SCLK_O_EDGE = SCLK_O_EDGE; reg06->refined.SW_O_EDGE = SW_O_EDGE; reg06->refined.I2S_SW_CNT = I2S_SW_CNT; reg06->refined.WS_I_EDGE = WS_I_EDGE; reg06->refined.DATA_SIGNED = DATA_SIGNED; reg06->refined.SCLK_I_EDGE = SCLK_I_EDGE; reg06->refined.WS_LR = WS_LR; reg06->refined.SLAVE_MASTER = SLAVE_MASTER; reg06->refined.OPEN_MODE = OPEN_MODE; setRegister(REG06, reg06->raw); } ``` -------------------------------- ### getRealFrequency Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8h_source.html Gets the actual current frequency of the receiver, accounting for any internal adjustments. ```APIDOC ## getRealFrequency ### Description Gets the actual current frequency of the receiver, accounting for any internal adjustments. ### Returns - uint16_t: The real current frequency. ### Method uint16_t ### Endpoint N/A (Function Call) ``` -------------------------------- ### setBass Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA07.html Sets the Bass Boost feature for the audio output. Can be enabled or disabled. ```APIDOC ## setBass ### Description Sets Bass Boost. Accepts a boolean value where FALSE disables it and TRUE enables it. ### Method void setBass(bool _value) ### Parameters #### Path Parameters - **_value** (bool) - Required - FALSE = Disable; TRUE = Enable ``` -------------------------------- ### getStatus Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA01.html Gets the register content of a given status register (from 0x0A to 0x0F). ```APIDOC ## getStatus ### Description Gets the register content of a given status register (from 0x0A to 0x0F). ### Method void * ### Parameters #### Path Parameters - **reg** (uint8_t) - Description: The status register address (0x0A to 0x0F). ### Endpoint N/A (This is a function call, not an HTTP endpoint) ### Response #### Success Response - **return value** (void *) - Description: Pointer to the register content. ### Request Example N/A ``` -------------------------------- ### RDA5807 Setup with Band and Frequency Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Initializes the RDA5807 module, sets the FM band to world-wide (76-108 MHz), and tunes to a specific frequency. ```cpp #include [RDA5807](group__GA01.html#classRDA5807) rx; void [setup](group__GA02.html#ga272444216a784ea5317c83783eb2bfe7)() { rx.[setup](group__GA02.html#ga272444216a784ea5317c83783eb2bfe7)(); rx.[setBand](group__GA03.html#ga889cfe43f3f9c9ca92c9862261d5dbbf)(2); // Sets band: 76–108 MHz (world wide) rx.[setFrequency](group__GA03.html#gad16a6afa9520b77498b17a72c226305a)(10390); // Tunes at 103.9 MHz } void loop() { } ``` -------------------------------- ### RDA5807::getRdsText2B Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA04.html Gets the Station Information from RDS text block 2B. ```APIDOC ## RDA5807::getRdsText2B ### Description Gets the Station Information from RDS text block 2B. ### Method `RDA5807::getRdsText2B()` ### Parameters None ### Response - **char***: A pointer to a character array containing the station information. ``` -------------------------------- ### RDA5807::getRdsText2A Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA04.html Gets the Program Information from RDS text block 2A. ```APIDOC ## RDA5807::getRdsText2A ### Description Gets the Program Information from RDS text block 2A. ### Method `RDA5807::getRdsText2A()` ### Parameters None ### Response - **char***: A pointer to a character array containing the program information. ``` -------------------------------- ### powerUp Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA01.html Powers the receiver on. ```APIDOC ## powerUp ### Description Powers the receiver on. ### Method void ### Endpoint N/A (This is a function call, not an HTTP endpoint) ### Response #### Success Response N/A (This function does not return a value) ### Request Example N/A ``` -------------------------------- ### powerUp Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/functions.html Powers up the RDA5807 chip. This function call initializes the device from a low-power state. ```APIDOC ## powerUp() ### Description Powers up the RDA5807 chip. ### Method Direct function call. ### Endpoint N/A ### Parameters None ### Request Example ``` powerUp() ``` ### Response None ``` -------------------------------- ### RDA5807::getRealChannel Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Gets the current channel stored in 0x0A status register. ```APIDOC ## RDA5807::getRealChannel ### Description Retrieves the current channel number as stored in the 0x0A status register. ### Method uint16_t ### Parameters None ### Response - **channel** (uint16_t) - The current channel number. ``` -------------------------------- ### getRdsAllData Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group___g_a04.html Retrieves Station Name, Station Information, Program Information, and UTC time. This function populates four char pointer parameters. Ensure you call setRDS(true) and setRdsFifo(true) before using this function. The provided char pointers will be populated by the function, so they must be passed by reference (pointer to pointer). ```APIDOC ## getRdsAllData ### Description Gets Station Name, Station Information, Program Information and utcTime. This function populates four char pointer variable parameters with Station Name, Station Information, Programa Information and UTC time. You must call setRDS(true), setRdsFifo(true) before calling getRdsAllData(...). ATTENTION: the parameters below are point to point to array of char. The right way to call this function is shown below. ```c char *stationName, *stationInfo, *programInfo, *rdsTime; // The char pointers above will be populate by the call below. So, the char pointers need to be passed by reference (pointer to pointer). if (rx.getRdsAllData(&stationName, &stationInfo , &programInfo, &rdsTime) ) { showProgramaInfo(programInfo); showStationName(stationName); showStationInfo(stationInfo); showUtcTime(rdsTime); } ``` ### Parameters #### Reference Parameters - **stationName** (char**) - If not NULL, points to the Name of the Station (char array - 9 bytes). - **stationInformation** (char**) - If not NULL, points to Station information (char array - 33 bytes). - **programInformation** (char**) - If not NULL, points to program information (char array - 65 bytes). - **utcTime** (char**) - If not NULL, points to char array containing the current UTC time (format HH:MM:SS +HH:MM). ### Returns True if at least one valid data is found. ### See also [setRDS](group___g_a04.html#ga4b741f1433eda57949bb40fa9e973732 "Sets the RDS operation."), [setRdsFifo](group___g_a04.html#gae27337170a5f3dedebf585aa19855ad6 "Sets RDS fifo mode enable."), [getRdsAllData](group___g_a04.html#gadafba5991f6f60a52ad73fdda8fac984 "Gets Station Name, Station Information, Program Information and utcTime.") ``` -------------------------------- ### RDA5807::isSoftmuted Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA07.html Gets the softmute status. Returns TRUE if softmute is enabled. ```APIDOC ## RDA5807::isSoftmuted ### Description Gets the softmute status of the audio output. ### Method ``` bool isSoftmuted() ``` ### Returns - `true`: If softmute is enabled. ``` -------------------------------- ### seek (with seek_mode, direction, and showFunc) Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Initiates a station seek operation and allows a callback function to be executed during the seek process, typically for displaying frequency updates. ```APIDOC ## seek (uint8_t seek_mode, uint8_t direction, void (*showFunc)()) ### Description Seek function. Seeks a station up or down and calls a user-defined function to show the frequency during the seek process. ### Parameters #### Path Parameters - **seek_mode** (uint8_t) - Required - If 0, wrap at the upper or lower band limit and continue seeking; 1 = stop seeking at the upper or lower band limit. - **direction** (uint8_t) - Required - If 0, seek down; if 1, seek up. - **showFunc** (void(*)()) - Required - A callback function to be executed during the seek process. This function should retrieve the frequency using `getFrequency()`. ### Example ```cpp // Assuming SI470X rx; void showFrequency() { uint16_t freq = rx.getFrequency(); Serial.print(freq); Serial.println("MHz "); } void loop() { // ... rx.seek(RDA_SEEK_WRAP, RDA_SEEK_UP, showFrequency); // Seek Up // ... } ``` ``` -------------------------------- ### RDA5807::setI2SAllParameters Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8h_source.html Configures all parameters for I2S audio output. ```APIDOC ## RDA5807::setI2SAllParameters ### Description Configures all parameters for I2S. ### Method `void` ### Parameters - `uint8_t R_DELY` - Right channel delay. - `uint8_t L_DELY` - Left channel delay. - `uint8_t SCLK_O_EDGE` - SCLK output edge. - `uint8_t SW_O_EDGE` - SW output edge. - `uint8_t I2S_SW_CNT` - I2S SW count. - `uint8_t WS_I_EDGE` - WS input edge. - `uint8_t DATA_SIGNED` - Data signed setting. - `uint8_t SCLK_I_EDGE` - SCLK input edge. - `uint8_t WS_LR` - WS LR setting. - `uint8_t SLAVE_MASTER` - Slave/Master mode. - `uint8_t OPEN_MODE` - Open mode. ``` -------------------------------- ### RDA5807 Set Band Example Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/_r_d_a5807_8cpp_source.html Shows how to set the FM band for the RDA5807 module. The example sets the band to 'world wide' (76–108 MHz) and then tunes to a specific frequency. Note that for band 3 with a 50-65 MHz range, manual control of band limits might be necessary. ```cpp #include RDA5807 rx; void setup() { rx.setup(); rx.setBand(2); // Sets band: 76–108 MHz (world wide) rx.setFrequency(10390); // Tunes at 103.9 MHz } void loop() { } ``` -------------------------------- ### RDA5807::getRdsTime Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA04.html Gets the RDS UTC time and date when the Group type is 4. ```APIDOC ## RDA5807::getRdsTime ### Description Gets the RDS UTC time and date when the Group type is 4. ### Method `RDA5807::getRdsTime()` ### Parameters None ### Response - **char***: A pointer to a character array containing the RDS UTC time and date. ``` -------------------------------- ### Arduino Setup for RDA5807 FM Radio Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA03.html Initializes the RDA5807 module, sets up input pins for frequency control, and tunes to an initial frequency. Uses a 50 kHz channel space. ```cpp #include RDA5807 rx; void setup() { pinMode(4, INPUT_PULLUP); // Arduino pin 4 - Frequency Up pinMode(5, INPUT_PULLUP); // Arduino pin 5 - Frequency Down rx.setup(); rx.setBandSpace(2); // 50 kHz Step rx.setFrequency(10390); // Tunes at 103.9 MHz } ``` -------------------------------- ### waitAndFinishTune Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA01.html Waits for the Seek or Tune operation to finish. ```APIDOC ## waitAndFinishTune ### Description Waits for the Seek or Tune operation to finish. ### Method void ### Endpoint N/A (This is a function call, not an HTTP endpoint) ### Response #### Success Response N/A (This function does not return a value) ### Request Example N/A ``` -------------------------------- ### RDA5807::getRdsText0A Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA04.html Gets the station name and other messages from RDS text block 0A. ```APIDOC ## RDA5807::getRdsText0A ### Description Gets the station name and other messages from RDS text block 0A. ### Method `RDA5807::getRdsText0A()` ### Parameters None ### Response - **char***: A pointer to a character array containing the station name and other messages. ``` -------------------------------- ### RDA5807::getRdsVersionCode Source: https://github.com/pu2clr/rda5807/blob/master/extras/apidoc/html/group__GA04.html Gets the version code extracted from Block B of the RDS data. ```APIDOC ## RDA5807::getRdsVersionCode ### Description Gets the version code extracted from Block B of the RDS data. ### Method `RDA5807::getRdsVersionCode()` ### Parameters None ### Response - **uint8_t**: The version code. ```