PU2CLR AKC695X Arduino Library
1.0.1
This is an Arduino Library to control the AKC695X / M695X DSP radio devices
|
Functions | |
void | AKC695X::commitTune () |
Sets the STC bit to high when the tune operation completes. More... | |
void | AKC695X::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. More... | |
void | AKC695X::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. More... | |
void | AKC695X::setStep (uint8_t step) |
Sets the step that will be used to increment and decrement the current frequency. More... | |
void | AKC695X::setFmSeekStep (uint8_t value) |
Sets FM step for seeking. More... | |
void | AKC695X::seekFmStation (uint8_t up_down) |
Seeks a FM station. More... | |
void | AKC695X::setFrequency (uint16_t frequency) |
Sets the the device to a given frequency. More... | |
uint16_t | AKC695X::getFrequency () |
Returns the current frequency value. More... | |
void | AKC695X::frequencyUp () |
Adds the current step to the current frequency and sets the new frequency. More... | |
void | AKC695X::frequencyDown () |
Subtracts the current step from the current frequency and assign the new frequency. More... | |
void | AKC695X::setAudio (uint8_t phase_inv, uint8_t line, uint8_t volume) |
Configures the audio output. More... | |
void | AKC695X::setAudio () |
Configures the audio output with default values. More... | |
void | AKC695X::setVolume (uint8_t volume) |
Sets the output audio volume. More... | |
void | AKC695X::setVolumeUp () |
Increments the audio volume. More... | |
void | AKC695X::setVolumeDown () |
Decrements the audio volume. More... | |
int | AKC695X::getRSSI () |
Gets the current RSSI. More... | |
float | AKC695X::getSupplyVoltage () |
Gets the supply voltage. More... | |
void AKC695X::commitTune | ( | ) |
Sets the STC bit to high when the tune operation completes.
Tells the device that the tune process is over.
void AKC695X::frequencyDown | ( | ) |
Subtracts the current step from the current frequency and assign the new frequency.
Goes to the previous frequency channel
void AKC695X::frequencyUp | ( | ) |
Adds the current step to the current frequency and sets the new frequency.
Goes to the next frequency channel
uint16_t AKC695X::getFrequency | ( | ) |
Returns the current frequency value.
Gets the current frequency.
int AKC695X::getRSSI | ( | ) |
Gets the current RSSI.
Gets the current RSSI
float AKC695X::getSupplyVoltage | ( | ) |
Gets the supply voltage.
Gets the current supply voltage
void AKC695X::seekFmStation | ( | uint8_t | up_down | ) |
Seeks a FM station.
Seek a FM Station
up_down | if 0, seek down; if 1, seek up. |
void AKC695X::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.
This method configures the AM band you want to use.
You must respect the frequency limits defined by the AKC595X device documentation.
AM band | N# | Description |
---|---|---|
00000 | 0 | LW, 0.15 ~ 0.285, 3K station search |
00001 | 1 | MW1, 0.52 ~ 1.71, 5K station search |
00010 | 2 | MW2, 0.522 ~ 1.62, 9K station search |
00011 | 3 | MW3, 0.52 ~ 1.71, 10K station search |
00100 | 4 | SW1, 4.7 ~ 10, 5K station search |
00101 | 5 | SW2, 3.2 ~ 4.1, 5K station search |
00110 | 6 | SW3, 4.7 ~ 5.6, 5K station search |
00111 | 7 | SW4, 5.7 ~ 6.4, 5K station search |
01000 | 8 | SW5, 6.8 ~ 7.6, 5K station search |
01001 | 9 | SW6, 9.2 ~ 10, 5K station search |
01010 | 10 | SW7, 11.4 ~ 12.2, 5K station search |
01011 | 11 | SW8, 13.5 ~ 14.3 |
01100 | 12 | SW9, 15 ~ 15.9 |
01101 | 13 | SW10, 17.4 ~ 17.9 |
01110 | 14 | SW11, 18.9 ~ 19.7, 5K station search |
01111 | 15 | SW12, 21.4 ~ 21.9, 5K station search |
10000 | 16 | SW13, 11.4 ~ 17.9, 5K station search |
10010 | 17 | MW4, 0.52 to 1.73, 5K station search |
Other | 18+ | custom band, station search interval = 3K |
akc695x_am_band | AM band (see manual AM band table above) |
minimum_freq | Minimal frequency of the band |
maximum_freq | Band maximum frequency |
default_frequency | default frequency |
default_step | increment and decrement step |
void AKC695X::setAudio | ( | ) |
Configures the audio output with default values.
this method sets the audio phase_inv = 0; line = 1 and volume = 40;
Also, this set the audio controlled by MCU (Arduino)
void AKC695X::setAudio | ( | uint8_t | phase_inv, |
uint8_t | line, | ||
uint8_t | volume | ||
) |
Configures the audio output.
This method sets the AKC695X device audio behaviour
phase_inv | if 0, audio output inphase; if 1, audio output inverted |
line | if 0, audio input mode; if 1, radio mode. |
volume | if 25 a 63, audio volume; if <= 24 mute |
void AKC695X::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.
Sets the device to FM mode.
FM band | N# | Description |
---|---|---|
000 | 0 | FM1,87 ~ 108, station search space specified intervals |
001 | 1 | FM2,76 ~ 108, station search space specified intervals |
010 | 2 | FM3,70 ~ 93, with a space station search interval set |
011 | 3 | FM4,76 ~ 90, Tuning predetermined space intervals |
100 | 4 | FM5,64 ~ 88, with a space station search interval set |
101 | 5 | TV1,56.25 ~ 91.75, station search space specified intervals |
110 | 6 | TV2, 174.75 ~ 222.25, found |
111 | 7 | sets predetermined space intervals, custom FM, station search space specified intervals |
akc695x_fm_band | FM band (see manual FM band table above) |
minimum_freq | Minimal frequency of the band |
maximum_freq | Band maximum frequency |
default_frequency | default frequency |
default_step | increment and decrement step |
void AKC695X::setFmSeekStep | ( | uint8_t | space | ) |
Sets FM step for seeking.
Sets FM seek step.
spece | N# | step |
---|---|---|
00 | 0 | 25 KHz |
01 | 1 | 50 KHz |
10 | 2 | 100 KHz |
11 | 3 | 200 KHz |
space | value betwenn 0 and 3 (see table above). |
void AKC695X::setFrequency | ( | uint16_t | frequency | ) |
Sets the the device to a given frequency.
This methods check the current mode (AM or FM), calculates the right channel to be setted.
Sets to reg2 structure the 5 most significan bist of the channel.
Sets to reg3 the 8 less significant bits of the channel.
frequency | frequency you want to set to |
void AKC695X::setStep | ( | uint8_t | step | ) |
Sets the step that will be used to increment and decrement the current frequency.
The AKC695X has two possible steps (3KHz and 5KHz). The step value is important to calculate the frequenvy you want to set.
step | The valid values are 3 and 5. Other values will be ignored. |
void AKC695X::setVolume | ( | uint8_t | volume | ) |
Sets the output audio volume.
Values less than 24 mute the audio output.
Values between 25 and 63 set the output audio volume.
volume |
void AKC695X::setVolumeDown | ( | ) |
Decrements the audio volume.
The minimum volume is 25
void AKC695X::setVolumeUp | ( | ) |
Increments the audio volume.
The maximum volume is 63