PU2CLR AKC695X Arduino Library
1.0.1
This is an Arduino Library to control the AKC695X / M695X DSP radio devices
|
19 #define DEFAUL_I2C_ADDRESS 0x10
20 #define CURRENT_MODE_FM 1
21 #define CURRENT_MODE_AM 0
60 #define AKC595X_I2C_ADRESS 0x10
434 int deviceAddress = AKC595X_I2C_ADRESS;
439 uint16_t currentStep;
440 uint16_t currentFrequency;
441 uint8_t currentMode = 0;
444 uint8_t currentBand = 0;
445 uint16_t currentBandMinimumFrequency;
446 uint16_t currentBandMaximumFrequency;
449 uint8_t fmCurrentBand = 0;
455 void setup(
int reset_pin);
456 void powerOn(uint8_t fm_en, uint8_t tune, uint8_t mute, uint8_t seek, uint8_t seekup);
466 void setFM(uint8_t akc695x_fm_band, uint16_t minimum_freq, uint16_t maximum_freq, uint16_t default_frequency, uint8_t default_step);
467 void setAM(uint8_t akc695x_am_band, uint16_t minimum_freq, uint16_t maximum_freq, uint16_t default_frequency, uint8_t default_step);
478 void setAudio(uint8_t phase_inv, uint8_t line, uint8_t volume);
485 inline int getVolume() {
return this->volume; };
490 inline uint8_t getCurrentMode() {
return this->currentMode; };
uint8_t channel
(0:4) - 5 most significant bits that represents the channel (see reg3)
Definition: AKC695X.h:147
void setStep(uint8_t step)
Sets the step that will be used to increment and decrement the current frequency.
Definition: AKC695X.cpp:361
void setVolume(uint8_t volume)
Sets the output audio volume.
Definition: AKC695X.cpp:547
uint8_t rsv2
Reserved. Measured using, do not change this value.
Definition: AKC695X.h:276
Reg20 (type 0x14 / R)
Definition: AKC695X.h:310
uint8_t vol_pre
Adjusting the output volume of the entire values: 00: 0dB 01: 3.5dB.
Definition: AKC695X.h:295
bool isTuningComplete()
Gets the Status of seeking or tuning process.
Definition: AKC695X.cpp:158
Reg6 (type 0x06 / RW): configures register 0 (default: 0xA1) Address.
Definition: AKC695X.h:178
uint8_t tune
0-> 1 Trigger tune process The STC bit is set high when the tune operation completes.
Definition: AKC695X.h:110
void seekFmStation(uint8_t up_down)
Seeks a FM station.
Definition: AKC695X.cpp:396
void setI2CBusAddress(int deviceAddress)
Sets the I2C bus device address.
Definition: AKC695X.cpp:44
uint8_t seek
0-> 1 Trigger tune process The STC bit is set high when the tune operation completes.
Definition: AKC695X.h:109
bool isTuned()
Gets the result of tune processing.
Definition: AKC695X.cpp:144
uint8_t am_cnr_th
When AM mode, chip sets and lighting sentence carrier to noise ratio threshold.
Definition: AKC695X.h:217
Definition: AKC695X.h:430
void setFrequency(uint16_t frequency)
Sets the the device to a given frequency.
Definition: AKC695X.cpp:438
uint8_t rsv
Reserved.
Definition: AKC695X.h:390
Reg11 (type 0x0B / RW): configure register 9 (default: 0xE0) Address.
Definition: AKC695X.h:256
Reg9 (type 0x09 / RW): configure register 9 (default: 0x07) Address.
Definition: AKC695X.h:230
uint8_t rsv2
Measured using, do not change this value.
Definition: AKC695X.h:296
uint8_t mode3k_f
1 = AM 3K channel spacing; 0 = AM 5K channel spacing
Definition: AKC695X.h:340
Reg2 (type 0x02 / RW): configure register 2 (default: 0x4A) Address.
Definition: AKC695X.h:144
int getRSSI()
Gets the current RSSI.
Definition: AKC695X.cpp:606
uint8_t pd_adc_vol
0 = volume potentiometer mode
Definition: AKC695X.h:236
uint8_t bben
Base boost enable 0; Close bass 1.
Definition: AKC695X.h:198
uint8_t rsv1
Measured using, do not change this value.
Definition: AKC695X.h:298
uint8_t line
0 = Radio mode; 1 = Line Mode
Definition: AKC695X.h:182
uint8_t rsv1
Reserved. Measured using, do not change this value.
Definition: AKC695X.h:234
Reg25 (type 0x19 / R)
Definition: AKC695X.h:386
uint8_t fm_cnr_th
When the FM mode, chip sets and lighting sentence carrier to noise. Ratio limit 00-2dB 01-3dB 10-4dB ...
Definition: AKC695X.h:218
uint8_t st_led
0 = tund pin is tuned lamp; When 1-FM and non wtmode, tund indicator pin is stereo demodulation,...
Definition: AKC695X.h:297
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:321
Reg13 (type 0x0D / RW): configure register 11 (default: 0x??) Address.
Definition: AKC695X.h:291
float getSupplyVoltage()
Gets the supply voltage.
Definition: AKC695X.cpp:629
uint8_t rsv2
Reserved. Measured using, do not change this value.
Definition: AKC695X.h:261
uint8_t res
?????
Definition: AKC695X.h:278
uint8_t power_on
1 = Chip on; 0 = Chip off
Definition: AKC695X.h:112
uint8_t akc595x_reg4
Reg4 (type 0x04 / RW): configures register 4 (default: 0x19) Address.
Definition: AKC695X.h:165
uint8_t akc595x_reg5
Reg5 (type 0x05 / RW): configures register 5 (default: 0x32) Address.
Definition: AKC695X.h:172
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:257
uint8_t space
00 = 25KHz; 01 = 50KHz; 10 = 100KHz; 11 = 200KHz
Definition: AKC695X.h:260
Reg1 (type 0x01 / RW): configures register 1 (default: 0x10) Address.
Definition: AKC695X.h:124
uint8_t volume
Volume: 0 ~ 63 (<24 = mute; 24 ~ 63)
Definition: AKC695X.h:183
void frequencyDown()
Subtracts the current step from the current frequency and assign the new frequency.
Definition: AKC695X.cpp:498
void setVolumeControl(uint8_t type)
Sets the kind of audio volume control will be used.
Definition: AKC695X.cpp:591
uint8_t isCurrentModeFM()
Gets the current operation mode;.
Definition: AKC695X.cpp:173
Reg22 (type 0x16 / R)
Definition: AKC695X.h:336
void setVolumeDown()
Decrements the audio volume.
Definition: AKC695X.cpp:575
Reg8 (type 0x08 / RW): configures register 8 (default: 0x58) Address.
Definition: AKC695X.h:212
uint8_t osc_en
Oscillator source selection. 0 = 0-External XO; 1 = 1-Crystal.
Definition: AKC695X.h:235
uint8_t akc595x_reg3
Reg3 (type 0x03 / RW): configures register 3 (default: 0xC8) Address.
Definition: AKC695X.h:159
uint8_t rsv
Reserved.
Definition: AKC695X.h:417
uint8_t fm_en
1 = FM mode; 0 = AM mode
Definition: AKC695X.h:111
uint8_t rsv2
Reserved. Measured using, do not change this value.
Definition: AKC695X.h:237
uint8_t seekup
Seek direction control bit. 0 = Seek down; 1 = Seek up.
Definition: AKC695X.h:108
uint16_t getFrequency()
Returns the current frequency value.
Definition: AKC695X.cpp:477
uint8_t pd_rx
0 = analog and RF analog and RF ??????
Definition: AKC695X.h:277
uint8_t pd_adc
Signal channel ADC signal path; 0 = Close; 1 = Open.
Definition: AKC695X.h:279
Reg24 (type 0x18 / R)
Definition: AKC695X.h:368
uint8_t rsv
Measured using, set to "0" during normal use.
Definition: AKC695X.h:200
uint8_t rssi
Antenna aperture can be calculated using signal levels rssi.
Definition: AKC695X.h:416
uint8_t rsv1
Reserved. Measured using, do not change this value.
Definition: AKC695X.h:259
uint8_t cnrfm
Carrier to noise ratio of the FM signal format, in dB.
Definition: AKC695X.h:355
uint8_t pgalevel_rf
?? RF power control loop gain level, the greater the level, a high gain of approximately ?...
Definition: AKC695X.h:374
uint8_t de
De-emphasis mode. 1 = 75 μ s (USA); 0 = 50 μ s (China)
Definition: AKC695X.h:199
uint8_t bw
00 = 150K; 01 = 200K; 10 = 50K; 11 = 100K
Definition: AKC695X.h:196
void setup(int reset_pin)
Receiver startup.
Definition: AKC695X.cpp:55
uint8_t stc
0 = Not complete; 1 = Complete during Seek and Tune in the register 0.
Definition: AKC695X.h:315
uint8_t akc595x_reg21
Reg21 (type 0x15 / R)
Definition: AKC695X.h:327
Reg7 (type 0x07 / RW): configures register 0 (default: 0xA1) Address.
Definition: AKC695X.h:193
uint8_t readchan
Current Channel number (high 5bit). See Reg21.
Definition: AKC695X.h:313
uint8_t mute
1 - Mute L / R channel 0 - Normal operation
Definition: AKC695X.h:107
uint8_t rsv
Reserved.
Definition: AKC695X.h:372
void frequencyUp()
Adds the current step to the current frequency and sets the new frequency.
Definition: AKC695X.cpp:487
uint8_t tuned
When transferred to station 1, station search software can use this determination bit table.
Definition: AKC695X.h:314
void reset()
Resets the system.
Definition: AKC695X.cpp:27
uint8_t st
??? 0 to the current situation other FM stereo radio ????
Definition: AKC695X.h:316
Reg0 (type 0x00 / RW): configures register 0 (default: 0x4c) Address.
Definition: AKC695X.h:103
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:75
uint8_t iv_en
When low voltage power supply, whether to enter the low-voltage operation mode can.
Definition: AKC695X.h:233
uint8_t st_dem
Only the demodulated FM stereo (Stereo ratio is greater than 30%) show only one.
Definition: AKC695X.h:356
uint8_t rsv
(7) - Reserved - Debug use, do not change this value using
Definition: AKC695X.h:150
void setFmSeekStep(uint8_t value)
Sets FM step for seeking.
Definition: AKC695X.cpp:383
uint8_t vbat
6 bits indicating the supply voltage ( unsigned number )
Definition: AKC695X.h:389
uint8_t getRegister(uint8_t reg)
Gets a given register content.
Definition: AKC695X.cpp:114
uint8_t stereo_mono
"00" the auto stereo, there Stereo_th control threshold ; "10" long as the pilot is forced stereo "x1...
Definition: AKC695X.h:197
uint16_t getCurrentChannel()
Gets the current channel.
Definition: AKC695X.cpp:187
uint8_t phase_inv
0 = audio output inphase, 1 = opposite phase, for single speaker
Definition: AKC695X.h:181
uint8_t lvmode
Low voltage maximum volume limit mode indication bit.
Definition: AKC695X.h:371
uint8_t rsv3
Measured using, do not change this value.
Definition: AKC695X.h:294
Reg23 (type 0x17 / R)
Definition: AKC695X.h:352
uint8_t ref_37k_mode
(6) - 1 = 32K ref. crystal clock; 0 = 12MHz ref crystal clock
Definition: AKC695X.h:149
void commitTune()
Sets the STC bit to high when the tune operation completes.
Definition: AKC695X.cpp:215
uint8_t rsv
Reserved - Debug use, do not change this value using.
Definition: AKC695X.h:106
uint8_t akc595x_reg26
Reg26 (type 0x1A / R)
Definition: AKC695X.h:402
uint8_t pgalevel_if
?? RF power control loop gain level, the greater the level, a high gain of approximately ?...
Definition: AKC695X.h:373
Reg12 (type 0x0C / RW): configure register 11 (default: 0x??) Address.
Definition: AKC695X.h:273
uint8_t stereo_th
FM stereo demodulation start CNR threshold - 00=4, 01=8, 10=12,11=16.
Definition: AKC695X.h:215
void setRegister(uint8_t reg, uint8_t parameter)
Sets a given register with a given value.
Definition: AKC695X.cpp:98
uint8_t mode3k
(5) - 1 = 3K; 0 = 5K
Definition: AKC695X.h:148
uint8_t cnram
Carrier to noise ratio of the AM signal format, in dB.
Definition: AKC695X.h:339
void setVolumeUp()
Increments the audio volume.
Definition: AKC695X.cpp:564
Reg27 (type 0x1B / R)
Definition: AKC695X.h:413
void setAudio()
Configures the audio output with default values.
Definition: AKC695X.cpp:533