//-------------------------------------------------------------------- // M17 C library - lib.c // // Wojciech Kaczmarski, SP5WWP // M17 Project, 5 January 2024 //-------------------------------------------------------------------- #include #include "lib.h" /** * @brief Generate symbol stream for a preamble. * * @param out Frame buffer (192 floats) * @param cnt Pointer to a variable holding the number of written symbols. * @param type Preamble type (pre-BERT or pre-LSF). */ void send_preamble(float out[SYM_PER_FRA], uint32_t *cnt, const uint8_t type) { if(type) //pre-BERT { for(uint16_t i=0; i>(14-i))&3]; } } //send the data (can be used for both LSF and frames) /** * @brief Generate symbol stream for frame contents (without syncword). * Can be used for both LSF and data frames. * * @param out Output buffer (184 floats). * @param cnt Pointer to a variable holding the number of written symbols. * @param in Data input. */ void send_data(float out[SYM_PER_PLD], uint32_t *cnt, const uint8_t* in) { for(uint16_t i=0; i