2021-07-02 22:19:04 +02:00
|
|
|
#ifndef __TX_H
|
|
|
|
|
#define __TX_H
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <arm_math.h>
|
|
|
|
|
|
2022-01-01 02:10:06 +01:00
|
|
|
#define TX_TYPE_NONE 0
|
|
|
|
|
#define TX_TYPE_DAC 1
|
|
|
|
|
#define TX_TYPE_PWM 2
|
|
|
|
|
#define TX_TYPE_SI5351 3
|
|
|
|
|
// #define TX_TYPE TX_TYPE_SI5351
|
|
|
|
|
#define TX_TYPE TX_TYPE_NONE
|
|
|
|
|
|
2021-07-02 22:19:04 +02:00
|
|
|
#define TX_AUDIO_FILTER_INTERPOLATION_FACTOR (16)
|
|
|
|
|
#define TX_AUDIO_FILTER_BLOCK_SIZE (1024)
|
|
|
|
|
#define TX_AUDIO_FILTER_TAP_NUM (128)
|
|
|
|
|
|
2022-01-01 02:10:06 +01:00
|
|
|
// TX DAC
|
|
|
|
|
#define TX_DAC_SAMPLE_RATE (CLOCK/480)
|
|
|
|
|
#define TX_DAC_BUFFER_SIZE (1024)
|
|
|
|
|
#define TX_DAC_BUFFER_RATE (TX_DAC_SAMPLE_RATE/TX_DAC_BUFFER_SIZE)
|
|
|
|
|
|
2021-12-31 04:22:22 +01:00
|
|
|
extern uint8_t tx_signal, tx_signal_last;
|
|
|
|
|
extern q31_t tx_nco1_increment;
|
|
|
|
|
|
2021-07-02 22:19:04 +02:00
|
|
|
// buffer
|
|
|
|
|
extern volatile uint8_t half_tx_dac_buffer_empty, tx_dac_buffer_toggle;
|
|
|
|
|
extern volatile uint8_t tx_adc_buffer_ready;
|
|
|
|
|
|
|
|
|
|
// filtro audio
|
|
|
|
|
extern arm_fir_instance_q31 tx_audio_filter_I_struct, tx_audio_filter_Q_struct;
|
|
|
|
|
extern q31_t tx_audio_filter_I_state[TX_AUDIO_FILTER_BLOCK_SIZE + TX_AUDIO_FILTER_TAP_NUM - 1];
|
|
|
|
|
extern q31_t tx_audio_filter_Q_state[TX_AUDIO_FILTER_BLOCK_SIZE + TX_AUDIO_FILTER_TAP_NUM - 1];
|
|
|
|
|
extern int32_t tx_audio_filter_coeffs[TX_AUDIO_FILTER_TAP_NUM];
|
|
|
|
|
|
|
|
|
|
// modulatori
|
|
|
|
|
|
|
|
|
|
void ssb_modulator(q31_t *in_I, q31_t *in_Q, uint16_t size, q31_t *out, q31_t nco_freq);
|
|
|
|
|
void dc_modulator(q31_t *in, uint16_t size, q31_t *out);
|
|
|
|
|
void am_modulator(q31_t *in_I, q31_t *in_Q, uint16_t size, q31_t *out);
|
|
|
|
|
|
|
|
|
|
#endif
|