RS41ng/src/drivers/si4063/si4063.h

32 wiersze
978 B
C
Czysty Zwykły widok Historia

Graw DFM-17 radiosonde support (#61) * Initial plumbing for DFM17 (#54) * Implementing Si4063 radio chip support for DFM17 sonde. Work in progress. * Add an error to indicate that the code does not work yet * Removed copyrighted docs from documentation and provided links instead (#55) * Fix SPI bus initialization for DFM17. Trying to make Si4063 SPI communication work (in progress). Fix LED bit polarity. * Set DFM17 clocks correctly to 24 MHz * Still trying to fix Si4063 SPI communication, no luck * Add clearing of SPI overrun status flag to make Si4063 comm work properly in DFM17. Not sure about the reason this is required. * Fix bug when setting Si4063 frequency. Remove unnecessary GPS debug and delays. Add Si4063 debug printout. Find a suitable frequency offset multiplier to achieve 270 Hz tone spacing for Horus 4FSK. * Add some known good Si4063 configuration values. Implement direct GPIO-based modulation for Si4063 that allows support for CW now. * DFM-17 APRS work (#60) * Modify for APRS on DFM17 * Clean up Si4063 APRS work and make APRS deviation configurable * Add documentation for DFM-17 * Add a note about the DFM-17 connector * More work on docs and config for DFM-17 * Docs * Mor work on config * Fix RS41 URL * Added info about high-altitude balloon flights * Fix typo * More code cleanup * Update authors * Improve DFM-17 docs * Added a timepulse routine for DFM17 and also a millis() routine. Working toward clock calibration. * More refinements to the HCI calibration * Cleaned up clock calibration code and integrated into the main radio loop. Also added APRS telemetry for calibration. * Added logic to (hopefully) avoid over-calibration if there is an errant timepulse. * Clean up DFM-17 clock calibration implementation and make RS41 compile properly * Adjust README * Add notes about DFM-17 clock calibration * Fix typo * Add DFM-17 note about clock calibration to the top of the README * Text style * Working on README * Working on README * Move datasheet links to main README * Markdown styling * Improve config file structure * Remove unnecessary comments --------- Co-authored-by: Mike Hojnowski <kd2eat@gmail.com>
2023-10-15 09:38:05 +00:00
#ifndef __SI4063_H
#define __SI4063_H
#include <stdint.h>
#include <stdbool.h>
typedef enum _si4063_modulation_type {
SI4063_MODULATION_TYPE_CW = 0,
SI4063_MODULATION_TYPE_OOK,
SI4063_MODULATION_TYPE_FSK,
SI4063_MODULATION_TYPE_FIFO_FSK,
Graw DFM-17 radiosonde support (#61) * Initial plumbing for DFM17 (#54) * Implementing Si4063 radio chip support for DFM17 sonde. Work in progress. * Add an error to indicate that the code does not work yet * Removed copyrighted docs from documentation and provided links instead (#55) * Fix SPI bus initialization for DFM17. Trying to make Si4063 SPI communication work (in progress). Fix LED bit polarity. * Set DFM17 clocks correctly to 24 MHz * Still trying to fix Si4063 SPI communication, no luck * Add clearing of SPI overrun status flag to make Si4063 comm work properly in DFM17. Not sure about the reason this is required. * Fix bug when setting Si4063 frequency. Remove unnecessary GPS debug and delays. Add Si4063 debug printout. Find a suitable frequency offset multiplier to achieve 270 Hz tone spacing for Horus 4FSK. * Add some known good Si4063 configuration values. Implement direct GPIO-based modulation for Si4063 that allows support for CW now. * DFM-17 APRS work (#60) * Modify for APRS on DFM17 * Clean up Si4063 APRS work and make APRS deviation configurable * Add documentation for DFM-17 * Add a note about the DFM-17 connector * More work on docs and config for DFM-17 * Docs * Mor work on config * Fix RS41 URL * Added info about high-altitude balloon flights * Fix typo * More code cleanup * Update authors * Improve DFM-17 docs * Added a timepulse routine for DFM17 and also a millis() routine. Working toward clock calibration. * More refinements to the HCI calibration * Cleaned up clock calibration code and integrated into the main radio loop. Also added APRS telemetry for calibration. * Added logic to (hopefully) avoid over-calibration if there is an errant timepulse. * Clean up DFM-17 clock calibration implementation and make RS41 compile properly * Adjust README * Add notes about DFM-17 clock calibration * Fix typo * Add DFM-17 note about clock calibration to the top of the README * Text style * Working on README * Working on README * Move datasheet links to main README * Markdown styling * Improve config file structure * Remove unnecessary comments --------- Co-authored-by: Mike Hojnowski <kd2eat@gmail.com>
2023-10-15 09:38:05 +00:00
} si4063_modulation_type;
void si4063_enable_tx();
void si4063_inhibit_tx();
void si4063_disable_tx();
uint16_t si4063_start_tx(uint8_t *data, int len);
uint16_t si4063_refill_buffer(uint8_t *data, int len);
int si4063_wait_for_tx_complete(int timeout_ms);
bool si4063_fifo_underflow();
Graw DFM-17 radiosonde support (#61) * Initial plumbing for DFM17 (#54) * Implementing Si4063 radio chip support for DFM17 sonde. Work in progress. * Add an error to indicate that the code does not work yet * Removed copyrighted docs from documentation and provided links instead (#55) * Fix SPI bus initialization for DFM17. Trying to make Si4063 SPI communication work (in progress). Fix LED bit polarity. * Set DFM17 clocks correctly to 24 MHz * Still trying to fix Si4063 SPI communication, no luck * Add clearing of SPI overrun status flag to make Si4063 comm work properly in DFM17. Not sure about the reason this is required. * Fix bug when setting Si4063 frequency. Remove unnecessary GPS debug and delays. Add Si4063 debug printout. Find a suitable frequency offset multiplier to achieve 270 Hz tone spacing for Horus 4FSK. * Add some known good Si4063 configuration values. Implement direct GPIO-based modulation for Si4063 that allows support for CW now. * DFM-17 APRS work (#60) * Modify for APRS on DFM17 * Clean up Si4063 APRS work and make APRS deviation configurable * Add documentation for DFM-17 * Add a note about the DFM-17 connector * More work on docs and config for DFM-17 * Docs * Mor work on config * Fix RS41 URL * Added info about high-altitude balloon flights * Fix typo * More code cleanup * Update authors * Improve DFM-17 docs * Added a timepulse routine for DFM17 and also a millis() routine. Working toward clock calibration. * More refinements to the HCI calibration * Cleaned up clock calibration code and integrated into the main radio loop. Also added APRS telemetry for calibration. * Added logic to (hopefully) avoid over-calibration if there is an errant timepulse. * Clean up DFM-17 clock calibration implementation and make RS41 compile properly * Adjust README * Add notes about DFM-17 clock calibration * Fix typo * Add DFM-17 note about clock calibration to the top of the README * Text style * Working on README * Working on README * Move datasheet links to main README * Markdown styling * Improve config file structure * Remove unnecessary comments --------- Co-authored-by: Mike Hojnowski <kd2eat@gmail.com>
2023-10-15 09:38:05 +00:00
void si4063_set_tx_frequency(uint32_t frequency_hz);
void si4063_set_data_rate(const uint32_t rate_bps);
Graw DFM-17 radiosonde support (#61) * Initial plumbing for DFM17 (#54) * Implementing Si4063 radio chip support for DFM17 sonde. Work in progress. * Add an error to indicate that the code does not work yet * Removed copyrighted docs from documentation and provided links instead (#55) * Fix SPI bus initialization for DFM17. Trying to make Si4063 SPI communication work (in progress). Fix LED bit polarity. * Set DFM17 clocks correctly to 24 MHz * Still trying to fix Si4063 SPI communication, no luck * Add clearing of SPI overrun status flag to make Si4063 comm work properly in DFM17. Not sure about the reason this is required. * Fix bug when setting Si4063 frequency. Remove unnecessary GPS debug and delays. Add Si4063 debug printout. Find a suitable frequency offset multiplier to achieve 270 Hz tone spacing for Horus 4FSK. * Add some known good Si4063 configuration values. Implement direct GPIO-based modulation for Si4063 that allows support for CW now. * DFM-17 APRS work (#60) * Modify for APRS on DFM17 * Clean up Si4063 APRS work and make APRS deviation configurable * Add documentation for DFM-17 * Add a note about the DFM-17 connector * More work on docs and config for DFM-17 * Docs * Mor work on config * Fix RS41 URL * Added info about high-altitude balloon flights * Fix typo * More code cleanup * Update authors * Improve DFM-17 docs * Added a timepulse routine for DFM17 and also a millis() routine. Working toward clock calibration. * More refinements to the HCI calibration * Cleaned up clock calibration code and integrated into the main radio loop. Also added APRS telemetry for calibration. * Added logic to (hopefully) avoid over-calibration if there is an errant timepulse. * Clean up DFM-17 clock calibration implementation and make RS41 compile properly * Adjust README * Add notes about DFM-17 clock calibration * Fix typo * Add DFM-17 note about clock calibration to the top of the README * Text style * Working on README * Working on README * Move datasheet links to main README * Markdown styling * Improve config file structure * Remove unnecessary comments --------- Co-authored-by: Mike Hojnowski <kd2eat@gmail.com>
2023-10-15 09:38:05 +00:00
void si4063_set_tx_power(uint8_t power);
void si4063_set_frequency_offset(uint16_t offset);
void si4063_set_frequency_deviation(uint32_t deviation);
void si4063_set_modulation_type(si4063_modulation_type type);
int32_t si4063_read_temperature_celsius_100();
void si4063_set_direct_mode_pin(bool high);
int si4063_init();
#endif