Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
/*
* Copyright 2012-2026 Great Scott Gadgets <info@greatscottgadgets.com>
* Copyright 2014 Jared Boone <jared@sharebrained.com>
*
* This file is part of HackRF.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "fixed_point.h"
#ifdef IS_RAD1O
#include "max2871.h"
#endif
#ifdef IS_NOT_RAD1O
#include "rffc5071.h"
#endif
typedef enum {
RFFC5071_VARIANT,
MAX2871_VARIANT,
} mixer_variant_t;
typedef struct {
mixer_variant_t type;
union {
#ifdef IS_RAD1O
max2871_driver_t max2871;
#endif
#ifdef IS_NOT_RAD1O
rffc5071_driver_t rffc5071;
#endif
};
} mixer_driver_t;
extern void mixer_bus_setup(mixer_driver_t* const mixer);
extern void mixer_setup(mixer_driver_t* const mixer, mixer_variant_t type);
/* Set frequency (Hz). */
extern fp_40_24_t mixer_set_frequency(
mixer_driver_t* const mixer,
fp_40_24_t lo,
bool program);
extern void mixer_enable(mixer_driver_t* const mixer);
extern void mixer_disable(mixer_driver_t* const mixer);
extern void mixer_set_gpo(mixer_driver_t* const drv, uint8_t gpo);
/* Mixer instance. */
extern mixer_driver_t mixer;
7f96cc8e3This file is pinned to the selected release. Download the original to open it in your design tool.