Compare commits
10 commits
6eb1e9a5dd
...
48f034f0a4
Author | SHA1 | Date | |
---|---|---|---|
48f034f0a4 | |||
|
fd6e80a746 | ||
d774850054 | |||
461ce740a4 | |||
|
48c40411d0 | ||
|
d8b7b767e2 | ||
|
37aef95e34 | ||
|
d12c75fa00 | ||
|
075c570cae | ||
|
03a0135f20 |
5 changed files with 1142 additions and 939 deletions
|
@ -7,3 +7,4 @@ Ressources:
|
|||
* http://community.silabs.com/t5/Timing-Knowledge-Base/Modifying-Output-Driver-Strength-of-the-Si5351/ta-p/112253
|
||||
* https://github.com/etherkit/Si5351Arduino
|
||||
* http://images.google.de/imgres?imgurl=http://www.kh-gps.de/si5351_4.jpg&imgrefurl=http://www.kh-gps.de/si5351.htm&h=483&w=1115&tbnid=p6ACt2AabOao6M:&tbnh=90&tbnw=208&docid=YzcwWac64G4VOM&usg=__tpZeibmT-PYky-rOAt6f3X7w_7s=&sa=X&ved=0ahUKEwjggd_4tI_PAhUEnRQKHQHdAVUQ9QEIJzAC
|
||||
* https://github.com/gmtii/ili9341-arduino
|
|
@ -101,82 +101,64 @@ uint8_t cc_cmd_data_read_cnt = 0;
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
uint32_t read32BitDataFromBuffer(uint8_t pos)
|
||||
{
|
||||
uint32_t tmp = (uint32_t)cc_read_data[pos ] << 24;
|
||||
tmp += (uint32_t)cc_read_data[pos + 1] << 16;
|
||||
tmp += (uint32_t)cc_read_data[pos + 2] << 8;
|
||||
tmp += (uint32_t)cc_read_data[pos + 3];
|
||||
return tmp;
|
||||
}
|
||||
|
||||
uint16_t read16BitDataFromBuffer(uint8_t pos)
|
||||
{
|
||||
uint16_t tmp = (uint16_t)cc_read_data[pos ] << 8;
|
||||
tmp += (uint16_t)cc_read_data[pos + 1];
|
||||
return tmp;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void cc_setStartFreq()
|
||||
{
|
||||
uint32_t tmp_start_freq = (uint32_t)cc_read_data[0] << 24;
|
||||
tmp_start_freq += (uint32_t)cc_read_data[1] << 16;
|
||||
tmp_start_freq += (uint32_t)cc_read_data[2] << 8;
|
||||
tmp_start_freq += (uint32_t)cc_read_data[3];
|
||||
if (tmp_start_freq < 1)
|
||||
tmp_start_freq = 1;
|
||||
if (tmp_start_freq > 150000000)
|
||||
tmp_start_freq = 150000000;
|
||||
uint32_t tmp_start_freq = read32BitDataFromBuffer(0);
|
||||
|
||||
start_freq = tmp_start_freq;
|
||||
start_freq = keepFreqRange(tmp_start_freq);
|
||||
|
||||
char* tmp = " ";
|
||||
sprintf(tmp, "%c%c%c%c%c", MSG_SOM1, MSG_SOM2,
|
||||
MSG_TYPE_ANSWER_OK,
|
||||
MSG_EOM1, MSG_EOM2);
|
||||
Serial.write(tmp);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_OK);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
void cc_setEndFreq()
|
||||
{
|
||||
uint32_t tmp_end_freq = (uint32_t)cc_read_data[0] << 24;
|
||||
tmp_end_freq += (uint32_t)cc_read_data[1] << 16;
|
||||
tmp_end_freq += (uint32_t)cc_read_data[2] << 8;
|
||||
tmp_end_freq += (uint32_t)cc_read_data[3];
|
||||
if (tmp_end_freq < 1)
|
||||
tmp_end_freq = 1;
|
||||
if (tmp_end_freq > 150000000)
|
||||
tmp_end_freq = 150000000;
|
||||
uint32_t tmp_end_freq = read32BitDataFromBuffer(0);
|
||||
|
||||
end_freq = tmp_end_freq;
|
||||
end_freq = keepFreqRange(tmp_end_freq);
|
||||
|
||||
char* tmp = " ";
|
||||
sprintf(tmp, "%c%c%c%c%c", MSG_SOM1, MSG_SOM2,
|
||||
MSG_TYPE_ANSWER_OK,
|
||||
MSG_EOM1, MSG_EOM2);
|
||||
Serial.write(tmp);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_OK);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
void cc_setFreqStep()
|
||||
{
|
||||
uint32_t tmp_step_freq = (uint32_t)cc_read_data[0] << 24;
|
||||
tmp_step_freq += (uint32_t)cc_read_data[1] << 16;
|
||||
tmp_step_freq += (uint32_t)cc_read_data[2] << 8;
|
||||
tmp_step_freq += (uint32_t)cc_read_data[3];
|
||||
if (tmp_step_freq < 1)
|
||||
tmp_step_freq = 1;
|
||||
if (tmp_step_freq > 150000000)
|
||||
tmp_step_freq = 150000000;
|
||||
uint32_t tmp_step_freq = read32BitDataFromBuffer(0);
|
||||
|
||||
step_freq = tmp_step_freq;
|
||||
step_freq = keepFreqRange(tmp_step_freq);
|
||||
|
||||
char* tmp = " ";
|
||||
sprintf(tmp, "%c%c%c%c%c", MSG_SOM1, MSG_SOM2,
|
||||
MSG_TYPE_ANSWER_OK,
|
||||
MSG_EOM1, MSG_EOM2);
|
||||
Serial.write(tmp);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_OK);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
void cc_setIntervall()
|
||||
{
|
||||
uint16_t tmp_intervall = (uint16_t)cc_read_data[0] << 8;
|
||||
tmp_intervall += (uint16_t)cc_read_data[1];
|
||||
if (tmp_intervall < 1)
|
||||
tmp_intervall = 1;
|
||||
if (tmp_intervall > 150000000)
|
||||
tmp_intervall = 150000000;
|
||||
intervall = read16BitDataFromBuffer(0);
|
||||
|
||||
intervall = tmp_intervall;
|
||||
|
||||
char* tmp = " ";
|
||||
sprintf(tmp, "%c%c%c%c%c", MSG_SOM1, MSG_SOM2,
|
||||
MSG_TYPE_ANSWER_OK,
|
||||
MSG_EOM1, MSG_EOM2);
|
||||
Serial.write(tmp);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_OK);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
void cc_setDriveStrength()
|
||||
|
@ -189,18 +171,13 @@ void cc_setDriveStrength()
|
|||
{
|
||||
drive_str = tmp_ds;
|
||||
|
||||
char* tmp = " ";
|
||||
sprintf(tmp, "%c%c%c%c%c", MSG_SOM1, MSG_SOM2,
|
||||
MSG_TYPE_ANSWER_OK,
|
||||
MSG_EOM1, MSG_EOM2);
|
||||
Serial.write(tmp);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_OK);
|
||||
sendEOM();
|
||||
} else {
|
||||
|
||||
char* tmp = " ";
|
||||
sprintf(tmp, "%c%c%c%c%c", MSG_SOM1, MSG_SOM2,
|
||||
MSG_TYPE_ANSWER_NOK,
|
||||
MSG_EOM1, MSG_EOM2);
|
||||
Serial.write(tmp);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_NOK);
|
||||
sendEOM();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,13 +188,22 @@ void cc_startMeasurement()
|
|||
// MSG_TYPE_CONFIG
|
||||
cc_getConfig();
|
||||
|
||||
// 2. start a for loop from the frequence to start to the end frequence
|
||||
if (start_freq > 0 && start_freq <= 150000000 &&
|
||||
end_freq > 0 && end_freq <= 150000000 &&
|
||||
start_freq < end_freq &&
|
||||
intervall > 0 &&
|
||||
step_freq > 0)
|
||||
if (start_freq == 0 || start_freq > 150000000 ||
|
||||
end_freq == 0 || end_freq > 150000000 ||
|
||||
step_freq == 0 || step_freq > 150000000 ||
|
||||
start_freq >= end_freq ||
|
||||
intervall == 0)
|
||||
{
|
||||
// on error
|
||||
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_NOK);
|
||||
sendEOM();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. start a for loop from the frequence to start to the end frequence
|
||||
si5351.drive_strength(SI5351_CLK0, drive_str); // 2 4 6 8ma
|
||||
|
||||
uint8_t t = 0;
|
||||
|
@ -267,19 +253,12 @@ void cc_startMeasurement()
|
|||
|
||||
// 4. send the current output frequency, the drive strength and the measured ADC values from A0 and A1 to the host
|
||||
// MSG_TYPE_MEAS_FREQ_INFO
|
||||
Serial.write(MSG_SOM1);
|
||||
Serial.write(MSG_SOM2);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_MEAS_FREQ_INFO);
|
||||
Serial.write((uint8_t)((freq & 0xff000000) >> 24));
|
||||
Serial.write((uint8_t)((freq & 0x00ff0000) >> 16));
|
||||
Serial.write((uint8_t)((freq & 0x0000ff00) >> 8));
|
||||
Serial.write((uint8_t) (freq & 0x000000ff));
|
||||
Serial.write((uint8_t)((a0_sum & 0xff00) >> 8));
|
||||
Serial.write((uint8_t) (a0_sum & 0x00ff));
|
||||
Serial.write((uint8_t)((a1_sum & 0xff00) >> 8));
|
||||
Serial.write((uint8_t) (a1_sum & 0x00ff));
|
||||
Serial.write(MSG_EOM1);
|
||||
Serial.write(MSG_EOM2);
|
||||
send32BitValue(freq);
|
||||
send16BitValue(a0_sum);
|
||||
send16BitValue(a1_sum);
|
||||
sendEOM();
|
||||
|
||||
si5351.output_enable(SI5351_CLK0, 0); // disable clock output 0
|
||||
|
||||
|
@ -289,20 +268,9 @@ void cc_startMeasurement()
|
|||
|
||||
// 5. send a measurement end message to the host
|
||||
// MSG_TYPE_MEAS_END_INFO
|
||||
char* tmp = " ";
|
||||
sprintf(tmp, "%c%c%c%c%c", MSG_SOM1, MSG_SOM2,
|
||||
MSG_TYPE_MEAS_END_INFO,
|
||||
MSG_EOM1, MSG_EOM2);
|
||||
Serial.write(tmp);
|
||||
|
||||
} else {
|
||||
// on error
|
||||
char* tmp = " ";
|
||||
sprintf(tmp, "%c%c%c%c%c", MSG_SOM1, MSG_SOM2,
|
||||
MSG_TYPE_ANSWER_NOK,
|
||||
MSG_EOM1, MSG_EOM2);
|
||||
Serial.write(tmp);
|
||||
}
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_MEAS_END_INFO);
|
||||
sendEOM();
|
||||
|
||||
si5351.output_enable(SI5351_CLK0, 0); // disable clock output 0
|
||||
|
||||
|
@ -310,34 +278,21 @@ void cc_startMeasurement()
|
|||
|
||||
void cc_getConfig()
|
||||
{
|
||||
Serial.write(MSG_SOM1);
|
||||
Serial.write(MSG_SOM2);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_CONFIG);
|
||||
Serial.write((uint8_t)((start_freq & 0xff000000) >> 24));
|
||||
Serial.write((uint8_t)((start_freq & 0x00ff0000) >> 16));
|
||||
Serial.write((uint8_t)((start_freq & 0x0000ff00) >> 8));
|
||||
Serial.write((uint8_t) (start_freq & 0x000000ff));
|
||||
Serial.write((uint8_t)((end_freq & 0xff000000) >> 24));
|
||||
Serial.write((uint8_t)((end_freq & 0x00ff0000) >> 16));
|
||||
Serial.write((uint8_t)((end_freq & 0x0000ff00) >> 8));
|
||||
Serial.write((uint8_t) (end_freq & 0x000000ff));
|
||||
Serial.write((uint8_t)((step_freq & 0xff000000) >> 24));
|
||||
Serial.write((uint8_t)((step_freq & 0x00ff0000) >> 16));
|
||||
Serial.write((uint8_t)((step_freq & 0x0000ff00) >> 8));
|
||||
Serial.write((uint8_t) (step_freq & 0x000000ff));
|
||||
Serial.write((uint8_t)((intervall & 0xff00) >> 8));
|
||||
Serial.write((uint8_t) (intervall & 0x00ff));
|
||||
send32BitValue(start_freq);
|
||||
send32BitValue(end_freq);
|
||||
send32BitValue(step_freq);
|
||||
send16BitValue(intervall);
|
||||
Serial.write((uint8_t) drive_str);
|
||||
Serial.write(MSG_EOM1);
|
||||
Serial.write(MSG_EOM2);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void cc_enableClk(void)
|
||||
{
|
||||
Serial.write(MSG_SOM1);
|
||||
Serial.write(MSG_SOM2);
|
||||
sendSOM();
|
||||
if (cc_read_data[0] == SI5351_CLK0)
|
||||
{
|
||||
si5351.set_freq((uint64_t)start_freq * 100, SI5351_PLL_FIXED, SI5351_CLK0);
|
||||
|
@ -358,16 +313,14 @@ void cc_enableClk(void)
|
|||
} else {
|
||||
Serial.write(MSG_TYPE_ANSWER_NOK);
|
||||
}
|
||||
Serial.write(MSG_EOM1);
|
||||
Serial.write(MSG_EOM2);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void cc_disableClk(void)
|
||||
{
|
||||
Serial.write(MSG_SOM1);
|
||||
Serial.write(MSG_SOM2);
|
||||
sendSOM();
|
||||
if (cc_read_data[0] == SI5351_CLK0)
|
||||
{
|
||||
si5351.output_enable(SI5351_CLK0, 0); // disable clock output 0
|
||||
|
@ -385,8 +338,7 @@ void cc_disableClk(void)
|
|||
} else {
|
||||
Serial.write(MSG_TYPE_ANSWER_NOK);
|
||||
}
|
||||
Serial.write(MSG_EOM1);
|
||||
Serial.write(MSG_EOM2);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -394,45 +346,33 @@ void cc_disableClk(void)
|
|||
void cc_saveDefaults(void)
|
||||
{
|
||||
|
||||
saveEEPValues();
|
||||
writeEEPROMConfig();
|
||||
|
||||
Serial.write(MSG_SOM1);
|
||||
Serial.write(MSG_SOM2);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_OK);
|
||||
Serial.write(MSG_EOM1);
|
||||
Serial.write(MSG_EOM2);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void cc_setClkCorrection(void)
|
||||
{
|
||||
uint32_t tmp_corr = (uint32_t)cc_read_data[0] << 24;
|
||||
tmp_corr += (uint32_t)cc_read_data[1] << 16;
|
||||
tmp_corr += (uint32_t)cc_read_data[2] << 8;
|
||||
tmp_corr += (uint32_t)cc_read_data[3];
|
||||
uint32_t tmp_corr = read32BitDataFromBuffer(0);
|
||||
|
||||
si5351.set_correction(tmp_corr);
|
||||
|
||||
Serial.write(MSG_SOM1);
|
||||
Serial.write(MSG_SOM2);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_OK);
|
||||
Serial.write(MSG_EOM1);
|
||||
Serial.write(MSG_EOM2);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
void cc_getClkCorrection(void)
|
||||
{
|
||||
uint32_t tmp_corr = si5351.get_correction();
|
||||
|
||||
Serial.write(MSG_SOM1);
|
||||
Serial.write(MSG_SOM2);
|
||||
Serial.write((uint8_t)((tmp_corr & 0xff000000) >> 24));
|
||||
Serial.write((uint8_t)((tmp_corr & 0x00ff0000) >> 16));
|
||||
Serial.write((uint8_t)((tmp_corr & 0x0000ff00) >> 8));
|
||||
Serial.write((uint8_t) (tmp_corr & 0x000000ff));
|
||||
Serial.write(MSG_EOM1);
|
||||
Serial.write(MSG_EOM2);
|
||||
sendSOM();
|
||||
send32BitValue(tmp_corr);
|
||||
sendEOM();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -450,11 +390,9 @@ void cc_init()
|
|||
void cc_abort()
|
||||
{
|
||||
// send abort message, then init
|
||||
char* tmp = " ";
|
||||
sprintf(tmp, "%c%c%c%c%c", MSG_SOM1, MSG_SOM2,
|
||||
MSG_TYPE_ANSWER_NOK,
|
||||
MSG_EOM1, MSG_EOM2);
|
||||
Serial.write(tmp);
|
||||
sendSOM();
|
||||
Serial.write(MSG_TYPE_ANSWER_NOK);
|
||||
sendEOM();
|
||||
|
||||
cc_init();
|
||||
}
|
||||
|
@ -560,3 +498,33 @@ void cc_clearReadDataBuffer()
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
void sendSOM()
|
||||
{
|
||||
Serial.write(MSG_SOM1);
|
||||
Serial.write(MSG_SOM2);
|
||||
}
|
||||
|
||||
void sendEOM()
|
||||
{
|
||||
Serial.write(MSG_EOM1);
|
||||
Serial.write(MSG_EOM2);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void send32BitValue(uint32_t value)
|
||||
{
|
||||
Serial.write((uint8_t)((value & 0xff000000) >> 24));
|
||||
Serial.write((uint8_t)((value & 0x00ff0000) >> 16));
|
||||
Serial.write((uint8_t)((value & 0x0000ff00) >> 8));
|
||||
Serial.write((uint8_t) (value & 0x000000ff));
|
||||
}
|
||||
|
||||
void send16BitValue(uint16_t value)
|
||||
{
|
||||
Serial.write((uint8_t)((value & 0xff00) >> 8));
|
||||
Serial.write((uint8_t) (value & 0x00ff));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
@ -90,75 +90,72 @@ void loop()
|
|||
cc_processData(c);
|
||||
}
|
||||
|
||||
//cc_abort();
|
||||
|
||||
delay(100);
|
||||
//delay(100);
|
||||
delay(10);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void saveEEPValues()
|
||||
void write32BitEEPROM(uint8_t addr, uint32_t value)
|
||||
{
|
||||
|
||||
EEPROM.write( 0, (uint8_t)((start_freq & 0xff000000) >> 24));
|
||||
EEPROM.write( 1, (uint8_t)((start_freq & 0x00ff0000) >> 16));
|
||||
EEPROM.write( 2, (uint8_t)((start_freq & 0x0000ff00) >> 8));
|
||||
EEPROM.write( 3, (uint8_t) (start_freq & 0x000000ff));
|
||||
EEPROM.write( 4, (uint8_t)((end_freq & 0xff000000) >> 24));
|
||||
EEPROM.write( 5, (uint8_t)((end_freq & 0x00ff0000) >> 16));
|
||||
EEPROM.write( 6, (uint8_t)((end_freq & 0x0000ff00) >> 8));
|
||||
EEPROM.write( 7, (uint8_t) (end_freq & 0x000000ff));
|
||||
EEPROM.write( 8, (uint8_t)((step_freq & 0xff000000) >> 24));
|
||||
EEPROM.write( 9, (uint8_t)((step_freq & 0x00ff0000) >> 16));
|
||||
EEPROM.write(10, (uint8_t)((step_freq & 0x0000ff00) >> 8));
|
||||
EEPROM.write(11, (uint8_t) (step_freq & 0x000000ff));
|
||||
EEPROM.write(12, (uint8_t)((intervall & 0xff00) >> 8));
|
||||
EEPROM.write(13, (uint8_t) (intervall & 0x00ff));
|
||||
EEPROM.write(14, (uint8_t) drive_str);
|
||||
|
||||
EEPROM.write(addr , (uint8_t)((value & 0xff000000) >> 24));
|
||||
EEPROM.write(addr + 1, (uint8_t)((value & 0x00ff0000) >> 16));
|
||||
EEPROM.write(addr + 2, (uint8_t)((value & 0x0000ff00) >> 8));
|
||||
EEPROM.write(addr + 3, (uint8_t) (value & 0x000000ff));
|
||||
}
|
||||
|
||||
void write16BitEEPROM(uint8_t addr, uint16_t value)
|
||||
{
|
||||
EEPROM.write(addr , (uint8_t)((value & 0xff00) >> 8));
|
||||
EEPROM.write(addr + 1, (uint8_t) (value & 0x00ff));
|
||||
}
|
||||
|
||||
void writeEEPROMConfig()
|
||||
{
|
||||
write32BitEEPROM( 0, start_freq);
|
||||
write32BitEEPROM( 4, end_freq);
|
||||
write32BitEEPROM( 8, step_freq);
|
||||
write16BitEEPROM(12, intervall);
|
||||
EEPROM.write(14, (uint8_t)drive_str);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
uint32_t read32BitEEPROM(uint8_t addr)
|
||||
{
|
||||
uint32_t tmp = (uint32_t)EEPROM.read(addr ) << 24;
|
||||
tmp += (uint32_t)EEPROM.read(addr + 1) << 16;
|
||||
tmp += (uint32_t)EEPROM.read(addr + 2) << 8;
|
||||
tmp += (uint32_t)EEPROM.read(addr + 3);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
uint16_t read16BitEEPROM(uint8_t addr)
|
||||
{
|
||||
uint16_t tmp = (uint16_t)EEPROM.read(addr ) << 8;
|
||||
tmp += (uint16_t)EEPROM.read(addr + 1);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void readEEPValues()
|
||||
{
|
||||
uint32_t tmp_start_freq = (uint32_t)EEPROM.read(0) << 24;
|
||||
tmp_start_freq += (uint32_t)EEPROM.read(1) << 16;
|
||||
tmp_start_freq += (uint32_t)EEPROM.read(2) << 8;
|
||||
tmp_start_freq += (uint32_t)EEPROM.read(3);
|
||||
if (tmp_start_freq < 1)
|
||||
tmp_start_freq = 1;
|
||||
if (tmp_start_freq > 150000000)
|
||||
tmp_start_freq = 150000000;
|
||||
uint32_t tmp_start_freq = read32BitEEPROM(0);
|
||||
|
||||
start_freq = tmp_start_freq;
|
||||
start_freq = keepFreqRange(tmp_start_freq);
|
||||
|
||||
uint32_t tmp_end_freq = (uint32_t)EEPROM.read(4) << 24;
|
||||
tmp_end_freq += (uint32_t)EEPROM.read(5) << 16;
|
||||
tmp_end_freq += (uint32_t)EEPROM.read(6) << 8;
|
||||
tmp_end_freq += (uint32_t)EEPROM.read(7);
|
||||
if (tmp_end_freq < 1)
|
||||
tmp_end_freq = 1;
|
||||
if (tmp_end_freq > 150000000)
|
||||
tmp_end_freq = 150000000;
|
||||
uint32_t tmp_end_freq = read32BitEEPROM(4);
|
||||
|
||||
end_freq = tmp_end_freq;
|
||||
end_freq = keepFreqRange(tmp_end_freq);
|
||||
|
||||
uint32_t tmp_step_freq = (uint32_t)EEPROM.read( 8) << 24;
|
||||
tmp_step_freq += (uint32_t)EEPROM.read( 9) << 16;
|
||||
tmp_step_freq += (uint32_t)EEPROM.read(10) << 8;
|
||||
tmp_step_freq += (uint32_t)EEPROM.read(11);
|
||||
if (tmp_step_freq < 1)
|
||||
tmp_step_freq = 1;
|
||||
if (tmp_step_freq > 150000000)
|
||||
tmp_step_freq = 150000000;
|
||||
uint32_t tmp_step_freq = read32BitEEPROM(8);
|
||||
|
||||
step_freq = tmp_step_freq;
|
||||
step_freq = keepFreqRange(tmp_step_freq);
|
||||
|
||||
uint16_t tmp_intervall = (uint16_t)EEPROM.read(12) << 8;
|
||||
tmp_intervall += (uint16_t)EEPROM.read(13);
|
||||
if (tmp_intervall < 1)
|
||||
tmp_intervall = 1;
|
||||
if (tmp_intervall > 150000000)
|
||||
tmp_intervall = 150000000;
|
||||
uint16_t tmp_intervall = read16BitEEPROM(12);
|
||||
|
||||
intervall = tmp_intervall;
|
||||
|
||||
|
@ -176,3 +173,17 @@ void readEEPValues()
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
uint32_t keepFreqRange(uint32_t freq)
|
||||
{
|
||||
uint32_t f = freq;
|
||||
|
||||
if (freq < 1)
|
||||
f = 1;
|
||||
else if (freq > 150000000)
|
||||
f = 150000000;
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
@ -58,52 +58,6 @@ X ~ 2 0 -150 110 U 40 40 1 1 P
|
|||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# CONN_01X02
|
||||
#
|
||||
DEF CONN_01X02 P 0 40 Y N 1 F N
|
||||
F0 "P" 0 150 50 H V C CNN
|
||||
F1 "CONN_01X02" 100 0 50 V V C CNN
|
||||
F2 "" 0 0 50 H V C CNN
|
||||
F3 "" 0 0 50 H V C CNN
|
||||
$FPLIST
|
||||
Pin_Header_Straight_1X02
|
||||
Pin_Header_Angled_1X02
|
||||
Socket_Strip_Straight_1X02
|
||||
Socket_Strip_Angled_1X02
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -50 -45 10 -55 0 1 0 N
|
||||
S -50 55 10 45 0 1 0 N
|
||||
S -50 100 50 -100 0 1 0 N
|
||||
X P1 1 -200 50 150 R 50 50 1 1 P
|
||||
X P2 2 -200 -50 150 R 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# CONN_01X03
|
||||
#
|
||||
DEF CONN_01X03 P 0 40 Y N 1 F N
|
||||
F0 "P" 0 200 50 H V C CNN
|
||||
F1 "CONN_01X03" 100 0 50 V V C CNN
|
||||
F2 "" 0 0 50 H V C CNN
|
||||
F3 "" 0 0 50 H V C CNN
|
||||
$FPLIST
|
||||
Pin_Header_Straight_1X03
|
||||
Pin_Header_Angled_1X03
|
||||
Socket_Strip_Straight_1X03
|
||||
Socket_Strip_Angled_1X03
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -50 -95 10 -105 0 1 0 N
|
||||
S -50 5 10 -5 0 1 0 N
|
||||
S -50 105 10 95 0 1 0 N
|
||||
S -50 150 50 -150 0 1 0 N
|
||||
X P1 1 -200 100 150 R 50 50 1 1 P
|
||||
X P2 2 -200 0 150 R 50 50 1 1 P
|
||||
X P3 3 -200 -100 150 R 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# CONN_01X07
|
||||
#
|
||||
DEF CONN_01X07 P 0 40 Y N 1 F N
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue