PU2CLR AKC695X Arduino Library  1.0.2
This is an Arduino Library to control the AKC695X / M695X DSP radio devices
AKC695X.h
Go to the documentation of this file.
1 /**
2  * @mainpage SI47XX Arduino Library implementation
3  *
4  * This is an Arduino library for the AKC695X, BROADCAST RECEIVER, IC family.
5  * It works with I2C protocol and can provide an easier interface for controlling the AKC695X devices.<br>
6  *
7  * This library was built based on [AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio](http://maximradio.altervista.org/akc6955/AKC6955-datasheet-english.pdf) document from "AKC technology".
8  * Others sources help the author to build this library. They are referenced in the documentation for this library on: https://github.com/pu2clr/AKC695X
9  * It also intend to be used on **all members of the AKC695X family** respecting, of course, the features available for each IC version.
10  *
11  * This library uses the I2C protocols to read and write AKC695X registers. In this context, registers are memory position into the device.
12  * The first 13 registers, you can use to change the behavior of the device. They are read and write registers. The registers from 20 to 27, can be used to get the current device status. They are read only registers.
13  * There is no information about the register 10 and the registers 14 to 19 in the documentation used to develop this library.
14  * By using the registers 0 to 13, you can change the band, set the frequency, set the channel space, set the audio behavior and volume, set a custom band and more.
15  *
16  * This library can be freely distributed using the MIT Free Software model. [Copyright (c) 2019 Ricardo Lima Caratti](https://pu2clr.github.io/AKC695X/#mit-license).
17  * Contact: pu2clr@gmail.com
18  */
19 
20 #include <Arduino.h>
21 #include <Wire.h>
22 
23 #define DEFAUL_I2C_ADDRESS 0x10
24 #define CURRENT_MODE_FM 1
25 #define CURRENT_MODE_AM 0
26 #define CRYSTAL_12MHZ 0
27 #define CRYSTAL_32KHZ 1
28 
29 #define MAX_SEEK_TIME 3000 // Maximum time have to be a seeking process (in ms).
30 
31 /**
32  * @brief AKC695X features
33  * @details the table below shows some features fo the AKC695X devices family
34  *
35  * | Feature | AKC6951 | AKC6955 | AKC6959 |
36  * | --------------------------------------------------------------------------| ------- | ------- | ------- |
37  * | stand by 30 ~ 230MHz Any frequency FM demodulation | X | X | X |
38  * | stand by 0.15 ~ 30MHz Any frequency AM demodulation | X | X | X |
39  * | Preset FM band ( 64 ~ 108 MHz ) | X | X | X |
40  * | stand by TV1 audio( 56.25 ~ 91.75 MHz ) | X | X | X |
41  * | stand by TV2 audio( 174.75 ~ 222.25 MHz ) | X | X | X |
42  * | Presets wave band ( 520 ~ 1730 KHz ) | X | X | X |
43  * | __Preset shortwave band ( 3.2 ~ 21.9 MHz )__ | | X | X |
44  * | Preset long-wave band ( 150 ~ 285 KHz ) | X | X | X |
45  * | Custom support band | X | X | X |
46  * | It supports a wide supply voltage range: 2.0V ~ 4.5V | X | X | X |
47  * | stand by 32.768KHz & 12MHz Passive mode crystal reference clock and Pin | X | X | X |
48  * | Integrated audio amplifier (maximum power differential 0.5W ) | X | X | X |
49  * | Two kinds of control volume: volume potentiometer and the volume register | X | X | X |
50  * | Two kinds of de-emphasis modes: 50us / 75us | X | X | X |
51  * | Support tuning lamp function | X | X | X |
52  * | The audio output may be in phase, may be inverted output | X | X | X |
53  * | Support for stereo line input | X | X | X |
54  * | Support low-power standby mode, 3V When power consumption 10uA | X | X | X |
55  * | Internal integrated PLL | X | X | X |
56  * | Intelligent frequency control | X | X | X |
57  * | AGC | X | X | X |
58  * | Precise digital demodulation | X | X | X |
59  * | Smart mute function | X | X | X |
60  * | SW Increased tracking filter, greatly improving SW Audibility | X | X | X |
61  * | MW Precise tuning adaptive front end | X | X | X |
62  * | FM Subwoofer | X | X | X |
63  * | integrated LDO | X | X | X |
64  * | According to the battery voltage, automatically adjust the volume | X | X | X |
65  * | Pb-free / RoHS complian | X | X | X |
66  */
67 
68 #define AKC595X_I2C_ADRESS 0x10
69 
70 // Read and Write (RW) AKC695X registers
71 #define REG00 0x00
72 #define REG01 0x01
73 #define REG02 0x02
74 #define REG03 0x03
75 #define REG04 0x04
76 #define REG05 0x05
77 #define REG06 0x06
78 #define REG07 0x07
79 #define REG08 0x08
80 #define REG09 0x09
81 #define REG11 0x0B
82 #define REG12 0x0C
83 #define REG13 0x0D
84 // Read only AKC695X registers
85 #define REG20 0x14
86 #define REG21 0x15
87 #define REG22 0x16
88 #define REG23 0x17
89 #define REG24 0x18
90 #define REG25 0x19
91 #define REG26 0x1A
92 #define REG27 0x1B
93 
94 /**
95  * @defgroup GA01 Union, Structure and Defined Data Types
96  * @brief AKC695X Defined Data Types
97  * @details Defined Data Types is a way to represent the AKC695X registers information
98  * @details Some information appears to be inaccurate due to translation problems from Chinese to English.
99  * @details The information shown here was extracted from Datasheet:
100  * @details AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation.
101  * @details Other information seems incomplete even in the original Chinese Datasheet.
102  * @details For example: Reg 10 (0x0A). There is no information about it. The Reg11 and 12 seem wrong
103  */
104 
105 /**
106  * @ingroup GA01
107  * @brief Reg0 (type 0x00 / RW): configures register 0 (default: 0x4c) Address
108  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 11
109  */
110 
111 typedef union {
112  struct
113  {
114  uint8_t rsv : 2; //!< Reserved - Debug use, do not change this value using
115  uint8_t mute : 1; //!< 1 - Mute L / R channel 0 - Normal operation
116  uint8_t seekup : 1; //!< Seek direction control bit. 0 = Seek down; 1 = Seek up
117  uint8_t seek : 1; //!< 0-> 1 Trigger tune process The STC bit is set high when the tune operation completes.
118  uint8_t tune : 1; //!< 0-> 1 Trigger tune process The STC bit is set high when the tune operation completes.
119  uint8_t fm_en : 1; //!< 1 = FM mode; 0 = AM mode
120  uint8_t power_on : 1; //!< 1 = Chip on; 0 = Chip off
121  } refined;
123 } akc595x_reg0;
124 
125 /**
126  * @ingroup GA01
127  * @brief Reg1 (type 0x01 / RW): configures register 1 (default: 0x10) Address
128  *
129  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 12
130  *
131  */
132 typedef union {
133  struct
134  {
135  uint8_t fmband : 3; //!<
136  uint8_t amband : 4; //!<
137  } refined;
139 } akc595x_reg1;
140 
141 /**
142  * @ingroup GA01
143  * @brief Reg2 (type 0x02 / RW): configure register 2 (default: 0x4A) Address
144  *
145  * @details High channel number 5, the channel number and frequencies related as follows:
146  * @details FM mode: Channel Freq = 25kHz * CHAN + 30MHz AM mode, when 5K channel number pattern:.
147  * @details Channel Freq = 5kHz * CHAN AM mode, 3K channel number pattern. when: Channel Freq = 3kHz * CHAN.
148  *
149  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 12
150  *
151  */
152 typedef union {
153  struct
154  {
155  uint8_t channel : 5; //!< (0:4) - 5 most significant bits that represents the channel (see reg3)
156  uint8_t mode3k : 1; //!< (5) - 1 = 3K; 0 = 5K
157  uint8_t ref_32k_mode : 1; //!< (6) - 1 = 32K ref. crystal clock; 0 = 12MHz ref crystal clock
158  uint8_t rsv : 1; //!< (7) - Reserved - Debug use, do not change this value using
159  } refined;
161 } akc595x_reg2;
162 
163 /**
164  * @ingroup GA01
165  * @brief Reg3 (type 0x03 / RW): configures register 3 (default: 0xC8) Address
166  */
167 typedef uint8_t akc595x_reg3; //!< 8 least significant bits representing the channel value (see reg2)
168 
169 /**
170  * @ingroup GA01
171  * @brief Reg4 (type 0x04 / RW): configures register 4 (default: 0x19) Address
172  */
173 typedef uint8_t akc595x_reg4; //!< Custom channel band start number chan = 32 * usr_chan_start
174 
175 /**
176  * @ingroup GA01
177  * @brief Reg5 (type 0x05 / RW): configures register 5 (default: 0x32) Address
178  *
179  */
180 typedef uint8_t akc595x_reg5; //!< Custom end-band channel number chan = 32 * usr_chan_stop
181 
182 /**
183  * @ingroup GA01
184  * @brief Reg6 (type 0x06 / RW): configures register 0 (default: 0xA1) Address
185  */
186 typedef union {
187  struct
188  {
189  uint8_t phase_inv : 1; //!< 0 = audio output inphase, 1 = opposite phase, for single speaker
190  uint8_t line : 1; //!< 0 = Radio mode; 1 = Line Mode
191  uint8_t volume : 6; //!< Volume: 0 ~ 63 (<24 = mute; 24 ~ 63)
192  } refined;
194 } akc595x_reg6;
195 
196 /**
197  * @ingroup GA01
198  * @brief Reg7 (type 0x07 / RW): configures register 0 (default: 0xA1) Address
199  * @details stereo and mono: "00" the auto stereo, there Stereo_th control threshold ; "10" long as the pilot is forced stereo "x1" forced mono demodulator
200  */
201 typedef union {
202  struct
203  {
204  uint8_t bw : 2; //!< 00 = 150K; 01 = 200K; 10 = 50K; 11 = 100K
205  uint8_t stereo_mono : 2; //!< "00" the auto stereo, there Stereo_th control threshold ; "10" long as the pilot is forced stereo "x1" forced mono demodulator
206  uint8_t bben : 1; //!< Base boost enable 0; Close bass 1.
207  uint8_t de : 1; //!< De-emphasis mode. 1 = 75 μ s (USA); 0 = 50 μ s (China)
208  uint8_t rsv : 2; //!< Measured using, set to "0" during normal use
209  } refined;
211 } akc595x_reg7;
212 
213 /**
214  * @ingroup GA01
215  * @brief Reg8 (type 0x08 / RW): configures register 8 (default: 0x58) Address
216  * @details
217  *
218  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 14
219  */
220 typedef union {
221  struct
222  {
223  uint8_t stereo_th : 2; //!< FM stereo demodulation start CNR threshold - 00=4, 01=8, 10=12,11=16
224  uint8_t fd_th : 2; //!<
225  uint8_t am_cnr_th : 2; //!< When AM mode, chip sets and lighting sentence carrier to noise ratio threshold
226  uint8_t fm_cnr_th : 2; //!< When the FM mode, chip sets and lighting sentence carrier to noise. Ratio limit 00-2dB 01-3dB 10-4dB 11-5dB door
227  } refined;
229 } akc595x_reg8;
230 
231 /**
232  * @ingroup GA01
233  * @brief Reg9 (type 0x09 / RW): configure register 9 (default: 0x07) Address
234  * @details
235  *
236  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 14
237  */
238 typedef union {
239  struct
240  {
241  uint8_t iv_en : 1; //!< When low voltage power supply, whether to enter the low-voltage operation mode can
242  uint8_t rsv1 : 1; //!< Reserved. Measured using, do not change this value
243  uint8_t osc_en : 1; //!< Oscillator source selection. 0 = 0-External XO; 1 = 1-Crystal
244  uint8_t pd_adc_vol : 1; //!< 0 = volume potentiometer mode
245  uint8_t rsv2 : 4; //!< Reserved. Measured using, do not change this value
246  } refined;
248 } akc595x_reg9;
249 
250 /**
251  * @ingroup GA01
252  * @brief Reg11 (type 0x0B / RW): configure register 9 (default: 0xE0) Address
253  *
254  * @details Sets FM seek step.
255  * | spece | step |
256  * | ----- | ------ |
257  * | 00 | 25 KHz |
258  * | 01 | 50 KHz |
259  * | 10 | 100 KHz |
260  * | 11 | 200 KHz |
261  *
262  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 14
263  */
264 typedef union {
265  struct
266  {
267  uint8_t rsv1 : 2; //!< Reserved. Measured using, do not change this value
268  uint8_t space : 2; //!< 00 = 25KHz; 01 = 50KHz; 10 = 100KHz; 11 = 200KHz
269  uint8_t rsv2 : 4; //!< Reserved. Measured using, do not change this value
270  } refined;
272 } akc595x_reg11;
273 
274 /**
275  * @ingroup GA01
276  * @brief Reg12 (type 0x0C / RW): configure register 11 (default: 0x??) Address
277  * @details
278  *
279  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 15
280  */
281 typedef union {
282  struct
283  {
284  uint8_t rsv2 : 5; //!< Reserved. Measured using, do not change this value
285  uint8_t pd_rx : 1; //!< 0 = analog and RF; 1 = closed channel
286  uint8_t res : 1; //!<
287  uint8_t pd_adc : 1; //!< Signal channel ADC signal path; 0 = Close; 1 = Open
288  } refined;
290 } akc595x_reg12;
291 
292 /**
293  * @ingroup GA01
294  * @brief Reg13 (type 0x0D / RW): configure register 11 (default: 0x??) Address
295  * @details
296  *
297  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 15
298  */
299 typedef union {
300  struct
301  {
302  uint8_t rsv3 : 2; //!< Measured using, do not change this value
303  uint8_t vol_pre : 2; //!< Adjusting the output volume of the entire values: 00: 0dB 01: 3.5dB
304  uint8_t rsv2 : 2; //!< Measured using, do not change this value
305  uint8_t st_led : 1; //!< 0 = tund pin is tuned lamp; When 1-FM and non wtmode, tund indicator pin is stereo demodulation, tuning lamp remainder
306  uint8_t rsv1 : 1; //!< Measured using, do not change this value
307  } refined;
309 } akc595x_reg13;
310 
311 /**
312  * @ingroup GA01
313  * @brief Reg20 (type 0x14 / R)
314  * @details
315  *
316  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 15
317  */
318 typedef union {
319  struct
320  {
321  uint8_t readchan : 5; //!< Current Channel number (high 5bit). See Reg21
322  uint8_t tuned : 1; //!< When transferred to station 1, station search software can use this determination bit table
323  uint8_t stc : 1; //!< 0 = Not complete; 1 = Complete during Seek and Tune in the register 0.
324  uint8_t st : 1; //!< ??? 0 to the current situation other FM stereo radio ????
325  } refined;
327 } akc595x_reg20;
328 
329 /**
330  * @ingroup GA01
331  * @brief Reg21 (type 0x15 / R)
332  * @details Reg21 is the Current Channel number (low 8bit). See Reg 20.
333  *
334  */
336 
337 /**
338  * @ingroup GA01
339  * @brief Reg22 (type 0x16 / R)
340  * @details
341  *
342  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 15
343  */
344 typedef union {
345  struct
346  {
347  uint8_t cnram : 7; //!< Carrier to noise ratio of the AM signal format, in dB
348  uint8_t mode3k_f : 1; //!< 1 = AM 3K channel spacing; 0 = AM 5K channel spacing
349  } refined;
351 } akc595x_reg22;
352 
353 /**
354  * @ingroup GA01
355  * @brief Reg23 (type 0x17 / R)
356  * @details
357  *
358  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 15
359  */
360 typedef union {
361  struct
362  {
363  uint8_t cnrfm : 7; //!< Carrier to noise ratio of the FM signal format, in dB
364  uint8_t st_dem : 1; //!< Only the demodulated FM stereo (Stereo ratio is greater than 30%) show only one
365  } refined;
367 } akc595x_reg23;
368 
369 /**
370  * @ingroup GA01
371  * @brief Reg24 (type 0x18 / R)
372  * @details
373  *
374  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 15
375  */
376 typedef union {
377  struct
378  {
379  uint8_t lvmode : 1; //!< Low voltage maximum volume limit mode indication bit
380  uint8_t rsv : 1; //!< Reserved.
381  uint8_t pgalevel_if : 3; //!< RF power control loop gain level, the greater the level, a high gain of approximately
382  uint8_t pgalevel_rf : 3; //!< RF power control loop gain level, the greater the level, a high gain of approximately
383  } refined;
385 } akc595x_reg24;
386 
387 /**
388  * @ingroup GA01
389  * @brief Reg25 (type 0x19 / R)
390  * @details
391  *
392  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 15
393  */
394 typedef union {
395  struct
396  {
397  uint8_t vbat : 6; //!< 6 bits indicating the supply voltage ( unsigned number )
398  uint8_t rsv : 2; //!< Reserved
399  } refined;
401 } akc595x_reg25;
402 
403 /**
404  * @ingroup GA01
405  * @brief Reg26 (type 0x1A / R)
406  * @details When the frequency offset indicated, complement format, greater than 127, 256 can be reduced to normal values, attention here to 1KHz units FM, AM in units of 100Hz
407  *
408  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 15
409  */
410 typedef uint8_t akc595x_reg26; //!< When the frequency offset indicated, complement format, greater than 127, 256 can be
411 
412 /**
413  * @ingroup GA01
414  * @brief Reg27 (type 0x1B / R)
415  * @details Antenna aperture can be calculated using signal levels rssi, pgalevel_rf, pgalevel_if
416  * @details FM / SW : Pin (dBuV) = 103 - rssi - 6 * pgalevel_rf - 6 * pgalevel_if
417  * @details MW / LW : Pin (dBuV) = 123 - rssi - 6 * pgalevel_rf - 6 * pgalevel_if
418  *
419  * @see AKC6955 stereo FM / TV / MW / SW / LW digital tuning radio documentation; page 15
420  */
421 typedef union {
422  struct
423  {
424  uint8_t rssi : 7; //!< Antenna aperture can be calculated using signal levels rssi.
425  uint8_t rsv : 1; //!< Reserved
426  } refined;
428 } akc595x_reg27;
429 
430 /**
431  * @defgroup GA02 AKC695X Class
432  * @brief AKC695X Class
433  * @details This class implements all functions to help you to control the AKC695X devices.
434  *
435  * @author PU2CLR - Ricardo Lima Caratti
436  */
437 
438 class AKC695X
439 {
440 
441 protected:
443  int resetPin = -1;
444 
445  uint8_t volume; //!< Store the current volume
446  uint16_t currentStep; //!< Strore the current step
447  uint16_t currentFrequency; //!< Store the current frequency
448  uint8_t currentMode = 0; //!< Store the current mode: 1 = FM; 0 = AM
449  uint8_t currentCrystalType = CRYSTAL_32KHZ; //!< Store the crystal type used: 0 = 12MHz; 1 = 32.768KHz
450  uint8_t currentMode3k = 1; //!< 1 = 3K; 0 = AM
451 
452  // AM current band information
456 
457  // FM current band information
459 
460 public:
461  // Low level functions
462  void reset();
463  void setI2CBusAddress(int deviceAddress);
464 
465  void setup(int reset_pin);
466  void setup(int reset_pin, uint8_t crystal_type);
467 
468  void powerOn(uint8_t fm_en, uint8_t tune, uint8_t mute, uint8_t seek, uint8_t seekup);
469  void setRegister(uint8_t reg, uint8_t parameter);
471  void setCrystalType(uint8_t crystal);
472 
473  bool isTuned();
474  bool isTuningComplete();
475 
476  void setFmEmphasis(uint8_t de);
477  void setFmStereoMono(uint8_t value);
478  void setFmBandwidth(uint8_t value);
479 
483 
486  bool isFmStereo();
488 
489  void setFM(uint8_t akc695x_fm_band, uint16_t minimum_freq, uint16_t maximum_freq, uint16_t default_frequency, uint8_t default_step);
490  void setAM(uint8_t akc695x_am_band, uint16_t minimum_freq, uint16_t maximum_freq, uint16_t default_frequency, uint8_t default_step);
491 
492  void setCustomBand(uint16_t minimum_frequency, uint16_t maximum_frequency);
493 
494  void setStep(uint8_t step);
495 
496  void setFmSeekStep(uint8_t value);
497  void seekStation(uint8_t up_down, void (*showFunc)() = NULL);
498 
499  void setFrequency(uint16_t frequency);
501  void frequencyUp();
502  void frequencyDown();
503 
504  void setAudio(uint8_t phase_inv, uint8_t line, uint8_t volume);
505  void setAudio();
506 
507  void setVolume(uint8_t volume);
508  void setVolumeControl(uint8_t type);
509  void setVolumeUp();
510  void setVolumeDown();
511  inline int getVolume() { return this->volume; };
512 
513  int getRSSI();
514  float getSupplyVoltage();
515 
516  inline uint8_t getCurrentMode() { return this->currentMode; };
517 
518  void commitTune();
519 };
AKC695X::setStep
void setStep(uint8_t step)
Sets the step that will be used to increment and decrement the current frequency.
Definition: AKC695X.cpp:607
AKC695X::setVolume
void setVolume(uint8_t volume)
Sets the output audio volume.
Definition: AKC695X.cpp:827
AKC695X::currentBand
uint8_t currentBand
Definition: AKC695X.h:453
AKC695X::isTuningComplete
bool isTuningComplete()
Gets the Status of seeking or tuning process.
Definition: AKC695X.cpp:204
AKC695X::getCurrentMode
uint8_t getCurrentMode()
Definition: AKC695X.h:516
AKC695X::currentFrequency
uint16_t currentFrequency
Store the current frequency.
Definition: AKC695X.h:447
AKC695X::setup
void setup(int reset_pin, uint8_t crystal_type)
Receiver startup.
Definition: AKC695X.cpp:76
AKC695X::setI2CBusAddress
void setI2CBusAddress(int deviceAddress)
Sets the I2C bus device address.
Definition: AKC695X.cpp:48
AKC695X::isTuned
bool isTuned()
Gets the result of tune processing.
Definition: AKC695X.cpp:190
AKC695X::getAmCurrentSpace
uint8_t getAmCurrentSpace()
Gets the current AM space.
Definition: AKC695X.cpp:299
AKC695X
Definition: AKC695X.h:438
AKC595X_I2C_ADRESS
#define AKC595X_I2C_ADRESS
AKC695X features.
Definition: AKC695X.h:68
AKC695X::getFmCarrierNoiseRatio
uint8_t getFmCarrierNoiseRatio()
Gets the current FM carrier to noise ratio.
Definition: AKC695X.cpp:329
AKC695X::setFrequency
void setFrequency(uint16_t frequency)
Sets the the device to a given frequency.
Definition: AKC695X.cpp:704
akc595x_reg20::raw
uint8_t raw
Definition: AKC695X.h:326
REG07
#define REG07
Definition: AKC695X.h:78
akc595x_reg13::raw
uint8_t raw
Definition: AKC695X.h:308
AKC695X::getRSSI
int getRSSI()
Gets the current RSSI.
Definition: AKC695X.cpp:895
AKC695X::currentBandMinimumFrequency
uint16_t currentBandMinimumFrequency
Definition: AKC695X.h:454
AKC695X::resetPin
int resetPin
Definition: AKC695X.h:443
MAX_SEEK_TIME
#define MAX_SEEK_TIME
Definition: AKC695X.h:29
REG09
#define REG09
Definition: AKC695X.h:80
REG11
#define REG11
Definition: AKC695X.h:81
REG03
#define REG03
Definition: AKC695X.h:74
akc595x_reg8::raw
uint8_t raw
Definition: AKC695X.h:228
REG25
#define REG25
Definition: AKC695X.h:90
REG27
#define REG27
Definition: AKC695X.h:92
AKC695X::setFmEmphasis
void setFmEmphasis(uint8_t de)
Sets de-emphasis.
Definition: AKC695X.cpp:343
AKC695X::setAM
void setAM(uint8_t akc695x_am_band, uint16_t minimum_freq, uint16_t maximum_freq, uint16_t default_frequency, uint8_t default_step)
Sets the AKC695X to AM mode and selects the band.
Definition: AKC695X.cpp:557
REG05
#define REG05
Definition: AKC695X.h:76
akc595x_reg22::raw
uint8_t raw
Definition: AKC695X.h:350
akc595x_reg27::raw
uint8_t raw
Definition: AKC695X.h:427
AKC695X::getSupplyVoltage
float getSupplyVoltage()
Gets the supply voltage.
Definition: AKC695X.cpp:915
AKC695X::currentMode3k
uint8_t currentMode3k
1 = 3K; 0 = AM
Definition: AKC695X.h:450
akc595x_reg11::raw
uint8_t raw
Definition: AKC695X.h:271
AKC695X::setCrystalType
void setCrystalType(uint8_t crystal)
Sets the kind of Crystal.
Definition: AKC695X.cpp:169
akc595x_reg12::raw
uint8_t raw
Definition: AKC695X.h:289
akc595x_reg4
uint8_t akc595x_reg4
Reg4 (type 0x04 / RW): configures register 4 (default: 0x19) Address.
Definition: AKC695X.h:173
akc595x_reg5
uint8_t akc595x_reg5
Reg5 (type 0x05 / RW): configures register 5 (default: 0x32) Address.
Definition: AKC695X.h:180
AKC695X::setFM
void setFM(uint8_t akc695x_fm_band, uint16_t minimum_freq, uint16_t maximum_freq, uint16_t default_frequency, uint8_t default_step)
Sets the AKC695X to FM mode.
Definition: AKC695X.cpp:482
AKC695X::setFmStereoMono
void setFmStereoMono(uint8_t value)
Sets the FM stereo or mono.
Definition: AKC695X.cpp:363
AKC695X::frequencyDown
void frequencyDown()
Subtracts the current step from the current frequency and assign the new frequency.
Definition: AKC695X.cpp:778
akc595x_reg24::raw
uint8_t raw
Definition: AKC695X.h:384
AKC695X::isCurrentModeFM
uint8_t isCurrentModeFM()
Gets the current operation mode;.
Definition: AKC695X.cpp:219
akc595x_reg7::raw
uint8_t raw
Definition: AKC695X.h:210
AKC695X::setVolumeDown
void setVolumeDown()
Decrements the audio volume.
Definition: AKC695X.cpp:855
AKC695X::currentMode
uint8_t currentMode
Store the current mode: 1 = FM; 0 = AM.
Definition: AKC695X.h:448
REG21
#define REG21
Definition: AKC695X.h:86
AKC695X::getVolume
int getVolume()
Definition: AKC695X.h:511
REG24
#define REG24
Definition: AKC695X.h:89
REG23
#define REG23
Definition: AKC695X.h:88
AKC695X::seekStation
void seekStation(uint8_t up_down, void(*showFunc)()=NULL)
Seeks a FM station.
Definition: AKC695X.cpp:657
akc595x_reg3
uint8_t akc595x_reg3
Reg3 (type 0x03 / RW): configures register 3 (default: 0xC8) Address.
Definition: AKC695X.h:167
AKC695X::setVolumeControl
void setVolumeControl(uint8_t type)
Sets the kind of audio volume control will be used.
Definition: AKC695X.cpp:872
REG04
#define REG04
Definition: AKC695X.h:75
AKC695X::getFrequency
uint16_t getFrequency()
Returns the current frequency value.
Definition: AKC695X.cpp:757
REG22
#define REG22
Definition: AKC695X.h:87
AKC695X::volume
uint8_t volume
Store the current volume.
Definition: AKC695X.h:445
REG02
#define REG02
Definition: AKC695X.h:73
AKC695X::currentStep
uint16_t currentStep
Strore the current step.
Definition: AKC695X.h:446
akc595x_reg1::raw
uint8_t raw
Definition: AKC695X.h:138
akc595x_reg25::raw
uint8_t raw
Definition: AKC695X.h:400
AKC695X::isFmStereo
bool isFmStereo()
Gets the current FM stereo status.
Definition: AKC695X.cpp:314
CRYSTAL_32KHZ
#define CRYSTAL_32KHZ
Definition: AKC695X.h:27
AKC695X::currentCrystalType
uint8_t currentCrystalType
Store the crystal type used: 0 = 12MHz; 1 = 32.768KHz.
Definition: AKC695X.h:449
AKC695X::setup
void setup(int reset_pin)
Receiver startup.
Definition: AKC695X.cpp:92
akc595x_reg21
uint8_t akc595x_reg21
Reg21 (type 0x15 / R)
Definition: AKC695X.h:335
AKC695X::setFmBandwidth
void setFmBandwidth(uint8_t value)
Sets the FM Bandwidth
Definition: AKC695X.cpp:385
AKC695X::frequencyUp
void frequencyUp()
Adds the current step to the current frequency and sets the new frequency.
Definition: AKC695X.cpp:767
AKC695X::deviceAddress
int deviceAddress
Definition: AKC695X.h:442
AKC695X::reset
void reset()
Resets the system.
Definition: AKC695X.cpp:29
REG01
#define REG01
Definition: AKC695X.h:72
AKC695X::powerOn
void powerOn(uint8_t fm_en, uint8_t tune, uint8_t mute, uint8_t seek, uint8_t seekup)
Power the device on.
Definition: AKC695X.cpp:108
CURRENT_MODE_FM
#define CURRENT_MODE_FM
Definition: AKC695X.h:24
AKC695X::setCustomBand
void setCustomBand(uint16_t minimum_frequency, uint16_t maximum_frequency)
Sets the start and end frequencies for a custom band.
Definition: AKC695X.cpp:436
AKC695X::setFmSeekStep
void setFmSeekStep(uint8_t value)
Sets FM step for seeking.
Definition: AKC695X.cpp:629
AKC695X::setAudio
void setAudio(uint8_t phase_inv, uint8_t line, uint8_t volume)
Configures the audio output.
Definition: AKC695X.cpp:794
AKC695X::getRegister
uint8_t getRegister(uint8_t reg)
Gets a given register content.
Definition: AKC695X.cpp:147
akc595x_reg9::raw
uint8_t raw
Definition: AKC695X.h:247
AKC695X::getCurrentChannel
uint16_t getCurrentChannel()
Gets the current channel.
Definition: AKC695X.cpp:233
REG00
#define REG00
Definition: AKC695X.h:71
AKC695X::fmCurrentBand
uint8_t fmCurrentBand
Definition: AKC695X.h:458
AKC695X::commitTune
void commitTune()
Sets the STC bit to high when the tune operation completes.
Definition: AKC695X.cpp:404
AKC695X::currentBandMaximumFrequency
uint16_t currentBandMaximumFrequency
Definition: AKC695X.h:455
AKC695X::channelToFrequency
uint16_t channelToFrequency()
Converts the channel stored in the registers 20 and 21 to frequency.
Definition: AKC695X.cpp:257
REG20
#define REG20
Definition: AKC695X.h:85
akc595x_reg6::raw
uint8_t raw
Definition: AKC695X.h:193
akc595x_reg26
uint8_t akc595x_reg26
Reg26 (type 0x1A / R)
Definition: AKC695X.h:410
REG06
#define REG06
Definition: AKC695X.h:77
AKC695X::setRegister
void setRegister(uint8_t reg, uint8_t parameter)
Sets a given register with a given value.
Definition: AKC695X.cpp:131
akc595x_reg0::raw
uint8_t raw
Definition: AKC695X.h:122
akc595x_reg23::raw
uint8_t raw
Definition: AKC695X.h:366
AKC695X::setVolumeUp
void setVolumeUp()
Increments the audio volume.
Definition: AKC695X.cpp:844
akc595x_reg2::raw
uint8_t raw
Definition: AKC695X.h:160
AKC695X::getAmCarrierNoiseRatio
uint8_t getAmCarrierNoiseRatio()
Gets the current AM carrier to noise ratio.
Definition: AKC695X.cpp:284
AKC695X::setAudio
void setAudio()
Configures the audio output with default values.
Definition: AKC695X.cpp:813