PU2CLR KT0915 Arduino Library  1.0.1
This is an Arduino Library to control the KT0915 device
KT0915.cpp
Go to the documentation of this file.
1 /**
2  * @brief PU2CLR KT0915 Arduino Library
3  * @details KT0915 Arduino Library implementation. This is an Arduino library for the KT0915, BROADCAST RECEIVER.
4  * @details It works with I2C protocol and can provide an easier interface to control the KT0915 device.<br>
5  * @details This library was built based on KT0915 Datasheet from KTMicro (Monolithic Digital FM/MW/SW/LW Receiver Radio-on-a-Chip TM).
6  * @details This library can be freely distributed using the MIT Free Software model.
7  * @copyright Copyright (c) 2020 Ricardo Lima Caratti.
8  * @author Ricardo LIma Caratti (pu2clr@gmail.com)
9  */
10 
11 #include <KT0915.h>
12 
13 /**
14  * @defgroup GA03 Basic Methods
15  * @section GA03 Basic
16  * @details Low level functions used to operate with the KT09XX registers
17  */
18 
19 /**
20  * @ingroup GA03
21  * @todo check the real i2c address
22  * @brief Set I2C bus address
23  *
24  * @param deviceAddress I2C address
25  */
26 void KT0915::setI2CBusAddress(int deviceAddress)
27 {
28  this->deviceAddress = deviceAddress;
29 }
30 
31 /**
32  * @ingroup GA03
33  * @brief Sets the a value to a given KT09XX register
34  *
35  * @param reg register number to be written (0x1 ~ 0x3C) - See #define REG_ in KT0915.h
36  * @param parameter content you want to store
37  */
38 void KT0915::setRegister(uint8_t reg, uint16_t parameter) {
39 
40  word16_to_bytes param;
41 
42  param.raw = parameter;
43 
44  Wire.beginTransmission(this->deviceAddress);
45  Wire.write(reg);
46  Wire.write(param.refined.highByte);
47  delay(5);
48  Wire.write(param.refined.lowByte);
49  delay(5);
50  Wire.endTransmission();
51  delayMicroseconds(3000);
52 }
53 
54 /**
55  * @ingroup GA03
56  * @brief Gets a given KT09XX register content
57  * @details It is a basic function to get a value from a given KT0915 device register
58  * @param reg register number to be read (0x1 ~ 0x3C) - See #define REG_ in KT0915.h
59  * @return the register content
60  */
62 
63  word16_to_bytes result;
64 
65  Wire.beginTransmission(this->deviceAddress);
66  Wire.write(reg);
67  Wire.endTransmission();
68  delayMicroseconds(3000);
69  Wire.requestFrom(this->deviceAddress, 2);
70  result.refined.highByte = Wire.read();
71  result.refined.lowByte = Wire.read();
72  delayMicroseconds(3000);
73 
74  return result.raw;
75 }
76 
77 /**
78  * @ingroup GA03
79  * @brief Gets the Device Id
80  * @return uint16_t 16 bits word with the device id number
81  */
83 {
84  this->deviceId = getRegister(REG_CHIP_ID);
85  return this->deviceId;
86 }
87 
88 /**
89  * @brief Gets the Crystal Status information
90  *
91  * @return true
92  * @return false
93  */
95  kt09xx_statusa reg;
96  reg.raw = getRegister(REG_STATUSA);
97  return reg.refined.XTAL_OK;
98 }
99 
100 /**
101  * @ingroup GA03
102  * @brief Sets the Crystal Type
103  * @details Configures the Crystal or reference clock you are using in your circuit.
104  * @details For a low frequency crystal oscillator, selects 32.768KHz or 38KHz crystals.
105  * @details Alternatively, you can use a CMOS level external reference clock may be used by setting
106  * @details the parameter ref_clock to 1 (REF_CLOCK_ENABLE) and setting the reference clock according to the table below.
107 
108  * * Crystal type table
109  * | Dec | binary | Description | defined constant |
110  * | -- | ------ | ----------- | --------------- |
111  * | 0 | 0000 | 32.768KHz | OSCILLATOR_32KHZ |
112  * | 1 | 0001 | 6.5MHz | OSCILLATOR_6_5MHZ |
113  * | 2 | 0010 | 7.6MHz | OSCILLATOR_7_6MHZ |
114  * | 3 | 0011 | 12MHz | OSCILLATOR_12MHZ |
115  * | 4 | 0100 | 13MHz | OSCILLATOR_13MHZ |
116  * | 5 | 0101 | 15.2MHz | OSCILLATOR_15_2MHZ |
117  * | 6 | 0110 | 19.2MHz | OSCILLATOR_19_2MHZ |
118  * | 7 | 0111 | 24MHz | OSCILLATOR_24MHZ |
119  * | 8 | 1000 | 26MHz | OSCILLATOR_26MHZ |
120  * | 9 | 1001 | ?? 38KHz ?? | OSCILLATOR_38KHz |
121  *
122  * @param crystal Reference Clock Selection. See table above.
123  * @param ref_clock 0 = Crystal (default); 1 = Reference clock enabled.
124  */
125 void KT0915::setReferenceClockType(uint8_t crystal, uint8_t ref_clock)
126 {
127  kt09xx_amsyscfg reg;
128  reg.raw = getRegister(REG_AMSYSCFG); // Gets the current value of the register
129  reg.refined.REFCLK = crystal; // Changes just crystal parameter
130  reg.refined.RCLK_EN = ref_clock; // Reference Clock Enable => Crystal
131  setRegister(REG_AMSYSCFG, reg.raw); // Strores the new value to the register
132 
133  this->currentRefClockType = crystal;
134  this->currentRefClockEnabled = ref_clock;
135 }
136 
137 
138 /**
139  * @ingroup GA03
140  * @brief Sets the enable pin (9) of the KT0915 high or low
141  * @details This function can be used to enable (1) and disable (0) the KT0915 device. You have to select a MCU (Arduino) pin for this function.
142  * @details Also, you can set -1 to used this control via circuit.
143  *
144  * @see setup
145  *
146  * @param on_off 1 = enable; 0 = disable
147  */
148 void KT0915::enable( uint8_t on_off)
149 {
150  if (this->enablePin < 0)
151  return;
152  digitalWrite(this->enablePin, on_off);
153  delay(10);
154 }
155 
156 /**
157  * @ingroup GA03
158  * @todo You need to check mechanical Tune features
159  * @brief Sets Tune Dial Mode Interface On
160  * @details This method sets the KT0915 to deal with a mechanical tuning via an external 100K resistor.
161  * @details KT0915 supports a unique Dial Mode (mechanical tuning wheel with a variable resistor) which is
162  * @details enabled by GPIO1 to 2 (10). The dial can be a variable resistor with the tap connected to CH (pin 1).
163  *
164  * @see KT0915; Monolithic Digital FM/MW/SW/LW Receiver Radio on a Chip(TM); pages 19 and 20.
165  *
166  * @param minimu_frequency Start frequency for the user band
167  * @param maximum_frequency Final frequency for the user band
168  */
169 void KT0915::setTuneDialModeOn(uint32_t minimu_frequency, uint32_t maximum_frequency)
170 {
171  kt09xx_amsyscfg reg;
172  kt09xx_gpiocfg gpio;
173  kt09xx_userstartch uf;
174  kt09xx_userguard ug;
175  kt09xx_userchannum uc;
176 
177  reg.raw = getRegister(REG_AMSYSCFG); // Gets the current value from the register
178  reg.refined.USERBAND = this->currentDialMode = DIAL_MODE_ON;
179  setRegister(REG_AMSYSCFG, reg.raw); // Strores the new value in the register
180 
181  gpio.raw = getRegister(REG_GPIOCFG); // Gets the current value from the register
182  gpio.refined.GPIO1 = 2; // Sets Dial Mode interface (pin 1/CH)
183  setRegister(REG_GPIOCFG, gpio.raw); // Stores the new value in the register
184 
185  // TODO: Sets the frequency limits for user and
186 
187  if ( this->currentMode == MODE_AM) {
188  uf.refined.USER_START_CHAN = minimu_frequency;
189  uc.refined.USER_CHAN_NUM = (maximum_frequency - minimu_frequency) / this->currentStep;
190  ug.refined.USER_GUARD = 0x0011;
191  } else {
192  uf.refined.USER_START_CHAN = minimu_frequency / 50;
193  uc.refined.USER_CHAN_NUM = ((maximum_frequency - minimu_frequency) / 50) / this->currentStep;
194  ug.refined.USER_GUARD = 0x001D;
195  }
196 
197  setRegister(REG_USERSTARTCH, uf.raw);
198  setRegister(REG_USERGUARD, ug.raw);
199  setRegister(REG_USERCHANNUM, uc.raw);
200 
201 };
202 
203 /**
204  * @ingroup GA03
205  * @brief Turns the Tune Dial Mode interface Off
206  * @see setTuneDialModeOn
207  * @see KT0915; Monolithic Digital FM/MW/SW/LW Receiver Radio on a Chip(TM); page 20.
208  */
210 {
211  kt09xx_amsyscfg reg;
212  kt09xx_gpiocfg gpio;
213  reg.raw = getRegister(REG_AMSYSCFG); // Gets the current value of the register
214  reg.refined.USERBAND = this->currentDialMode = DIAL_MODE_OFF;
215  setRegister(REG_AMSYSCFG, reg.raw); // Strores the new value to the register
216 
217  gpio.raw = getRegister(REG_GPIOCFG); // Gets the current value of the register
218  gpio.refined.GPIO1 = 0; // Sets MCU (Arduino) control (High Z)
219  setRegister(REG_GPIOCFG, gpio.raw); // Stores the new value in the register
220 }
221 
222 /**
223  * @ingroup GA03
224  * @brief Sets Volume Dial Mode Interface On
225  * @details This method sets the KT0915 to deal with a mechanical volume control via an external 100K resistor.
226  * @details KT0915 supports a unique Dial Mode which is enabled by GPIO2 to 2 (10).
227  * @details The dial can be a variable resistor with the tap connected to VOL (pin 16).
228  *
229  * @see KT0915; Monolithic Digital FM/MW/SW/LW Receiver Radio on a Chip(TM); page 20.
230  */
232 {
233  kt09xx_gpiocfg gpio;
234  gpio.raw = getRegister(REG_GPIOCFG); // Gets the current value from the register
235  gpio.refined.GPIO2 = 2; // Sets Dial Mode interface (pin 16/VOL)
236  setRegister(REG_GPIOCFG, gpio.raw); // Stores the new value in the register
237 };
238 
239 /**
240  * @ingroup GA03
241  * @brief Turns the Volume Dial Mode interface Off
242  * @see setVolumeDialModeOn
243  * @see KT0915; Monolithic Digital FM/MW/SW/LW Receiver Radio on a Chip(TM); page 20.
244  */
246 {
247  kt09xx_gpiocfg gpio;
248  gpio.raw = getRegister(REG_GPIOCFG); // Gets the current value of the register
249  gpio.refined.GPIO2 = 0; // Sets to MCU (Arduino) control (High Z)
250  setRegister(REG_GPIOCFG, gpio.raw); // Stores the new value in the register
251 }
252 
253 /**
254  * @brief Sets the audio volume level
255  * @details This method is used to control the audio volume level. The value 0 mutes the device and 31 sets the device to the maximum volume.
256  * @param volume between 0 and 31.
257  */
258 void KT0915::setVolume(uint8_t volume) {
259  kt09xx_rxcfg rx;
260  if ( volume > 31) return;
261  rx.raw = getRegister(REG_RXCFG);
262  rx.refined.VOLUME = volume;
263  setRegister(REG_RXCFG, rx.raw);
264  this->currentVolume = volume;
265 }
266 
268 {
269  if (this->currentVolume == 31 ) return;
270  setVolume(this->currentVolume + 1);
271 }
273 {
274  if (this->currentVolume == 0) return;
275  setVolume(this->currentVolume - 1);
276 }
277 
278 /**
279  * @ingroup GA03
280  * @brief Receiver startup
281  * @details You have to use this method to configure the way that the device will work. For example: enable and disable device control; oscillator type and reference clock type (crystal or external)
282  * @details The tabe below shows the oscillator frequencies supported by the device.
283  * @details If you omit the crystal type parameter, will be considered 0 (32.768KHz).
284  * @details For a low frequency crystal oscillator, selects 32.768KHz or 38KHz crystals.
285  * @details Alternatively, you can use a CMOS level external reference clock may be used by setting
286  * @details the parameter ref_clock to 1 (REF_CLOCK_ENABLE) and setting the reference clock according to the table below.
287  * @details The code below shows how to use the setup function.
288  * @details the enable_pin parameter sets the way you are controlling the KT0915 pin 9.
289  *
290  * @code
291  * #include <KT0915.h>
292  * #define RESET_PIN 12 // set it to -1 if you want to use the RST pin of your MCU.
293  * KT0915 radio;
294  * void setup() {
295  * // Set the parameter enablePin to -1 if you are controlling the enable status via circuit; Select OSCILLATOR_32KHZ, OSCILLATOR_12MHZ etc
296  * // radio.setup(RESET_PIN); Instead the line below, if you use this line, the crystal type considered will be 32.768KHz.
297  * radio.setup(RESET_PIN, OSCILLATOR_12MHZ, REF_CLOCK_DISABLE );
298  * }
299  * @endcode
300  *
301  * Oscillator frequencies supported
302  * | Dec | binary | Description | defined constant |
303  * | -- | ------ | ----------- | --------------- |
304  * | 0 | 0000 | 32.768KHz | OSCILLATOR_32KHZ |
305  * | 1 | 0001 | 6.5MHz | OSCILLATOR_6_5MHZ |
306  * | 2 | 0010 | 7.6MHz | OSCILLATOR_7_6MHZ |
307  * | 3 | 0011 | 12MHz | OSCILLATOR_12MHZ |
308  * | 4 | 0100 | 13MHz | OSCILLATOR_13MHZ |
309  * | 5 | 0101 | 15.2MHz | OSCILLATOR_15_2MHZ |
310  * | 6 | 0110 | 19.2MHz | OSCILLATOR_19_2MHZ |
311  * | 7 | 0111 | 24MHz | OSCILLATOR_24MHZ |
312  * | 8 | 1000 | 26MHz | OSCILLATOR_26MHZ |
313  * | 9 | 1001 | 38KHz | OSCILLATOR_38KHz |
314  *
315  * @see KT0915; Monolithic Digital FM/MW/SW/LW Receiver Radio on a Chip(TM); 3.6 Crystal and reference clock; page 9.
316  * @see setReferenceClockType
317  *
318  * @param enablePin if >= 0, then you control the device enable or disable status. if -1, you are using the circuit to crontole that.
319  * @param oscillator_type oscillator type. You can use crystal or external clock. See comments and table above.
320  * @param ref_clock set to 0 if you are using crystal (Reference clock disabled - default); set to 1 if you are using an external reference clock.
321  */
322 void KT0915::setup(int enable_pin, uint8_t oscillator_type, uint8_t ref_clock)
323 {
324  this->enablePin = enable_pin;
325  pinMode(this->enablePin, OUTPUT);
326 
327  enable(1);
328 
329  setReferenceClockType(oscillator_type, ref_clock);
330 }
331 
332 /**
333  * @defgroup GA04 Tune Methods
334  * @section GA04 Tune Methods
335  * @details Methods to tune and set the receiver mode
336  */
337 
338 /**
339  * @ingroup GA04
340  * @brief Set AM the Antenna Tune Capacitor
341  * @details Sets a value between 0 and 16383 for AM Antenna Calibration
342  * @param capacitor value between 0 and 16383
343  */
344 void KT0915::setAntennaTuneCapacitor(uint16_t capacitor)
345 {
346  kt09xx_amcali reg;
347  reg.refined.CAP_INDEX = capacitor;
348  setRegister(REG_AMCALI, reg.raw); // Strores the new value to the register
349 };
350 
351 /**
352  * @ingroup GA04
353  * @brief Sets the receiver Stereo or Mono
354  * @details Set this parameter to true to force mono or false to stereo
355  * @param on_off true = mono; fale = stereo
356  */
357 void KT0915::setMono(bool on_off)
358 {
359  kt09xx_dspcfga reg;
360  reg.raw = getRegister(REG_DSPCFGA);
361  reg.refined.MONO = on_off;
362  setRegister(REG_DSPCFGA,reg.raw);
363 }
364 
365 /**
366  * @ingroup GA04
367  * @brief Sets the De-emphasis Time Constant Selection
368  * @param value 0 = 75us; 1 = 50us
369  */
370 void KT0915::setDeEmphasis(uint8_t value)
371 {
372  kt09xx_dspcfga reg;
373  reg.raw = getRegister(REG_DSPCFGA);
374  reg.refined.DE = value;
375  setRegister(REG_DSPCFGA, reg.raw);
376 }
377 
378 /**
379  * @todo Adjust setTuneDialOn()
380  * @ingroup GA04
381  * @brief Sets the receiver to FM mode
382  * @details Configures the receiver on FM mode; Also sets the band limits, defaul frequency and step.
383  *
384  * @param minimum_frequency minimum frequency for the band
385  * @param maximum_frequency maximum frequency for the band
386  * @param default_frequency default freuency
387  * @param step increment and decrement frequency step
388  */
389 void KT0915::setFM(uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step)
390 {
391  kt09xx_amsyscfg reg;
392 
393  // setRegister(0x16, 0b0000000000000010);
394  // setRegister(0x0F, 0b1000100000011001);
395 
396  this->currentStep = step;
397  this->currentFrequency = default_frequency;
398  this->minimumFrequency = minimum_frequency;
399  this->maximumFrequency = maximum_frequency;
400  this->currentMode = MODE_FM;
401 
402  reg.raw = 0;
403  reg.refined.RESERVED1 = 1;
404  reg.refined.AM_FM = MODE_FM;
405  reg.refined.USERBAND = this->currentDialMode;
406  reg.refined.REFCLK = this->currentRefClockType;
407  reg.refined.RCLK_EN = this->currentRefClockEnabled;
408  setRegister(REG_AMSYSCFG, reg.raw); // Stores the new value in the register
409 
410 
411  if (this->currentDialMode == DIAL_MODE_ON)
412  setTuneDialModeOn(minimum_frequency, maximum_frequency);
413  else
414  setFrequency(default_frequency);
415 
416 };
417 
418 /**
419  * @todo Adjust setTuneDialOn()
420  * @ingroup GA04
421  * @brief Sets the receiver to AM mode
422  * @details Configures the receiver on AM mode; Also sets the band limits, defaul frequency and step.
423  *
424  * @param minimum_frequency minimum frequency for the band
425  * @param maximum_frequency maximum frequency for the band
426  * @param default_frequency default freuency
427  * @param step increment and decrement frequency step
428  */
429 void KT0915::setAM(uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step)
430 {
431  kt09xx_amsyscfg reg;
432 
433  this->currentStep = step;
434  this->currentFrequency = default_frequency;
435  this->minimumFrequency = minimum_frequency;
436  this->maximumFrequency = maximum_frequency;
437  this->currentMode = MODE_AM;
438 
439  reg.raw = 0;
440  reg.refined.RESERVED1 = 1;
441  reg.refined.AM_FM = MODE_AM;
442  reg.refined.USERBAND = this->currentDialMode;
443  reg.refined.REFCLK = this->currentRefClockType;
444  reg.refined.RCLK_EN = this->currentRefClockEnabled;
445  setRegister(REG_AMSYSCFG, reg.raw); // Stores the new value in the register
446 
447  if (this->currentDialMode == DIAL_MODE_ON)
448  setTuneDialModeOn(minimum_frequency, maximum_frequency);
449  else
450  setFrequency(default_frequency);
451 }
452 
453 /**
454  * @ingroup GA04
455  * @brief Sets the current frequency
456  *
457  * @param frequency
458  */
459 void KT0915::setFrequency(uint32_t frequency)
460 {
461  kt09xx_amchan reg_amchan;
462  kt09xx_tune reg_tune;
463 
464  if (this->currentMode == MODE_AM)
465  {
466  reg_amchan.refined.AMTUNE = 1; // TODO Check
467  reg_amchan.refined.AMCHAN = frequency;
468  setRegister(REG_AMCHAN,reg_amchan.raw);
469  }
470  else
471  {
472  reg_tune.refined.FMTUNE = 1; // // TODO Check
473  reg_tune.refined.RESERVED = 0;
474  reg_tune.refined.FMCHAN = frequency / 50;
475  setRegister(REG_TUNE, reg_tune.raw);
476  }
477 
478  this->currentFrequency = frequency;
479 }
480 
481 /**
482  * @ingroup GA04
483  * @brief Increments the frequency one step
484  * @details if the frequency plus the step value is greater than the maximum frequency for the band,
485  * @details tne current frequency will be set to minimum frequency.
486  *
487  * @see setFrequency
488  */
490  this->currentFrequency += this->currentStep;
491  if (this->currentFrequency > this->maximumFrequency)
492  this->currentFrequency = this->minimumFrequency;
493 
494  setFrequency(this->currentFrequency);
495 }
496 
497 /**
498  * @ingroup GA04
499  * @brief Decrements the frequency one step
500  * @details if the frequency minus the step value is less than the minimum frequency for the band,
501  * @details tne current frequency will be set to minimum frequency.
502  *
503  * @see setFrequency
504  */
506  this->currentFrequency -= this->currentStep;
507  if (this->currentFrequency < this->minimumFrequency)
508  this->currentFrequency = this->maximumFrequency;
509 
510  setFrequency(this->currentFrequency);
511 };
512 
513 /**
514  * @ingroup GA04
515  * @brief Sets the frequency step
516  * @details Sets increment and decrement frequency
517  * @param step Values: 1, 5, 9, 10, 100, 200 in KHz
518  */
519 void KT0915::setStep(uint16_t step)
520 {
521  this->currentStep = step;
522 }
523 
524 /**
525  * @ingroup GA04
526  * @brief Gets the current frequency
527  * @return frequency in KHz
528  */
530 {
531  return this->currentFrequency;
532 }
KT0915::enable
void enable(uint8_t on_off)
Sets the enable pin (9) of the KT0915 high or low.
Definition: KT0915.cpp:148
KT0915::setVolumeUp
void setVolumeUp()
Definition: KT0915.cpp:267
KT0915::setFM
void setFM(uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step)
Sets the receiver to FM mode.
Definition: KT0915.cpp:389
REG_DSPCFGA
#define REG_DSPCFGA
Definition: KT0915.h:49
REG_GPIOCFG
#define REG_GPIOCFG
Definition: KT0915.h:59
REG_AMCHAN
#define REG_AMCHAN
Definition: KT0915.h:57
KT0915::setAntennaTuneCapacitor
void setAntennaTuneCapacitor(uint16_t capacitor)
Set AM the Antenna Tune Capacitor.
Definition: KT0915.cpp:344
REG_AMSYSCFG
#define REG_AMSYSCFG
Definition: KT0915.h:56
MODE_FM
#define MODE_FM
Definition: KT0915.h:24
REG_USERGUARD
#define REG_USERGUARD
Definition: KT0915.h:65
MODE_AM
#define MODE_AM
Definition: KT0915.h:25
REG_STATUSA
#define REG_STATUSA
Definition: KT0915.h:53
DIAL_MODE_OFF
#define DIAL_MODE_OFF
Definition: KT0915.h:43
KT0915::isCrystalReady
bool isCrystalReady()
Gets the Crystal Status information.
Definition: KT0915.cpp:94
REG_USERCHANNUM
#define REG_USERCHANNUM
Definition: KT0915.h:66
KT0915
KT0915 Class.
Definition: KT0915.h:513
KT0915::setAM
void setAM(uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step)
Sets the receiver to AM mode.
Definition: KT0915.cpp:429
KT0915::setI2CBusAddress
void setI2CBusAddress(int deviceAddress)
Set I2C bus address.
Definition: KT0915.cpp:26
REG_USERSTARTCH
#define REG_USERSTARTCH
Definition: KT0915.h:64
REG_RXCFG
#define REG_RXCFG
Definition: KT0915.h:52
KT0915::setMono
void setMono(bool on_off)
Sets the receiver Stereo or Mono.
Definition: KT0915.cpp:357
KT0915::deviceAddress
int deviceAddress
Definition: KT0915.h:516
KT0915::setStep
void setStep(uint16_t step)
Sets the frequency step.
Definition: KT0915.cpp:519
KT0915::getFrequency
uint32_t getFrequency()
Gets the current frequency.
Definition: KT0915.cpp:529
KT0915::setTuneDialModeOn
void setTuneDialModeOn(uint32_t minimu_frequency, uint32_t maximum_frequency)
Sets Tune Dial Mode Interface On
Definition: KT0915.cpp:169
KT0915::setReferenceClockType
void setReferenceClockType(uint8_t crystal, uint8_t ref_clock=0)
Sets the Crystal Type.
Definition: KT0915.cpp:125
KT0915::getRegister
uint16_t getRegister(uint8_t reg)
Gets a given KT09XX register content.
Definition: KT0915.cpp:61
REG_AMCALI
#define REG_AMCALI
Definition: KT0915.h:58
KT0915::setRegister
void setRegister(uint8_t reg, uint16_t parameter)
Sets the a value to a given KT09XX register.
Definition: KT0915.cpp:38
KT0915::enablePin
int enablePin
Definition: KT0915.h:517
DIAL_MODE_ON
#define DIAL_MODE_ON
Definition: KT0915.h:42
KT0915::setVolumeDown
void setVolumeDown()
Definition: KT0915.cpp:272
KT0915::getDeviceId
uint16_t getDeviceId()
Gets the Device Id.
Definition: KT0915.cpp:82
KT0915::setVolumeDialModeOff
void setVolumeDialModeOff()
Turns the Volume Dial Mode interface Off.
Definition: KT0915.cpp:245
KT0915::frequencyUp
void frequencyUp()
Increments the frequency one step.
Definition: KT0915.cpp:489
KT0915::setVolumeDialModeOn
void setVolumeDialModeOn()
Sets Volume Dial Mode Interface On.
Definition: KT0915.cpp:231
KT0915::setFrequency
void setFrequency(uint32_t frequency)
Sets the current frequency.
Definition: KT0915.cpp:459
KT0915::setDeEmphasis
void setDeEmphasis(uint8_t value)
Sets the De-emphasis Time Constant Selection.
Definition: KT0915.cpp:370
KT0915::setTuneDialModeOff
void setTuneDialModeOff()
Turns the Tune Dial Mode interface Off.
Definition: KT0915.cpp:209
KT0915::frequencyDown
void frequencyDown()
Decrements the frequency one step.
Definition: KT0915.cpp:505
REG_TUNE
#define REG_TUNE
Definition: KT0915.h:47
REG_CHIP_ID
#define REG_CHIP_ID
Definition: KT0915.h:45
KT0915::setVolume
void setVolume(uint8_t value)
Sets the audio volume level.
Definition: KT0915.cpp:258
KT0915::setup
void setup(int enable_pin, uint8_t oscillator_type=OSCILLATOR_32KHZ, uint8_t ref_clock=REF_CLOCK_DISABLE)
Receiver startup.
Definition: KT0915.cpp:322