PU2CLR KT0915 Arduino Library
1.0.1
This is an Arduino Library to control the KT0915 device
|
Go to the documentation of this file.
22 #define KT0915_I2C_ADDRESS 0x35
28 #define OSCILLATOR_32KHZ 0
29 #define OSCILLATOR_6_5MHZ 1
30 #define OSCILLATOR_7_6MHZ 2
31 #define OSCILLATOR_12MHZ 3
32 #define OSCILLATOR_13MHZ 4
33 #define OSCILLATOR_15_2MHZ 5
34 #define OSCILLATOR_19_2MHZ 6
35 #define OSCILLATOR_24MHZ 7
36 #define OSCILLATOR_26MHZ 8
37 #define OSCILLATOR_38KHz 9
39 #define REF_CLOCK_ENABLE 1
40 #define REF_CLOCK_DISABLE 0
42 #define DIAL_MODE_ON 1
43 #define DIAL_MODE_OFF 0
45 #define REG_CHIP_ID 0x01
48 #define REG_VOLUME 0x04
49 #define REG_DSPCFGA 0x05
50 #define REG_LOCFGA 0x0A
51 #define REG_LOCFGC 0x0C
52 #define REG_RXCFG 0x0F
53 #define REG_STATUSA 0x12
54 #define REG_STATUSB 0x13
55 #define REG_STATUSC 0x14
56 #define REG_AMSYSCFG 0x16
57 #define REG_AMCHAN 0x17
58 #define REG_AMCALI 0x18
59 #define REG_GPIOCFG 0x1D
60 #define REG_AMDSP 0x22
61 #define REG_AMSTATUSA 0x24
62 #define REG_AMSTATUSB 0x25
63 #define REG_SOFTMUTE 0x2E
64 #define REG_USERSTARTCH 0x2F
65 #define REG_USERGUARD 0x30
66 #define REG_USERCHANNUM 0x31
67 #define REG_AMCFG 0x33
68 #define REG_AMCFG2 0x34
103 uint16_t RESERVED : 11;
116 uint16_t FMCHAN : 12;
117 uint8_t RESERVED : 3;
131 uint8_t RESERVED1 : 4;
133 uint8_t RESERVED2 : 2;
135 uint8_t RESERVED3 : 3;
137 uint8_t AMDSMUTE : 1;
138 uint8_t FMDSMUTE : 1;
151 uint8_t RESERVED1 : 5;
153 uint8_t RESERVED2 : 2;
155 uint8_t RESERVED3 : 1;
157 uint8_t RESERVED4 : 3;
171 uint8_t RESERVED1 : 8;
173 uint8_t RESERVED2 : 7;
186 uint8_t RESERVED1 : 3;
187 uint8_t CAMPUSBAND_EN : 1;
188 uint16_t RESERVED2 : 12;
202 uint8_t RESERVED1 : 7;
204 uint8_t RESERVED2 : 3;
217 uint8_t RESERVED1 : 3;
221 uint8_t PLL_LOCK : 1;
222 uint8_t RESERVED2 : 2;
237 uint8_t RESERVED1 : 1;
238 uint16_t RDCHAN : 15;
251 uint8_t RESERVED1 : 6;
254 uint8_t RESERVED2 : 1;
255 uint8_t PWSTATUS : 1;
286 uint8_t RESERVED1 : 5;
290 uint8_t RESERVED2 : 1;
291 uint8_t USERBAND : 1;
305 uint16_t AMCHAN : 15;
319 uint16_t CAP_INDEX : 14;
320 uint8_t RESERVED1 : 2;
335 uint16_t RESERVED : 12;
348 uint8_t RESERVED1 : 3;
349 uint8_t INV_LEFT_AUDIO : 1;
350 uint8_t RESERVED2 : 2;
352 uint8_t RESERVED3 : 8;
365 uint8_t RESERVED1 : 8;
367 uint8_t RESERVED2 : 3;
381 uint8_t AM_AFCDELTAF : 8;
382 uint8_t RESERVED : 8;
413 uint16_t USER_START_CHAN : 15;
414 uint8_t RESERVED : 1;
417 } kt09xx_userstartch;
427 uint16_t USER_GUARD : 9;
428 uint8_t RESERVED : 7;
441 uint16_t USER_CHAN_NUM : 12;
442 uint8_t RESERVED : 4;
445 } kt09xx_userchannum;
455 uint8_t RESERVED1 : 5;
456 uint8_t KEY_MODE : 2;
457 uint8_t RESERVED2 : 7;
471 uint8_t RESERVED1 : 1;
474 uint16_t RESERVED2 : 10;
487 uint8_t FM_AFC_DELTAF : 8;
488 uint8_t RESERVED1 : 8;
536 void enable(uint8_t on_off);
554 void setFM(uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step);
555 void setAM(uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step);
void enable(uint8_t on_off)
Sets the enable pin (9) of the KT0915 high or low.
void setFM(uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step)
Sets the receiver to FM mode.
void setAntennaTuneCapacitor(uint16_t capacitor)
Set AM the Antenna Tune Capacitor.
uint8_t currentRefClockType
Stores the crystal type.
#define KT0915_I2C_ADDRESS
uint32_t currentFrequency
Stores the current frequency.
uint8_t currentDialMode
Stores the default Dial Mode (OFF)
bool isCrystalReady()
Gets the Crystal Status information.
void setAM(uint32_t minimum_frequency, uint32_t maximum_frequency, uint32_t default_frequency, uint16_t step)
Sets the receiver to AM mode.
void setI2CBusAddress(int deviceAddress)
Set I2C bus address.
#define REF_CLOCK_DISABLE
uint32_t minimumFrequency
Stores the minimum frequency for the current band.
uint8_t volume
Stores the current volume.
uint8_t currentMode
Stores the current mode.
void setMono(bool on_off)
Sets the receiver Stereo or Mono.
uint16_t currentStep
Stores the current step.
uint32_t maximumFrequency
Stores the maximum frequency for the current band.
void setStep(uint16_t step)
Sets the frequency step.
uint32_t getFrequency()
Gets the current frequency.
void setTuneDialModeOn(uint32_t minimu_frequency, uint32_t maximum_frequency)
Sets Tune Dial Mode Interface On
void setReferenceClockType(uint8_t crystal, uint8_t ref_clock=0)
Sets the Crystal Type.
uint16_t getRegister(uint8_t reg)
Gets a given KT09XX register content.
void setRegister(uint8_t reg, uint16_t parameter)
Sets the a value to a given KT09XX register.
uint8_t currentRefClockEnabled
Strores 0 = Crystal; 1 = Reference clock.
uint16_t getDeviceId()
Gets the Device Id.
void setVolumeDialModeOff()
Turns the Volume Dial Mode interface Off.
void frequencyUp()
Increments the frequency one step.
void setVolumeDialModeOn()
Sets Volume Dial Mode Interface On.
void setFrequency(uint32_t frequency)
Sets the current frequency.
void setDeEmphasis(uint8_t value)
Sets the De-emphasis Time Constant Selection.
void setTuneDialModeOff()
Turns the Tune Dial Mode interface Off.
void frequencyDown()
Decrements the frequency one step.
void setVolume(uint8_t value)
Sets the audio volume level.
void setup(int enable_pin, uint8_t oscillator_type=OSCILLATOR_32KHZ, uint8_t ref_clock=REF_CLOCK_DISABLE)
Receiver startup.