PU2CLR RDA5807 Arduino Library 1.1.3
Arduino Library for RDA5807 Devices - By Ricardo Lima Caratti
Loading...
Searching...
No Matches
RDA5807.cpp
Go to the documentation of this file.
1/**
2 * @mainpage RDA5807 Arduino Library implementation
3 * @details RDA5807 Arduino Library implementation. This is an Arduino library for the RDA5807, BROADCAST RECEIVER.
4 * @details It works with I2C protocol and can provide an easier interface to control the RDA5807 device.<br>
5 * @details This library was built based on "RDA5807M - SINGLE-CHIP BROADCAST FM RADIO TUNER - Rev.1.1–Aug.2015"
6 * @details and RDA microelectronics RDA5807FP - SINGLE-CHIP BROADCAST FM RADIO TUNER
7 * @details This library can be freely distributed using the MIT Free Software model.
8 * @copyright Copyright (c) 2020 Ricardo Lima Caratti.
9 * @author Ricardo LIma Caratti (pu2clr@gmail.com)
10 */
11
12#include <RDA5807.h>
13
14/**
15 * @defgroup GA02 Basic Functions
16 * @section GA03 Basic
17 */
18
19/**
20 * @ingroup GA03
21 * @brief Set the Device GPIO pins
22 * @details This method is useful to add control to the system via GPIO RDA devive pins.
23 * @details For example: You can use these pins to control RDS and SEEK via interrupt.
24 * @details GPIOs are General Purpose I/O pin.
25 * @details GPIO setup
26 * @details When GPIO1 (#1), gpioSetup can be: 00 = High impedance; 01 = Reserved; 10 = Low; 11 = High
27 * @details When GPIO2 (#2), gpioSetup can be: 00 = High impedance; 01 = Interrupt (INT) 10 = Low; 11 = High
28 * @details When GPIO3 (#3), gpioSetup can be: 00 = High impedance; 01 = Mono/Stereo indicator (ST) = Low; 11 = High
29 *
30 * @param gpioPin gpio number (1, 2 or 3)
31 * @param gpioSetup See description above
32 * @param mcuPip MCU (Arduino) pin connected to the gpio
33 */
34void RDA5807::setGpio(uint8_t gpioPin, uint8_t gpioSetup, int mcuPin)
35{
36
37 switch (gpioPin) {
38 case 1:
39 this->gpio1Control = mcuPin;
40 reg04->refined.GPIO1 = gpioSetup;
41 break;
42 case 2:
43 this->gpio2Control = mcuPin;
44 reg04->refined.GPIO2 = gpioSetup;
45 break;
46 case 3:
47 this->gpio3Control = mcuPin;
48 reg04->refined.GPIO3 = gpioSetup;
49 break;
50 default:
51 gpio1Control = gpio2Control = gpio3Control = -1;
52
53 }
54 setRegister(REG04,reg04->raw);
55}
56
57/**
58 * @ingroup GA02
59 * @brief Gets all current device status and RDS information registers (From 0x0A to 0x0F)
60 * @see RDA5807M - SINGLE-CHIP BROADCAST FMRADIO TUNER; pages 5, 9, 12 and 13.
61 * @see rda_reg0a, rda_reg0b, rda_reg0c, rda_reg0d, rda_reg0e, rda_reg0f
62 * @see shadowStatusRegisters;
63 */
65{
66 word16_to_bytes aux;
67 int i;
68
69 Wire.requestFrom(this->deviceAddressFullAccess, 12); // This call starts reading from 0x0A register
70 for (i = 0; i < 6; i++) {
71 aux.refined.highByte = Wire.read();
72 aux.refined.lowByte = Wire.read();
73 shadowStatusRegisters[i] = aux.raw;
74 }
75 Wire.endTransmission();
76}
77
78/**
79 * @ingroup GA02
80 * @brief Gets the register content of a given status register (from 0x0A to 0x0F)
81 * @details Useful when you need just a specific status register content.
82 * @details This methos update the first element of the shadowStatusRegisters linked to the register
83 * @return rdax_reg0a the reference to current value of the 0x0A register.
84 */
85void *RDA5807::getStatus(uint8_t reg)
86{
87 word16_to_bytes aux;
88
89 if ( reg < 0x0A || reg > 0x0F ) return NULL; // Maybe not necessary.
90
91 Wire.beginTransmission(this->deviceAddressDirectAccess);
92 Wire.write(reg);
93 Wire.endTransmission(false);
94 Wire.requestFrom(this->deviceAddressDirectAccess, 2); // reading 0x0A register
95 delayMicroseconds(250);
96 aux.refined.highByte = Wire.read();
97 aux.refined.lowByte = Wire.read();
98 Wire.endTransmission(true);
99 shadowStatusRegisters[reg - 0x0A] = aux.raw;
100
101 return &shadowStatusRegisters[reg - 0x0A];
102}
103
104
105/**
106 * @ingroup GA02
107 * @brief Sets a given value to a specific device register
108 *
109 * @see RDA5807M - SINGLE-CHIP BROADCAST FMRADIO TUNER; pages 5, 9, 10 and 11.
110 * @see rda_reg02, rda_reg03, rda_reg04, rda_reg05, rda_reg06, rda_reg07
111 *
112 * @param reg register number (valid values is between 0x02 and 0x07)
113 * @param value the unsigned 16 bits word value (see rda_rec0x data types)
114 */
115void RDA5807::setRegister(uint8_t reg, uint16_t value)
116{
117 word16_to_bytes aux;
118 if (reg > 8) return; // Maybe not necessary.
119 Wire.beginTransmission(this->deviceAddressDirectAccess);
120 Wire.write(reg);
121 aux.raw = value;
122 Wire.write(aux.refined.highByte);
123 Wire.write(aux.refined.lowByte);
124 Wire.endTransmission();
125 shadowRegisters[reg] = aux.raw; // Updates the shadowRegisters element
126 delayMicroseconds(3000); // Check
127}
128
129/**
130 * @ingroup GA02
131 * @brief Waits for Seek or Tune finish
132 */
134{
135 do {
136 getStatus(REG0A);
137 } while (reg0a->refined.STC == 0);
138}
139
140/**
141 * @ingroup GA02
142 * @brief Resets the device
143 * @details The RDA5807M is RESET itself When VIO is Power up.
144 * @details Also, it support soft reset by triggering the 0x02 register (rda_reg02) bit 1 from 0 to 1.
145 */
147{
148 reg02->refined.SOFT_RESET = 1;
149 setRegister(REG02,reg02->raw);
150}
151
152/**
153 * @ingroup GA02
154 * @brief Powers the receiver on
155 */
157{
158 reg02->raw = 0;
159 reg02->refined.NEW_METHOD = 0;
160 reg02->refined.RDS_EN = 0; // RDS disable
161 reg02->refined.CLK_MODE = this->clockType;
162 reg02->refined.RCLK_DIRECT_IN = this->oscillatorType;
163 reg02->refined.MONO = 1; // Force mono
164 reg02->refined.DMUTE = 1; // Normal operation
165 reg02->refined.DHIZ = 1; // Normal operation
166 reg02->refined.ENABLE = 1;
167 reg02->refined.BASS = 1;
168 reg02->refined.SEEK = 0;
169
170 setRegister(REG02,reg02->raw);
171
172 reg05->raw = 0x00;
173 reg05->refined.INT_MODE = 0;
174 reg05->refined.LNA_PORT_SEL = 2;
175 reg05->refined.LNA_ICSEL_BIT = 0;
176 reg05->refined.SEEKTH = 8; // 0b1000
177 reg05->refined.VOLUME = 0;
178
179 setRegister(REG05, reg05->raw);
180}
181
182/**
183 * @ingroup GA02
184 * @brief Sets new demodulate method. It can improve the receiver sensitivity about 1dB
185 *
186 * @param value true or false
187 */
189 reg02->refined.NEW_METHOD = value;
190 setRegister(REG02,reg02->raw);
191}
192
193/**
194 * @ingroup GA02
195 * @brief Power the receiver off
196 */
198{
199 reg02->refined.SEEK = 0;
200 reg02->refined.ENABLE = 0;
201 setRegister(REG02, reg02->raw);
202}
203
204
205/**
206 * @ingroup GA02
207 * @brief Starts the device
208 * @details You can select the colck type and the frequency
209 * @details Occilator type: OSCILLATOR_TYPE_CRYSTAL = passive crystal; OSCILLATOR_TYPE_REFCLK = active crystal or signal generator
210 * @details Clock type: CLOCK_32K, CLOCK_12M, CLOCK_13M, CLOCK_19_2M, CLOCK_24M, CLOCK_26M and CLOCK_38_4M
211 * @param clock_type Clock used.
212 * @param oscillator_type optional. Sets the Oscillator type used (default: passive Crystal).
213 */
214void RDA5807::setup(uint8_t clock_type, uint8_t oscillator_type)
215{
216 this->oscillatorType = oscillator_type;
217 this->clockType = clock_type;
218
219 Wire.begin();
220 delay(1);
221 powerUp();
222
223}
224
225
226/**
227 * @defgroup GA03 FM Tune Functions
228 * @section GA03 FM Tune
229 */
230
231
232/**
233 * @ingroup GA03
234 * @brief Sets Soft Blend.
235 *
236 * @param value true or false
237 */
238 void RDA5807::setSoftBlendEnable(bool value) {
239 reg07->refined.SOFTBLEND_EN = value;
240 setRegister(REG07,reg07->raw);
241 }
242
243/**
244 * @ingroup GA03
245 * @brief Sets AFC true or false
246 *
247 * @param value true or false
248 */
249void RDA5807::setAFC(bool value) {
250 reg04->refined.AFCD = value;
251 setRegister(REG04,reg04->raw);
252}
253
254
255
256/**
257 * @ingroup GA03
258 * @brief Sets the channel
259 * @details This method tunes the rteceiver in a given channel.
260 * @details The channel can be calculated by using the follow formula
261 * @details channel = (desired frequency - start band frequency) / space channel in use / 10.0);
262 *
263 * @see setFrequency, setBand, setSpace
264 * @see RDA5807M - SINGLE-CHIP BROADCAST FM RADIO TUNER - Rev.1.1–Aug.2015; pages 9 and 12.
265 *
266 * @param channel
267 */
268void RDA5807::setChannel(uint16_t channel)
269{
270 reg03->refined.CHAN = channel;
271 reg03->refined.TUNE = 1;
272 reg03->refined.BAND = this->currentFMBand;
273 reg03->refined.SPACE = this->currentFMSpace;
274 reg03->refined.DIRECT_MODE = 0;
275 setRegister(REG03, reg03->raw);
277}
278
279/**
280 * @ingroup GA03
281 * @brief Sets the frequency
282 * @param frequency
283 */
284void RDA5807::setFrequency(uint16_t frequency)
285{
286 uint16_t channel = (frequency - this->startBand[currentFMBand] ) / (this->fmSpace[this->currentFMSpace] );
287 setChannel(channel);
288 this->currentFrequency = frequency;
289}
290
291/**
292 * @ingroup GA03
293 * @brief Increments the current frequency
294 * @details The increment uses the band space as step. See array: uint16_t fmSpace[4] = {100/10, 200/10, 50/10, 25/10};
295 */
297{
298 if (this->currentFrequency < this->endBand[this->currentFMBand])
299 this->currentFrequency += (this->fmSpace[currentFMSpace] );
300 else
301 this->currentFrequency = this->startBand[this->currentFMBand];
302
303 setFrequency(this->currentFrequency);
304}
305
306/**
307 * @ingroup GA03
308 * @brief Decrements the current frequency
309 * @details The drecrement uses the band space as step. See array: uint16_t fmSpace[4] = {20, 10, 5, 1};
310 */
312{
313 if (this->currentFrequency > this->startBand[this->currentFMBand])
314 this->currentFrequency -= (this->fmSpace[currentFMSpace] );
315 else
316 this->currentFrequency = this->endBand[this->currentFMBand];
317
318 setFrequency(this->currentFrequency);
319}
320
321/**
322 * @ingroup GA03
323 * @brief Gets the current frequency.
324 * @return uint16_t
325 */
327{
328 return this->currentFrequency;
329}
330
331/**
332 * @ingroup GA03
333 * @brief Gets the current channel stored in 0x0A status register.
334 *
335 * @see setChannel, setFrequency, setBand, setSpace
336 * @see RDA5807M - SINGLE-CHIP BROADCAST FM RADIO TUNER - Rev.1.1–Aug.2015; pages 9 and 12.
337 *
338 * @return uint16_t current channel value
339 */
341{
342 getStatus(REG0A);
343 return reg0a->refined.READCHAN;
344}
345
346/**
347 * @ingroup GA03
348 * @brief Gets the current frequency bases on the current channel.
349 * @details The current channel is stored in the 0x0A register. This value is updated after a tune or seek operation.
350 * @details The current frequency can be calculated by the formula below
351 *
352 * | Band | Formula |
353 * | ------ | ------- |
354 * | 0 | Frequency = Channel Spacing (kHz) x READCHAN[9:0]+ 87.0 MHz |
355 * | 1 or 2 | Frequency = Channel Spacing (kHz) x READCHAN[9:0]+ 76.0 MHz |
356 * | 3 | Frequency = Channel Spacing (kHz) x READCHAN[9:0]+ 65.0 MHz |
357 *
358 * @see setChannel, setFrequency, setBand, setSpace
359 * @see RDA5807M - SINGLE-CHIP BROADCAST FM RADIO TUNER - Rev.1.1–Aug.2015; pages 9 and 12.
360 * @return uint16_t
361 */
363 return getRealChannel() * (this->fmSpace[this->currentFMSpace]) + this->startBand[currentFMBand];
364 }
365
366/**
367 * @ingroup GA03
368 * @brief Seek function
369 *
370 * @param 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
371 * @param direction if 0, seek down; if 1, seek up.
372 */
373void RDA5807::seek(uint8_t seek_mode, uint8_t direction)
374 {
375 reg02->refined.SEEK = 1;
376 reg02->refined.SKMODE = seek_mode;
377 reg02->refined.SEEKUP = direction;
378 setRegister(REG02,reg02->raw);
379}
380
381/**
382 * @ingroup GA03
383 * @brief Seek function
384 * @details Seeks a station up or down.
385 * @details Seek up or down a station and call a function defined by the user to show the frequency during the seek process.
386 * @details 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).
387 * @details 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.
388 * @details The SEEK bit is set low and the STC bit is set high when the seek operation completes.
389 * @details It is important to say you have to implement a show frequency function. This function have to get the frequency via getFrequency function.
390 * @details Example:
391 * @code
392 *
393 * SI470X rx;
394 *
395 * void showFrequency() {
396 * uint16_t freq = rx.getFrequency();
397 * Serial.print(freq);
398 * Serial.println("MHz ");
399 * }
400 *
401 * void loop() {
402 * .
403 * .
404 * rx.seek(SI470X_SEEK_WRAP, SI470X_SEEK_UP, showFrequency); // Seek Up
405 * .
406 * .
407 * }
408 * @endcode
409 * @param 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.
410 * @param direction Seek Direction; 0 = Seek down (default); 1 = Seek up.
411 * @param 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.
412 */
413void RDA5807::seek(uint8_t seek_mode, uint8_t direction, void (*showFunc)())
414{
415 getStatus(REG0A);
416 do
417 {
418 reg02->refined.SEEK = 1;
419 reg02->refined.SKMODE = seek_mode;
420 reg02->refined.SEEKUP = direction;
421 setRegister(REG02, reg02->raw);
422 this->currentFrequency = getRealFrequency(); // gets the current seek frequency
423 if (showFunc != NULL)
424 {
425 showFunc();
426 }
427 delay(10);
428 getStatus(REG0A);
429 } while (reg0a->refined.STC == 0);
431 setFrequency(getRealFrequency()); // Fixes station found.
432}
433
434
435
436/**
437 * @ingroup GA03
438 * @brief Sets RSSI Seek Threshold
439 * @param value
440 */
441void RDA5807::setSeekThreshold(uint8_t value)
442{
443 reg05->refined.SEEKTH = value;
444 setRegister(REG05,reg05->raw);
445}
446
447/**
448 * @ingroup GA03
449 * @brief Sets the FM band. See table below.
450 *
451 * FM band table
452 *
453 * | Value | Description |
454 * | ----- | --------------------------- |
455 * | 00 | 87–108 MHz (US/Europe) |
456 * | 01 | 76–91 MHz (Japan) |
457 * | 10 | 76–108 MHz (world wide) |
458 * | 11 | 65 –76 MHz (East Europe) or 50-65MHz (see bit 9 of gegister 0x06) |
459 *
460 * @param band FM band index. See table above.
461 */
462void RDA5807::setBand(uint8_t band)
463{
464 // reg03->refined.BAND = band;
465 reg03->refined.BAND = this->currentFMBand = band; // Adjusted by anonimous developer
466 setRegister(REG03,reg03->raw);
467}
468
469/**
470 * @ingroup GA03
471 * @brief Sets the FM channel space.
472 *
473 * Channel space table
474 *
475 * | Value | Description |
476 * | ----- | ----------- |
477 * | 00 | 100KHz |
478 * | 01 | 200KHz |
479 * | 10 | 50KHz |
480 * | 11 | 25KHz |
481 *
482 * @param space FM channel space. See table above.
483 * @todo make the space 01 (200kHz) work.
484 */
485void RDA5807::setSpace(uint8_t space)
486{
487 reg03->refined.SPACE = space;
488 this->currentFMSpace = space;
489 setRegister(REG03, reg03->raw);
490}
491
492/**
493 * @ingroup GA03 - Frequency step
494 * @brief Sets the FM Step;
495 * @details Converts the step frequency (25, 50, 100 or 200 kHz) to Space. Invalid values will be converted to 0 (100 kHz)
496 * @param step 25, 50, 100 or 200 kHz
497 * @todo Make the step 200kHz work well
498 */
499void RDA5807::setStep(uint8_t step)
500{
501 uint8_t space;
502 switch (step) {
503 case 100:
504 space = 0; // b00
505 break;
506 case 200:
507 space = 1; // b01
508 break;
509 case 50:
510 space = 2; // b10
511 break;
512 case 25:
513 space = 3; // b11
514 break;
515 default:
516 space = 0;
517 }
518 this->setSpace(space);
519}
520
521
522/**
523 * @ingroup GA03
524 * @brief Gets the current Rssi
525 * @details RSSI; 000000 = min; 111111 = max; RSSI scale is logarithmic.
526 *
527 * @return int
528 */
530{
531 getStatus(REG0B);
532 return reg0b->refined.RSSI;
533}
534
535
536/**
537 * @ingroup GA03
538 * @todo
539 * @brief Gets the Device identification
540 * @return number
541 */
543{
544 return 0;
545}
546
547/**
548 * @ingroup GA03
549 * @brief Sets De-emphasis.
550 * @details 75 μs. Used in USA (default); 50 μs. Used in Europe, Australia, Japan.
551 *
552 * @param de 0 = 75 μs; 1 = 50 μs
553 */
554void RDA5807::setFmDeemphasis(uint8_t de) {
555 reg04->refined.DE = de;
556 setRegister(REG04,reg04->raw);
557}
558
559/**
560 * @defgroup GA04 RDS Functions
561 * @section GA04 RDS/RBDS
562 * @todo Need optimizing the method to get the RDS informastion - getStatusRegisters should be called just once at a cicle.
563 */
564
565/**
566 * @ingroup GA04
567 * @brief Sets the RDS operation
568 * @details Enable or Disable the RDS
569 *
570 * @param true = turns the RDS ON; false = turns the RDS OFF
571 */
572void RDA5807::setRDS(bool value)
573{
574 reg02->refined.SEEK = 0;
575 reg02->refined.RDS_EN = value;
576 setRegister(REG02, reg02->raw);
577}
578
579/**
580 * @ingroup GA04
581 * @brief Sets the RBDS operation
582 * @details Enable or Disable the RDS
583 *
584 * @param true = turns the RBDS ON; false = turns the RBDS OFF
585 */
586void RDA5807::setRBDS(bool value)
587{
588 reg02->refined.SEEK = 0;
589 reg02->refined.RDS_EN = 1;
590 setRegister(REG02, reg02->raw);
591 reg04->refined.RBDS = value;
592 setRegister(REG04, reg04->raw);
593}
594
595
596/**
597 * @ingroup GA04
598 * @brief Returns true if RDS Ready
599 * @details Read address 0Ah and check the bit RDSR.
600 * @details When using the polling method, it is best not to poll continuously. The data will appear in intervals.
601 * @return true
602 * @return false
603 */
605{
606 getStatus(REG0A);
607
608 return reg0a->refined.RDSR;
609}
610
611/**
612 * @ingroup GA04
613 *
614 * @brief Returns the current Text Flag A/B
615 * @return uint8_t current Text Flag A/B
616 */
618{
619 rds_blockb blkb;
620 getStatusRegisters(); // TODO: Should be called just once and be processed by all RDS functions at a time.
621 blkb.blockB = reg0d->RDSB;
622 return blkb.refined.textABFlag;
623}
624
625/**
626 * @ingroup GA04
627 * @brief Return the group type
628 *
629 * @return uint16_t
630 */
632{
633 rds_blockb blkb;
634
635 getStatusRegisters(); // TODO: Should be called just once and be processed by all RDS functions at a time.
636 blkb.blockB = reg0d->RDSB;
637 return blkb.group0.groupType;
638}
639
640/**
641 * @ingroup GA04
642 *
643 * @brief Gets the version code (extracted from the Block B)
644 * @returns 0=A or 1=B
645 */
647{
648 rds_blockb blkb;
649 getStatusRegisters(); // TODO: Should be called just once and be processed by all RDS functions at a time.
650 blkb.blockB = reg0d->RDSB;
651 return blkb.refined.versionCode;
652}
653
654/**
655 * @ingroup GA04
656 * @brief Returns the Program Type (extracted from the Block B)
657 * @see https://en.wikipedia.org/wiki/Radio_Data_System
658 * @return program type (an integer betwenn 0 and 31)
659 */
661{
662 rds_blockb blkb;
663 getStatusRegisters(); // TODO: Should be called just once and be processed by all RDS functions at a time.
664 blkb.blockB = reg0d->RDSB;
665 return blkb.refined.programType;
666}
667
668/**
669 * @ingroup GA04
670 *
671 * @brief Process data received from group 2B
672 * @param c char array reference to the "group 2B" text
673 */
674void RDA5807::getNext2Block(char *c)
675{
676 char raw[2];
677 int i, j;
678 word16_to_bytes blk;
679
680 blk.raw = reg0f->RDSD;
681
682 raw[1] = blk.refined.lowByte;
683 raw[0] = blk.refined.highByte;
684
685 for (i = j = 0; i < 2; i++)
686 {
687 if (raw[i] == 0xD || raw[i] == 0xA)
688 {
689 c[j] = '\0';
690 return;
691 }
692 if (raw[i] >= 32)
693 {
694 c[j] = raw[i];
695 j++;
696 }
697 else
698 {
699 c[i] = ' ';
700 }
701 }
702}
703
704/**
705 * @ingroup GA04
706 *
707 * @brief Process data received from group 2A
708 *
709 * @param c char array reference to the "group 2A" text
710 */
711void RDA5807::getNext4Block(char *c)
712{
713 char raw[4];
714 int i, j;
715 word16_to_bytes blk_c, blk_d;
716
717 blk_c.raw = reg0e->RDSC;
718 blk_d.raw = reg0f->RDSD;
719
720 raw[0] = blk_c.refined.highByte;
721 raw[1] = blk_c.refined.lowByte;
722 raw[2] = blk_d.refined.highByte;
723 raw[3] = blk_d.refined.lowByte;
724
725 for (i = j = 0; i < 4; i++)
726 {
727 if (raw[i] == 0xD || raw[i] == 0xA)
728 {
729 c[j] = '\0';
730 return;
731 }
732 if (raw[i] >= 32)
733 {
734 c[j] = raw[i];
735 j++;
736 }
737 else
738 {
739 c[i] = ' ';
740 }
741 }
742}
743
744/**
745 * @ingroup GA04
746 *
747 * @brief Gets the RDS Text when the message is of the Group Type 2 version A
748 * @return char* The string (char array) with the content (Text) received from group 2A
749 */
750char *RDA5807::getRdsText(void)
751{
752 static int rdsTextAdress2A;
753 rds_blockb blkb;
754
756
757 blkb.blockB = reg0d->RDSB;
758 rdsTextAdress2A = blkb.group2.address;
759
760 if (rdsTextAdress2A >= 16)
761 rdsTextAdress2A = 0;
762
763 getNext4Block(&rds_buffer2A[rdsTextAdress2A * 4]);
764 rdsTextAdress2A += 4;
765 return rds_buffer2A;
766}
767
768/**
769 * @ingroup GA04
770 * @todo RDS Dynamic PS or Scrolling PS support
771 * @brief Gets the station name and other messages.
772 *
773 * @return char* should return a string with the station name.
774 * However, some stations send other kind of messages
775 */
777{
778 static int rdsTextAdress0A;
779 rds_blockb blkb;
780
782 blkb.blockB = reg0d->RDSB;
783
784 if (blkb.group0.groupType == 0)
785 {
786 // Process group type 0
787 rdsTextAdress0A = blkb.group0.address;
788 if (rdsTextAdress0A >= 0 && rdsTextAdress0A < 4)
789 {
790 getNext2Block(&rds_buffer0A[rdsTextAdress0A * 2]);
791 rds_buffer0A[8] = '\0';
792 return rds_buffer0A;
793 }
794 }
795 return NULL;
796}
797
798/**
799 * @ingroup @ingroup GA04
800 *
801 * @brief Gets the Text processed for the 2A group
802 *
803 * @return char* string with the Text of the group A2
804 */
806{
807 static int rdsTextAdress2A;
808 rds_blockb blkb;
809
811
812 blkb.blockB = reg0d->RDSB;
813 rdsTextAdress2A = blkb.group2.address;
814
815 if (blkb.group2.groupType == 2)
816 {
817 // Process group 2A
818 // Decode B block information
819 if (rdsTextAdress2A >= 0 && rdsTextAdress2A < 16)
820 {
821 getNext4Block(&rds_buffer2A[rdsTextAdress2A * 4]);
822 rds_buffer2A[63] = '\0';
823 return rds_buffer2A;
824 }
825 }
826 return NULL;
827}
828
829/**
830 * @ingroup GA04
831 * @brief Gets the Text processed for the 2B group
832 * @return char* string with the Text of the group AB
833 */
835{
836 static int rdsTextAdress2B;
837 rds_blockb blkb;
838
840 blkb.blockB = reg0d->RDSB;
841 if (blkb.group2.groupType == 2)
842 {
843 // Process group 2B
844 rdsTextAdress2B = blkb.group2.address;
845 if (rdsTextAdress2B >= 0 && rdsTextAdress2B < 16)
846 {
847 getNext2Block(&rds_buffer2B[rdsTextAdress2B * 2]);
848 return rds_buffer2B;
849 }
850 }
851 return NULL;
852}
853
854/**
855 * @ingroup GA04
856 * @todo Need to check. It is working on SI4735 and Si4703. Why not here?
857 * @brief Gets the RDS time and date when the Group type is 4
858 * @return char* a string with hh:mm +/- offset
859 */
861{
862 // Under Test and construction
863 // Need to check the Group Type before.
864 rds_date_time dt;
865 word16_to_bytes blk_b, blk_c, blk_d;
866 rds_blockb blkb;
867
869
870 blk_b.raw = blkb.blockB = reg0d->RDSB;
871 blk_c.raw = reg0e->RDSC;
872 blk_d.raw = reg0f->RDSD;
873
874 uint16_t minute;
875 uint16_t hour;
876
877 if (blkb.group0.groupType == 4)
878 {
879 char offset_sign;
880 int offset_h;
881 int offset_m;
882
883 // uint16_t y, m, d;
884
885 dt.raw[4] = blk_b.refined.lowByte;
886 dt.raw[5] = blk_b.refined.highByte;
887
888 dt.raw[2] = blk_c.refined.lowByte;
889 dt.raw[3] = blk_c.refined.highByte;
890
891 dt.raw[0] = blk_d.refined.lowByte;
892 dt.raw[1] = blk_d.refined.highByte;
893
894 // Unfortunately it was necessary to wotk well on the GCC compiler on 32-bit
895 // platforms. See si47x_rds_date_time (typedef union) and CGG “Crosses boundary” issue/features.
896 // Now it is working on Atmega328, STM32, Arduino DUE, ESP32 and more.
897 minute = (dt.refined.minute2 << 2) | dt.refined.minute1;
898 hour = (dt.refined.hour2 << 4) | dt.refined.hour1;
899
900 offset_sign = (dt.refined.offset_sense == 1) ? '+' : '-';
901 offset_h = (dt.refined.offset * 30) / 60;
902 offset_m = (dt.refined.offset * 30) - (offset_h * 60);
903
904 sprintf(rds_time, "%02u:%02u %c%02u:%02u", hour, minute, offset_sign, offset_h, offset_m);
905
906 return rds_time;
907 }
908
909 return NULL;
910}
911
912/**
913 * @ingroup GA04
914 * @brief Get the Rds Sync
915 * @details Returns true if RDS currently synchronized.
916 * @return true or false
917 */
919{
920 getStatus(REG0A);
921 return reg0a->refined.RDSS;
922}
923
924/**
925 * @ingroup GA04
926 * @brief Get the current Block ID
927 * @details 1= the block id of register 0cH,0dH,0eH,0fH is E
928 * @details 0= the block id of register 0cH, 0dH, 0eH,0fH is A, B, C, D
929 * @return 0= the block id of register 0cH, 0dH, 0eH,0fH is A, B, C, D; 1 = the block id of register 0cH,0dH,0eH,0fH is E
930 */
932{
933 getStatus(REG0B);
934 return reg0b->refined.ABCD_E;
935}
936
937/**
938 * @ingroup GA04
939 * @brief Get the current Status of block B
940 *
941 * Block Errors Level of RDS_DATA_1, and is always read as Errors Level of RDS BLOCK B (in RDS mode ) or E (in RBDS mode when ABCD_E flag is 1).
942 * | value | description |
943 * | ----- | ----------- |
944 * | 00 | 0 errors requiring correction |
945 * | 01 | 1~2 errors requiring correction |
946 * | 10 | 3~5 errors requiring correction |
947 * | 11 | 6+ errors or error in checkword, correction not possible |
948 *
949 * **Available only in RDS Verbose mode**
950 *
951 * @return value See table above.
952 */
954{
955 getStatus(REG0B);
956 return reg0b->refined.BLERB;
957}
958
959/**
960 * @ingroup GA04
961 * @brief Returns true when the RDS system has valid information
962 * @details Returns true if RDS currently synchronized; the information are A, B, C and D blocks; and no errors
963 * @return true or false
964 */
966 getStatus(REG0B);
967 return (reg0a->refined.RDSS && reg0b->refined.ABCD_E == 0 && reg0b->refined.BLERB == 0 );
968}
969
970/**
971 * @ingroup GA04
972 * @brief Sets RDS fifo mode enable
973 *
974 * @param value If true, it makes the the fifo mode enable.
975 * @return true or false
976 */
977void RDA5807::setRdsFifo(bool value) {
978 reg04->refined.RDS_FIFO_EN = value;
979 setRegister(REG04,reg04->raw);
980}
981
982/**
983 * @ingroup GA04
984 * @brief Clear RDS fifo
985 *
986 * @param value If true, it makes the the fifo mode enable.
987 * @return true or false
988 */
990{
991 reg04->refined.RDS_FIFO_CLR = 1;
992 setRegister(REG04, reg04->raw);
993}
994
995
996
997
998
999/** @defgroup G05 Tools method
1000 * @details A set of functions used to support other functions
1001*/
1002
1003/**
1004 * @ingroup G05 Covert numbers to char array
1005 * @brief Converts a number to a char array
1006 * @details It is useful to mitigate memory space used by functions like sprintf or othetr generic similar functions
1007 * @details You can use it to format frequency using decimal or tousand separator and also to convert smalm numbers.
1008 *
1009 * @param value value to be converted
1010 * @param strValue char array that will be receive the converted value
1011 * @param len final string size (in bytes)
1012 * @param dot the decimal or tousand separator position
1013 * @param separator symbol "." or ","
1014 * @param remove_leading_zeros if true removes up to two leading zeros (default is true)
1015 */
1016void RDA5807::convertToChar(uint16_t value, char *strValue, uint8_t len, uint8_t dot, uint8_t separator, bool remove_leading_zeros)
1017{
1018 char d;
1019 for (int i = (len - 1); i >= 0; i--)
1020 {
1021 d = value % 10;
1022 value = value / 10;
1023 strValue[i] = d + 48;
1024 }
1025 strValue[len] = '\0';
1026 if (dot > 0)
1027 {
1028 for (int i = len; i >= dot; i--)
1029 {
1030 strValue[i + 1] = strValue[i];
1031 }
1032 strValue[dot] = separator;
1033 }
1034
1035 if (remove_leading_zeros) {
1036 if (strValue[0] == '0')
1037 {
1038 strValue[0] = ' ';
1039 if (strValue[1] == '0')
1040 strValue[1] = ' ';
1041 }
1042 }
1043}
1044
1045
1046/**
1047 * @defgroup GA06 I2S Functions
1048 * @section GA06 I2S
1049 * @details When setting I2S_ENABLE (register 04) bit is high, the RDA5807FP can get the output signals SCK, WS, SD signals from GPIO3, GPIO1 and GPIO2 (I2S master)
1050 */
1051
1052
1053/**
1054 * @ingroup GA06 set I2S
1055 * @brief Configure all parameters for I2S
1056 * @details I2S setup must be enabled
1057 * @details I2S_SW_CNT can be: I2S_WS_STEP_48, I2S_WS_STEP_44_1, I2S_WS_STEP_32, I2S_WS_STEP_24, I2S_WS_STEP_22_05, I2S_WS_STEP_16, I2S_WS_STEP_12, I2S_WS_STEP_11_025 or I2S_WS_STEP_8
1058 *
1059 * @param R_DELY If 1, R channel data delay 1T
1060 * @param L_DELY If 1, L channel data delay 1T
1061 * @param SCLK_O_EDGE If 1, invert sclk output when as master
1062 * @param SW_O_EDGE If 1, invert ws output when as master
1063 * @param I2S_SW_CNT Only valid in master mode. See table above
1064 * @param WS_I_EDGE If 0, use normal ws internally; If 1, inverte ws internally
1065 * @param DATA_SIGNED If 0, I2S output unsigned 16-bit audio data. If 1, I2S output signed 16-bit audio data.
1066 * @param SCLK_I_EDGE If 0, use normal sclk internally;If 1, inverte sclk internally
1067 * @param WS_LR Ws relation to l/r channel; If 0, ws=0 ->r, ws=1 ->l; If 1, ws=0 ->l, ws=1 ->r
1068 * @param SLAVE_MASTER I2S slave or master; 1 = slave; 0 = master
1069 * @param OPEN_MODE Open reserved register mode; 11=open behind registers writing function others: only open behind registers reading function
1070 *
1071 * @see RDA microelectronics RDA5807FP - SINGLE-CHIP BROADCAST FM RADIO TUNER pages 11 and 12
1072 *
1073 * @see setI2SOn
1074 */
1075void 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 ) {
1076 reg06->refined.R_DELY = R_DELY;
1077 reg06->refined.L_DELY = L_DELY;
1078 reg06->refined.SCLK_O_EDGE = SCLK_O_EDGE;
1079 reg06->refined.SW_O_EDGE = SW_O_EDGE;
1080 reg06->refined.I2S_SW_CNT = I2S_SW_CNT;
1081 reg06->refined.WS_I_EDGE = WS_I_EDGE;
1082 reg06->refined.DATA_SIGNED = DATA_SIGNED;
1083 reg06->refined.SCLK_I_EDGE = SCLK_I_EDGE;
1084 reg06->refined.WS_LR = WS_LR;
1085 reg06->refined.SLAVE_MASTER = SLAVE_MASTER;
1086 reg06->refined.OPEN_MODE = OPEN_MODE;
1087
1088 setRegister(REG06,reg06->raw);
1089}
1090
1091
1092
1093/**
1094 * @ingroup GA06 set I2S on or off
1095 * @brief Enable I2S setup
1096 * @details When setting I2S_ENABLE (register 04) bit is high, the RDA5807FP you can get the output signals SCK, WS, SD signals from GPIO3, GPIO1 and GPIO2 (I2S master)
1097 *
1098 * @param value true or false
1099 */
1100void RDA5807::setI2SOn(bool value) {
1101 reg04->refined.I2S_ENABLE = value;
1102 setRegister(REG04,reg04->raw);
1103}
1104
1105
1106/**
1107 * @ingroup GA06 set I2S Slave or Master
1108 * @brief
1109 *
1110 * @param value true or false
1111 */
1112void RDA5807::setI2SMaster(bool value) {
1113 reg06->refined.SLAVE_MASTER = !value;
1114 setRegister(REG06,reg06->raw);
1115}
1116
1117
1118
1119/**
1120 * @ingroup GA06 set I2S STEP/SPEED
1121 * @brief Sets the speed in kbps. You can use the predefined constantes: I2S_WS_STEP_48, I2S_WS_STEP_44_1, I2S_WS_STEP_32,
1122 * @brief I2S_WS_STEP_24, I2S_WS_STEP_22_05, I2S_WS_STEP_16, I2S_WS_STEP_12, I2S_WS_STEP_11_025 or I2S_WS_STEP_8
1123 *
1124 * @param value value
1125 */
1126void RDA5807::setI2SSpeed(uint8_t value) {
1127 reg06->refined.I2S_SW_CNT = value;
1128 setRegister(REG06,reg06->raw);
1129}
1130
1131
1132/**
1133 * @ingroup GA06 set I2S Data Signed
1134 * @brief If 0, I2S output unsigned 16-bit audio data. If 1, I2S output signed 16-bit audio data.
1135 *
1136 * @param value true (1) or false (0)
1137 */
1138void RDA5807::setI2SDataSigned(bool value) {
1139 reg06->refined.DATA_SIGNED = value;
1140 setRegister(REG06,reg06->raw);
1141}
1142
1143
1144
1145
1146/**
1147 * @defgroup GA07 Audio Functions
1148 * @section GA07 Audio
1149 */
1150
1151
1152
1153/**
1154 * @ingroup GA07
1155 * @brief Sets Soft Mute Enable or disable
1156 * @param value true = enable; false=disable
1157 */
1158void RDA5807::setSoftmute(bool value)
1159{
1160 reg04->refined.SOFTMUTE_EN = value;
1161 setRegister(REG04, reg04->raw);
1162}
1163
1164
1165
1166
1167/**
1168 * @ingroup GA07
1169 * @brief Sets Audio mute or unmute
1170 * @param value TRUE = mute; FALSE = unmute
1171 */
1172void RDA5807::setMute(bool value)
1173{
1174 reg02->refined.SEEK = 0;
1175 reg02->refined.DMUTE = !value; // 1 = Normal operation; 0 = Mute
1176 setRegister(REG02,reg02->raw);
1177}
1178
1179/**
1180 * @ingroup GA07
1181 * @brief Sets audio output impedance high ow low
1182 * @param value TRUE = High; FALSE = Low
1183 */
1185{
1186 reg02->refined.SEEK = 0;
1187 reg02->refined.DHIZ = !value; // 0 = High impedance; 1 = Normal operation
1188 setRegister(REG02,reg02->raw);
1189}
1190
1191
1192/**
1193 * @ingroup GA07
1194 * @brief Sets audio Mono or stereo
1195 *
1196 * @param value TRUE = Mono; FALSE force stereo
1197 */
1198void RDA5807::setMono(bool value)
1199{
1200 reg02->refined.SEEK = 0;
1201 reg02->refined.MONO = value;
1202 setRegister(REG02, reg02->raw);
1203}
1204
1205/**
1206 * @ingroup GA07
1207 * @brief Sets Bass Boost
1208 *
1209 * @param value FALSE = Disable; TRUE = Enable
1210 */
1211void RDA5807::setBass(bool value)
1212{
1213 reg02->refined.SEEK = 0;
1214 reg02->refined.BASS = value;
1215 setRegister(REG02, reg02->raw);
1216}
1217
1218/**
1219 * @ingroup GA07
1220 * @brief Gets the current Stereo status
1221 *
1222 * @return TRUE if stereo;
1223 */
1225{
1226 getStatus(REG0A);
1227 return reg0a->refined.ST;
1228}
1229
1230
1231
1232/**
1233 * @ingroup GA07
1234 * @brief Sets the audio volume level
1235 *
1236 * @param value
1237 */
1238void RDA5807::setVolume(uint8_t value)
1239{
1240 if ( value > 15 ) value = 15;
1241
1242 reg05->refined.VOLUME = this->currentVolume = value;
1243 setRegister(REG05, reg05->raw);
1244}
1245
1246/**
1247 * @ingroup GA07
1248 * @brief Gets the current audio volume level
1249 *
1250 * @return uint8_t 0 to 15
1251 */
1253{
1254 return this->currentVolume;
1255}
1256
1257/**
1258 * @ingroup GA07
1259 * @brief Increments the audio volume
1260 *
1261 */
1263{
1264 if (this->currentVolume < 15)
1265 {
1266 this->currentVolume++;
1267 setVolume(this->currentVolume);
1268 }
1269}
1270
1271/**
1272 * @ingroup GA07
1273 * @brief Decrements the audio volume
1274 *
1275 */
1277{
1278 if (this->currentVolume > 0)
1279 {
1280 this->currentVolume--;
1281 setVolume(this->currentVolume);
1282 }
1283}
#define REG02
Definition: RDA5807.h:61
#define REG07
Definition: RDA5807.h:66
#define REG0A
Definition: RDA5807.h:67
#define REG0B
Definition: RDA5807.h:68
#define REG05
Definition: RDA5807.h:64
#define REG04
Definition: RDA5807.h:63
#define REG03
Definition: RDA5807.h:62
#define REG06
Definition: RDA5807.h:65
void convertToChar(uint16_t value, char *strValue, uint8_t len, uint8_t dot, uint8_t separator, bool remove_leading_zeros=true)
Converts a number to a char array.
Definition: RDA5807.cpp:1016
KT0915 Class.
Definition: RDA5807.h:556
void * getStatus(uint8_t reg)
Gets the register content of a given status register (from 0x0A to 0x0F)
Definition: RDA5807.cpp:85
void powerDown()
Power the receiver off.
Definition: RDA5807.cpp:197
void powerUp()
Powers the receiver on.
Definition: RDA5807.cpp:156
void setRegister(uint8_t reg, uint16_t value)
Sets a given value to a specific device register.
Definition: RDA5807.cpp:115
void softReset()
Resets the device.
Definition: RDA5807.cpp:146
void waitAndFinishTune()
Waits for Seek or Tune finish.
Definition: RDA5807.cpp:133
void setNewDemodulateMethod(bool value)
Sets new demodulate method. It can improve the receiver sensitivity about 1dB.
Definition: RDA5807.cpp:188
void getStatusRegisters()
Gets all current device status and RDS information registers (From 0x0A to 0x0F)
Definition: RDA5807.cpp:64
void setup(uint8_t clock_type=CLOCK_32K, uint8_t oscillator_type=OSCILLATOR_TYPE_CRYSTAL)
Starts the device.
Definition: RDA5807.cpp:214
uint16_t getRealFrequency()
Gets the current frequency bases on the current channel.
Definition: RDA5807.cpp:362
uint16_t getRealChannel()
Gets the current channel stored in 0x0A status register.
Definition: RDA5807.cpp:340
void setSeekThreshold(uint8_t value)
Sets RSSI Seek Threshold.
Definition: RDA5807.cpp:441
int getRssi()
Gets the current Rssi.
Definition: RDA5807.cpp:529
void setFrequencyUp()
Increments the current frequency.
Definition: RDA5807.cpp:296
void setFmDeemphasis(uint8_t de)
Sets De-emphasis.
Definition: RDA5807.cpp:554
uint8_t getDeviceId()
Gets the Device identification.
Definition: RDA5807.cpp:542
uint16_t getFrequency()
Gets the current frequency.
Definition: RDA5807.cpp:326
void setGpio(uint8_t gpioPin, uint8_t gpioSetup=0, int mcuPin=-1)
Set the Device GPIO pins.
Definition: RDA5807.cpp:34
void setSoftBlendEnable(bool value)
Sets Soft Blend.
Definition: RDA5807.cpp:238
void setSpace(uint8_t space=0)
Sets the FM channel space.
Definition: RDA5807.cpp:485
void seek(uint8_t seek_mode, uint8_t direction)
Seek function.
Definition: RDA5807.cpp:373
void setBand(uint8_t band=0)
Sets the FM band. See table below.
Definition: RDA5807.cpp:462
void setStep(uint8_t step=100)
Sets the FM Step;.
Definition: RDA5807.cpp:499
void setAFC(bool value)
Sets AFC true or false.
Definition: RDA5807.cpp:249
void setChannel(uint16_t channel)
Sets the channel.
Definition: RDA5807.cpp:268
void setFrequency(uint16_t frequency)
Sets the frequency.
Definition: RDA5807.cpp:284
void setFrequencyDown()
Decrements the current frequency.
Definition: RDA5807.cpp:311
void seek(uint8_t seek_mode, uint8_t direction, void(*showFunc)())
Seek function.
Definition: RDA5807.cpp:413
uint8_t getRdsFlagAB(void)
Returns the current Text Flag A/B
Definition: RDA5807.cpp:617
bool hasRdsInfo()
Returns true when the RDS system has valid information.
Definition: RDA5807.cpp:965
bool getRdsSync()
Get the Rds Sync.
Definition: RDA5807.cpp:918
uint8_t getBlockId()
Get the current Block ID.
Definition: RDA5807.cpp:931
uint16_t getRdsGroupType()
Return the group type.
Definition: RDA5807.cpp:631
void getNext4Block(char *c)
Process data received from group 2A.
Definition: RDA5807.cpp:711
char * getRdsText2A(void)
Gets the Text processed for the 2A group.
Definition: RDA5807.cpp:805
void setRDS(bool value)
Sets the RDS operation.
Definition: RDA5807.cpp:572
char * getRdsText0A(void)
Gets the station name and other messages.
Definition: RDA5807.cpp:776
void getNext2Block(char *c)
Process data received from group 2B.
Definition: RDA5807.cpp:674
char * getRdsText(void)
Gets the RDS Text when the message is of the Group Type 2 version A.
Definition: RDA5807.cpp:750
void clearRdsFifo()
Clear RDS fifo.
Definition: RDA5807.cpp:989
char * getRdsText2B(void)
Gets the Text processed for the 2B group.
Definition: RDA5807.cpp:834
bool getRdsReady()
Returns true if RDS Ready.
Definition: RDA5807.cpp:604
uint8_t getRdsVersionCode(void)
Gets the version code (extracted from the Block B)
Definition: RDA5807.cpp:646
uint8_t getErrorBlockB()
Get the current Status of block B.
Definition: RDA5807.cpp:953
void setRdsFifo(bool value)
Sets RDS fifo mode enable.
Definition: RDA5807.cpp:977
uint8_t getRdsProgramType(void)
Returns the Program Type (extracted from the Block B)
Definition: RDA5807.cpp:660
void setRBDS(bool value)
Sets the RBDS operation.
Definition: RDA5807.cpp:586
char * getRdsTime()
Gets the RDS time and date when the Group type is 4.
Definition: RDA5807.cpp:860
void 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)
Configure all parameters for I2S.
Definition: RDA5807.cpp:1075
void setI2SSpeed(uint8_t value)
Sets the speed in kbps. You can use the predefined constantes: I2S_WS_STEP_48, I2S_WS_STEP_44_1,...
Definition: RDA5807.cpp:1126
void setI2SMaster(bool value)
Definition: RDA5807.cpp:1112
void setI2SDataSigned(bool value)
If 0, I2S output unsigned 16-bit audio data. If 1, I2S output signed 16-bit audio data.
Definition: RDA5807.cpp:1138
void setI2SOn(bool value)
Enable I2S setup.
Definition: RDA5807.cpp:1100
bool isStereo()
Gets the current Stereo status.
Definition: RDA5807.cpp:1224
void setVolume(uint8_t value)
Sets the audio volume level.
Definition: RDA5807.cpp:1238
uint8_t getVolume()
Gets the current audio volume level.
Definition: RDA5807.cpp:1252
void setBass(bool value)
Sets Bass Boost.
Definition: RDA5807.cpp:1211
void setVolumeUp()
Increments the audio volume.
Definition: RDA5807.cpp:1262
void setVolumeDown()
Decrements the audio volume.
Definition: RDA5807.cpp:1276
void setAudioOutputHighImpedance(bool value)
Sets audio output impedance high ow low.
Definition: RDA5807.cpp:1184
void setMono(bool value)
Sets audio Mono or stereo.
Definition: RDA5807.cpp:1198
void setSoftmute(bool value)
Sets Soft Mute Enable or disable.
Definition: RDA5807.cpp:1158
void setMute(bool value)
Sets Audio mute or unmute.
Definition: RDA5807.cpp:1172