PU2CLR RDA5807 Arduino Library 1.1.9
Arduino Library for RDA5807 Devices - By Ricardo Lima Caratti
|
Functions | |
void | RDA5807::setDelayAfterCrystalOn (uint8_t ms_value) |
Set the Delay After Crystal On (default 500ms) | |
void | RDA5807::setI2CBusAddrs (int directAccess, int fullAccess) |
Sets alternatives I2C bus address. | |
void | RDA5807::setGpio (uint8_t gpioPin, uint8_t gpioSetup=0, int mcuPin=-1) |
Sets the Device GPIO pins. | |
void | RDA5807::setInterruptMode (uint8_t value) |
Sets Interrupt Mode. | |
void | RDA5807::getStatusRegisters () |
Gets all current device status and RDS information registers (From 0x0A to 0x0F) | |
word16_to_bytes | RDA5807::getDirectRegister (uint8_t reg) |
Gets the register content via direct access. | |
void * | RDA5807::getStatus (uint8_t reg) |
Gets the register content of a given status register (from 0x0A to 0x0F) | |
void | RDA5807::setRegister (uint8_t reg, uint16_t value) |
Sets a given value to a specific device register. | |
void | RDA5807::waitAndFinishTune () |
Waits for Seek or Tune finish. | |
void | RDA5807::softReset () |
Resets the device. | |
void | RDA5807::powerUp () |
Powers the receiver on. | |
void | RDA5807::setNewDemodulateMethod (bool value) |
Sets new demodulate method. It can improve the receiver sensitivity about 1dB. | |
void | RDA5807::powerDown () |
Power the receiver off. | |
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) |
Starts the device. | |
uint16_t | RDA5807::getDeviceId () |
Gets the Device identification. | |
uint16_t RDA5807::getDeviceId | ( | ) |
Gets the Device identification.
word16_to_bytes RDA5807::getDirectRegister | ( | uint8_t | reg | ) |
Gets the register content via direct access.
this method is useful to deal with a specific register.
uint8_t | register number |
void * RDA5807::getStatus | ( | uint8_t | reg | ) |
Gets the register content of a given status register (from 0x0A to 0x0F)
Useful when you need just a specific status register content.
This methos update the first element of the shadowStatusRegisters linked to the register
void RDA5807::getStatusRegisters | ( | ) |
Gets all current device status and RDS information registers (From 0x0A to 0x0F)
Referenced by RDA5807::getRdsReady().
void RDA5807::powerDown | ( | ) |
Power the receiver off.
void RDA5807::powerUp | ( | ) |
Powers the receiver on.
Referenced by RDA5807::setup().
|
inline |
Set the Delay After Crystal On (default 500ms)
Minimum time required for the oscillator to become stable
ms_value | Value in milliseconds |
void RDA5807::setGpio | ( | uint8_t | gpioPin, |
uint8_t | gpioSetup = 0 , |
||
int | mcuPin = -1 |
||
) |
Sets the Device GPIO pins.
This method is useful to add control to the system via GPIO RDA devive pins.
For example: You can use these pins to control RDS and SEEK via interrupt.
GPIOs are General Purpose I/O pin.
GPIO setup
When GPIO1 (#1), gpioSetup can be: 00 = High impedance; 01 = Reserved; 10 = Low; 11 = High
When GPIO2 (#2), gpioSetup can be: 00 = High impedance; 01 = Interrupt (INT) 10 = Low; 11 = High
When GPIO3 (#3), gpioSetup can be: 00 = High impedance; 01 = Mono/Stereo indicator (ST) = Low; 11 = High
gpioPin | gpio number (1, 2 or 3) |
gpioSetup | See description above |
mcuPip | MCU (Arduino) pin connected to the gpio |
|
inline |
Sets alternatives I2C bus address.
You do not need use this function on RDA5807M
directAccess | |
fullAccess |
References RDA5807::deviceAddressDirectAccess, and RDA5807::deviceAddressFullAccess.
void RDA5807::setInterruptMode | ( | uint8_t | value | ) |
Sets Interrupt Mode.
GPIO2 could be programmed to output a low interrupt (interrupt will be generated only with interrupt enable bit STCIEN is set to high) when seek/tune process completes
Setting STCIEN = 1 will generate a low pulse on GPIO2 when the interrupt occurs.
ATTENTION: This function affects the behavior of the GPIO2 pin. The register 0x04 GPIO2 attribute will be setted to 1
value | 0 = disable; 1 = enqble |
void RDA5807::setNewDemodulateMethod | ( | bool | value | ) |
Sets new demodulate method. It can improve the receiver sensitivity about 1dB.
value | true or false |
void RDA5807::setRegister | ( | uint8_t | reg, |
uint16_t | value | ||
) |
Sets a given value to a specific device register.
reg | register number (valid values is between 0x02 and 0x07) |
value | the unsigned 16 bits word value (see rda_rec0x data types) |
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 |
||
) |
Starts the device.
You can select the colck type and the frequency
oscillator type: OSCILLATOR_TYPE_CRYSTAL = passive crystal; OSCILLATOR_TYPE_REFCLK = active crystal or signal generator
Clock type: CLOCK_32K, CLOCK_12M, CLOCK_13M, CLOCK_19_2M, CLOCK_24M, CLOCK_26M and CLOCK_38_4M
clock_frequency | optional; Clock frequency. Default 32.768 kHz. |
oscillator_type | optional; Sets the Oscillator type (passive or active crystal); default: passive Crystal. |
rlck_no_calibrate | optional; if 0=RCLK clock is always supply; 1=RCLK clock is not always supply when FM work |
References RDA5807::powerUp().
void RDA5807::softReset | ( | ) |
Resets the device.
The RDA5807M is RESET itself When VIO is Power up.
Also, it support soft reset by triggering the 0x02 register (rda_reg02) bit 1 from 0 to 1.
void RDA5807::waitAndFinishTune | ( | ) |
Waits for Seek or Tune finish.
Referenced by RDA5807::seek(), and RDA5807::setChannel().