|
PU2CLR KT0915 Arduino Library
1.0.1
This is an Arduino Library to control the KT0915 device
|
Classes | |
| union | kt09xx_chip_id |
| 3.10.1. CHIP ID (Address 0x01) More... | |
| union | kt09xx_seek |
| 3.10.2. SEEK (Address 0x02) More... | |
| struct | kt09xx_seek.refined |
| union | kt09xx_tune |
| 3.10.3. TUNE (Address 0x03) More... | |
| struct | kt09xx_tune.refined |
| union | kt09xx_volume |
| 3.10.4. VOLUME (Address 0x04) More... | |
| struct | kt09xx_volume.refined |
| union | kt09xx_dspcfga |
| 3.10.5. DSPCFGA (Address 0x05) More... | |
| struct | kt09xx_dspcfga.refined |
| union | kt09xx_locfga |
| 3.10.6. LOCFGA (Address 0x0A) More... | |
| struct | kt09xx_locfga.refined |
| union | kt09xx_locfgc |
| 3.10.7. LOCFGC (Address 0x0C) More... | |
| struct | kt09xx_locfgc.refined |
| union | kt09xx_rxcfg |
| 3.10.8. RXCFG (Address 0x0F) More... | |
| struct | kt09xx_rxcfg.refined |
| union | kt09xx_statusa |
| 3.10.19. STATUSA (Address 0x12) More... | |
| struct | kt09xx_statusa.refined |
| union | kt09xx_statusb |
| 3.10.10. STATUSB (Address 0x13) More... | |
| struct | kt09xx_statusb.refined |
| union | kt09xx_statusc |
| 3.10.11. STATUSC (Address 0x14) More... | |
| struct | kt09xx_statusc.refined |
| union | kt09xx_amsyscfg |
| 3.10.12. AMSYSCFG (Address 0x16) More... | |
| struct | kt09xx_amsyscfg.refined |
| union | kt09xx_amchan |
| 3.10.13. AMCHAN (Address 0x17) More... | |
| struct | kt09xx_amchan.refined |
| union | kt09xx_amcali |
| 3.10.14. AMCALI (Address 0x18) More... | |
| struct | kt09xx_amcali.refined |
| union | kt09xx_gpiocfg |
| 3.10.15. GPIOCFG (Address 0x1D) More... | |
| struct | kt09xx_gpiocfg.refined |
| union | kt09xx_amdsp |
| 3.10.16. AMDSP (Address 0x22) More... | |
| struct | kt09xx_amdsp.refined |
| union | kt09xx_amdstatusa |
| 3.10.17. AMSTATUSA (Address 0x24) More... | |
| struct | kt09xx_amdstatusa.refined |
| union | kt09xx_amdstatusb |
| 3.10.18. AMSTATUSB (Address 0x25) More... | |
| struct | kt09xx_amdstatusb.refined |
| union | kt09xx_softmute |
| 3.10.19. SOFTMUTE (Address 0x2Eh) More... | |
| struct | kt09xx_softmute.refined |
| union | kt09xx_userstartch |
| 3.10.20. USERSTARTCH (Address 0x2F) More... | |
| struct | kt09xx_userstartch.refined |
| union | kt09xx_userguard |
| 3.10.21. USERGUARD (Address 0x30) More... | |
| struct | kt09xx_userguard.refined |
| union | kt09xx_userchannum |
| 3.10.22. USERCHANNUM (Address 0x31) More... | |
| struct | kt09xx_userchannum.refined |
| union | kt09xx_amcfg |
| 3.10.23. AMCFG (Address 0x33) More... | |
| union | kt09xx_amcfg2 |
| 3.10.24. AMCFG2 (Address 0x34h) More... | |
| struct | kt09xx_amcfg2.refined |
| struct | kt09xx_amcfg.refined |
| union | kt09xx_afc |
| 3.10.25. AFC (Address 0x3Ch) More... | |
| struct | kt09xx_afc.refined |
| union | word16_to_bytes |
| Converts 16 bits word to two bytes. More... | |
| struct | word16_to_bytes.refined |
| class | KT0915 |
| KT0915 Class. More... | |
KT0915 Defined Data Types
Defined Data Types is a way to represent the KT0915 registers information
Some information appears to be inaccurate due to translation problems from Chinese to English.
The information shown here was extracted from Datasheet:
KT0915 stereo FM / TV / MW / SW / LW digital tuning radio documentation.
Other information seems incomplete even in the original Chinese Datasheet.
For example: Reg 10 (0x0A). There is no information about it. The Reg11 and 12 seem wrong
| union kt09xx_chip_id |
| union kt09xx_seek |
3.10.2. SEEK (Address 0x02)
| Class Members | ||
|---|---|---|
| struct kt09xx_seek | refined | |
| uint16_t | raw | |
| struct kt09xx_seek.refined |
| union kt09xx_tune |
3.10.3. TUNE (Address 0x03)
| Class Members | ||
|---|---|---|
| struct kt09xx_tune | refined | |
| uint16_t | raw | |
| struct kt09xx_tune.refined |
| union kt09xx_volume |
3.10.4. VOLUME (Address 0x04)
| Class Members | ||
|---|---|---|
| struct kt09xx_volume | refined | |
| uint16_t | raw | |
| struct kt09xx_volume.refined |
| union kt09xx_dspcfga |
3.10.5. DSPCFGA (Address 0x05)
| Class Members | ||
|---|---|---|
| struct kt09xx_dspcfga | refined | |
| uint16_t | raw | |
| struct kt09xx_dspcfga.refined |
| union kt09xx_locfga |
3.10.6. LOCFGA (Address 0x0A)
| Class Members | ||
|---|---|---|
| struct kt09xx_locfga | refined | |
| uint16_t | raw | |
| struct kt09xx_locfga.refined |
| union kt09xx_locfgc |
3.10.7. LOCFGC (Address 0x0C)
| Class Members | ||
|---|---|---|
| struct kt09xx_locfgc | refined | |
| uint16_t | raw | |
| struct kt09xx_locfgc.refined |
| union kt09xx_rxcfg |
3.10.8. RXCFG (Address 0x0F)
| Class Members | ||
|---|---|---|
| struct kt09xx_rxcfg | refined | |
| uint16_t | raw | |
| struct kt09xx_rxcfg.refined |
| union kt09xx_statusa |
3.10.19. STATUSA (Address 0x12)
| Class Members | ||
|---|---|---|
| struct kt09xx_statusa | refined | |
| uint16_t | raw | |
| struct kt09xx_statusa.refined |
| union kt09xx_statusb |
3.10.10. STATUSB (Address 0x13)
| Class Members | ||
|---|---|---|
| struct kt09xx_statusb | refined | |
| uint16_t | raw | |
| struct kt09xx_statusb.refined |
| union kt09xx_statusc |
3.10.11. STATUSC (Address 0x14)
| Class Members | ||
|---|---|---|
| struct kt09xx_statusc | refined | |
| uint16_t | raw | |
| struct kt09xx_statusc.refined |
| union kt09xx_amsyscfg |
3.10.12. AMSYSCFG (Address 0x16)
The table below shows REFCLK possibvle values
Crystal type table
| Dec | binary | Description | defined constant |
|---|---|---|---|
| 0 | 0000 | 32.768KHz | OSCILLATOR_32KHZ |
| 1 | 0001 | 6.5MHz | OSCILLATOR_6_5MHZ |
| 2 | 0010 | 7.6MHz | OSCILLATOR_7_6MHZ |
| 3 | 0011 | 12MHz | OSCILLATOR_12MHZ |
| 4 | 0100 | 13MHz | OSCILLATOR_13MHZ |
| 5 | 0101 | 15.2MHz | OSCILLATOR_15_2MHZ |
| 6 | 0110 | 19.2MHz | OSCILLATOR_19_2MHZ |
| 7 | 0111 | 24MHz | OSCILLATOR_24MHZ |
| 8 | 1000 | 26MHz | OSCILLATOR_26MHZ |
| 9 | 1001 | ?? 38KHz ?? | OSCILLATOR_38KHz |
| Class Members | ||
|---|---|---|
| struct kt09xx_amsyscfg | refined | |
| uint16_t | raw | |
| struct kt09xx_amsyscfg.refined |
| union kt09xx_amchan |
3.10.13. AMCHAN (Address 0x17)
| Class Members | ||
|---|---|---|
| struct kt09xx_amchan | refined | |
| uint16_t | raw | |
| struct kt09xx_amchan.refined |
| union kt09xx_amcali |
3.10.14. AMCALI (Address 0x18)
| Class Members | ||
|---|---|---|
| struct kt09xx_amcali | refined | |
| uint16_t | raw | |
| struct kt09xx_amcali.refined |
| union kt09xx_gpiocfg |
3.10.15. GPIOCFG (Address 0x1D)
| Class Members | ||
|---|---|---|
| struct kt09xx_gpiocfg | refined | |
| uint16_t | raw | |
| struct kt09xx_gpiocfg.refined |
| union kt09xx_amdsp |
3.10.16. AMDSP (Address 0x22)
| Class Members | ||
|---|---|---|
| struct kt09xx_amdsp | refined | |
| uint16_t | raw | |
| struct kt09xx_amdsp.refined |
| union kt09xx_amdstatusa |
3.10.17. AMSTATUSA (Address 0x24)
| Class Members | ||
|---|---|---|
| struct kt09xx_amdstatusa | refined | |
| uint16_t | raw | |
| struct kt09xx_amdstatusa.refined |
| union kt09xx_amdstatusb |
3.10.18. AMSTATUSB (Address 0x25)
| Class Members | ||
|---|---|---|
| struct kt09xx_amdstatusb | refined | |
| uint16_t | raw | |
| struct kt09xx_amdstatusb.refined |
| union kt09xx_softmute |
3.10.19. SOFTMUTE (Address 0x2Eh)
| Class Members | ||
|---|---|---|
| struct kt09xx_softmute | refined | |
| uint16_t | raw | |
| struct kt09xx_softmute.refined |
| union kt09xx_userstartch |
3.10.20. USERSTARTCH (Address 0x2F)
| Class Members | ||
|---|---|---|
| struct kt09xx_userstartch | refined | |
| uint16_t | raw | |
| struct kt09xx_userstartch.refined |
| union kt09xx_userguard |
3.10.21. USERGUARD (Address 0x30)
| Class Members | ||
|---|---|---|
| struct kt09xx_userguard | refined | |
| uint16_t | raw | |
| struct kt09xx_userguard.refined |
| union kt09xx_userchannum |
3.10.22. USERCHANNUM (Address 0x31)
| Class Members | ||
|---|---|---|
| struct kt09xx_userchannum | refined | |
| uint16_t | raw | |
| struct kt09xx_userchannum.refined |
| union kt09xx_amcfg |
3.10.23. AMCFG (Address 0x33)
| Class Members | ||
|---|---|---|
| struct kt09xx_amcfg | refined | |
| uint16_t | raw | |
| union kt09xx_amcfg2 |
3.10.24. AMCFG2 (Address 0x34h)
| Class Members | ||
|---|---|---|
| struct kt09xx_amcfg2 | refined | |
| uint16_t | raw | |
| struct kt09xx_amcfg2.refined |
| struct kt09xx_amcfg.refined |
| union kt09xx_afc |
3.10.25. AFC (Address 0x3Ch)
| Class Members | ||
|---|---|---|
| struct kt09xx_afc | refined | |
| uint16_t | raw | |
| struct kt09xx_afc.refined |
| union word16_to_bytes |
| Class Members | ||
|---|---|---|
| struct word16_to_bytes | refined | |
| uint16_t | raw | |
| struct word16_to_bytes.refined |
| class KT0915 |
Public Member Functions | |
| void | setRegister (int reg, uint16_t parameter) |
| Sets the a value to a given KT09XX register. More... | |
| uint16_t | getRegister (int reg) |
| Gets a given KT09XX register content. More... | |
| uint16_t | getDeviceId () |
| Gets the Device Id. More... | |
| void | enable (uint8_t on_off) |
| Sets the enable pin (9) of the KT0915 high or low. More... | |
| void | setI2CBusAddress (int deviceAddress) |
| Set I2C bus address. More... | |
| void | setReferenceClockType (uint8_t crystal, uint8_t ref_clock=0) |
| Sets the Crystal Type. More... | |
| bool | isCrystalReady () |
| Gets the Crystal Status information. More... | |
| void | setup (int enable_pin, uint8_t oscillator_type=OSCILLATOR_32KHZ, uint8_t ref_clock=REF_CLOCK_DISABLE) |
| Receiver startup. More... | |
| void | setKeyMode (uint8_t value) |
| Key Mode setup. More... | |
| void | setKeyControl (uint8_t audioControl, uint8_t channelControl) |
| Sets the Audio and Channel Key Control. More... | |
| void | setTuneDialModeOn (uint32_t minimu_frequency, uint32_t maximum_frequency) |
| Sets Tune Dial Mode Interface On More... | |
| void | setTuneDialModeOff () |
| Turns the Tune Dial Mode interface Off. More... | |
| void | setVolumeDialModeOn () |
| Sets Volume Dial Mode Interface On. More... | |
| void | setVolumeDialModeOff () |
| Turns the Volume Dial Mode interface Off. More... | |
| void | setAudioGain (uint8_t gain) |
| Audio Gain. More... | |
| void | setLeftChannelInverseControl (uint8_t enable_disable) |
| Sets the Left Channel Inverse Control. More... | |
| void | setVolume (uint8_t value) |
| Sets the audio volume level. More... | |
| void | setVolumeUp () |
| Increases the audio volume. More... | |
| void | setVolumeDown () |
| Decreases the audio volume. More... | |
| uint8_t | getVolume () |
| Returns the current audio volume. More... | |
| void | setSoftMute (bool value) |
| AM and FM Softmute control. More... | |
| void | setSoftmuteAttenuation (uint8_t value) |
| Sets Softmute Attenuation. More... | |
| void | setSoftmuteAttack (uint8_t value) |
| Sets Softmute Attack/Recover Rate. More... | |
| void | setAmSoftmuteStartLevel (uint8_t value) |
| Sets AM Softmute Start Level. More... | |
| void | setFmSoftmuteStartLevel (uint8_t value) |
| Sets FM Softmute Start Level. More... | |
| void | setSoftmuteTagertVolume (uint8_t value) |
| Sets Softmute Target Volume. More... | |
| void | setSoftmuteModeSelection (uint8_t value) |
| Sets Softmute Selection RSSI or SNR. More... | |
| void | setAudioBass (uint8_t bass) |
| Sets the bass level. More... | |
| void | setAudioAntiPop (uint8_t value) |
| Sets Audio DAC Anti-pop Configuration. More... | |
| void | setAudioMute (uint8_t mute_on_off) |
| Sets the output audio mute. More... | |
| void | setDeEmphasis (uint8_t value) |
| Sets the De-emphasis Time Constant Selection. More... | |
| void | setMono (bool on_off) |
| Sets the receiver Stereo or Mono. More... | |
| void | setFmAfc (bool value) |
| Sets FM AFC Disable Control. More... | |
| void | setAmAfc (bool value) |
| Sets AM AFC Disable Control. More... | |
| void | setFM (uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step) |
| Sets the receiver to FM mode. More... | |
| void | setFmSpace (uint8_t value) |
| Sets the FM Space. More... | |
| void | setAM (uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step, uint8_t am_space=0) |
| Sets the receiver to AM mode. More... | |
| void | setAmSpace (uint8_t value) |
| Sets the AM Space. More... | |
| void | setAmBandwidth (uint8_t value) |
| Sets AM Channel Bandwidth Selection. More... | |
| uint8_t | getAmBandwidth () |
| Gets current AM Channel Bandwidth Selection. More... | |
| bool | isFmStereo () |
| Return true if the stereo indicator is set to 3;. More... | |
| void | setFrequency (uint32_t frequency) |
| Sets the current frequency. More... | |
| void | setStep (uint16_t step) |
| Sets the frequency step. More... | |
| void | frequencyUp () |
| Increments the frequency one step. More... | |
| void | frequencyDown () |
| Decrements the frequency one step. More... | |
| void | setFrequencyUp () |
| void | setFrequencyDown () |
| uint32_t | getFrequency () |
| Gets the current frequency. More... | |
| uint16_t | getFmCurrentChannel () |
| Gets the FM Channel Setting. More... | |
| uint16_t | getAmCurrentChannel () |
| Gets the current AM Channel Setting. More... | |
| void | seekStation () |
| Should Seek a station. More... | |
| uint8_t | getCurrentMode () |
| int | getFmRssi () |
| Gets the current FM RSSI. More... | |
| int | getAmRssi () |
| Gets the current AM RSSI More... | |
| int | getFmSnr () |
| Gets current SNR value. More... | |
Protected Attributes | |
| int | deviceAddress = KT0915_I2C_ADDRESS |
| int | enablePin = -1 |
| uint8_t | currentAmSpace = 0 |
| uint8_t | currentFmSpace = 2 |
| uint16_t | currentStep |
| Stores the current step. More... | |
| uint32_t | currentFrequency |
| Stores the current frequency. More... | |
| uint32_t | minimumFrequency |
| Stores the minimum frequency for the current band. More... | |
| uint32_t | maximumFrequency |
| Stores the maximum frequency for the current band. More... | |
| uint8_t | currentMode |
| Stores the current mode. More... | |
| uint8_t | currentRefClockType = OSCILLATOR_32KHZ |
| Stores the crystal type. More... | |
| uint8_t | currentRefClockEnabled = REF_CLOCK_DISABLE |
| Strores 0 = Crystal; 1 = Reference clock. More... | |
| uint8_t | currentDialMode = DIAL_MODE_OFF |
| Stores the default Dial Mode (OFF) More... | |
| uint16_t | deviceId |
| uint8_t | currentVolume = 15 |
| void KT0915::setAudioMute | ( | uint8_t | mute_on_off | ) |
Sets the output audio mute.
| mute_on_off | 1 = mute; 0 unmute |
Definition at line 398 of file KT0915.cpp.
|
inline |
Definition at line 601 of file KT0915.h.
References frequencyUp().
|
inline |
Definition at line 602 of file KT0915.h.
References frequencyDown().
|
protected |
Definition at line 524 of file KT0915.h.
Referenced by setI2CBusAddress().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |