Merge branch 'master' of https://github.com/jboone/hackrf into jboone-master

This commit is contained in:
Dominic Spill
2019-01-30 11:47:30 -07:00
28 changed files with 3788 additions and 294 deletions

View File

@ -25,5 +25,20 @@ set(CMAKE_TOOLCHAIN_FILE toolchain-arm-cortex-m.cmake)
project (hackrf_firmware_all C)
SET(PATH_HACKRF_FIRMWARE ${CMAKE_CURRENT_LIST_DIR})
SET(PATH_HACKRF ${PATH_HACKRF_FIRMWARE}/..)
SET(PATH_HACKRF_FIRMWARE_COMMON ${PATH_HACKRF_FIRMWARE}/common)
SET(LIBOPENCM3 ${PATH_HACKRF_FIRMWARE}/libopencm3)
SET(PATH_DFU_PY ${PATH_HACKRF_FIRMWARE}/dfu.py)
include(ExternalProject)
ExternalProject_Add(libopencm3
SOURCE_DIR "${LIBOPENCM3}"
BUILD_IN_SOURCE true
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
)
add_subdirectory(blinky)
add_subdirectory(hackrf_usb)

View File

@ -18,9 +18,6 @@ submodule:
$ cd ..
$ git submodule init
$ git submodule update
$ cd firmware/libopencm3
$ make
To build and install a standard firmware image for HackRF One:

View File

@ -29,29 +29,45 @@ static refill_buffer_cb refill_buffer;
static uint32_t xsvf_buffer_len, xsvf_pos;
static unsigned char* xsvf_buffer;
void cpld_jtag_setup(jtag_t* const jtag) {
scu_pinmux(SCU_PINMUX_CPLD_TDO, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION4);
scu_pinmux(SCU_PINMUX_CPLD_TCK, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
scu_pinmux(SCU_PINMUX_CPLD_TMS, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
scu_pinmux(SCU_PINMUX_CPLD_TDI, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
void cpld_jtag_take(jtag_t* const jtag) {
const jtag_gpio_t* const gpio = jtag->gpio;
gpio_input(jtag->gpio->gpio_tdo);
gpio_output(jtag->gpio->gpio_tck);
gpio_output(jtag->gpio->gpio_tms);
gpio_output(jtag->gpio->gpio_tdi);
/* Set initial GPIO state to the voltages of the internal or external pull-ups/downs,
* to avoid any glitches.
*/
#ifdef USER_INTERFACE_PORTAPACK
gpio_set(gpio->gpio_pp_tms);
#endif
gpio_set(gpio->gpio_tms);
gpio_set(gpio->gpio_tdi);
gpio_clear(gpio->gpio_tck);
#ifdef USER_INTERFACE_PORTAPACK
/* Do not drive PortaPack-specific TMS pin initially, just to be cautious. */
gpio_input(gpio->gpio_pp_tms);
gpio_input(gpio->gpio_pp_tdo);
#endif
gpio_output(gpio->gpio_tms);
gpio_output(gpio->gpio_tdi);
gpio_output(gpio->gpio_tck);
gpio_input(gpio->gpio_tdo);
}
/* set pins as inputs so we don't interfere with an external JTAG device */
void cpld_jtag_release(jtag_t* const jtag) {
scu_pinmux(SCU_PINMUX_CPLD_TDO, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION4);
scu_pinmux(SCU_PINMUX_CPLD_TCK, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
scu_pinmux(SCU_PINMUX_CPLD_TMS, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
scu_pinmux(SCU_PINMUX_CPLD_TDI, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
const jtag_gpio_t* const gpio = jtag->gpio;
gpio_input(jtag->gpio->gpio_tdo);
gpio_input(jtag->gpio->gpio_tck);
gpio_input(jtag->gpio->gpio_tms);
gpio_input(jtag->gpio->gpio_tdi);
/* Make all pins inputs when JTAG interface not active.
* Let the pull-ups/downs do the work.
*/
#ifdef USER_INTERFACE_PORTAPACK
/* Do not drive PortaPack-specific pins, initially, just to be cautious. */
gpio_input(gpio->gpio_pp_tms);
gpio_input(gpio->gpio_pp_tdo);
#endif
gpio_input(gpio->gpio_tms);
gpio_input(gpio->gpio_tdi);
gpio_input(gpio->gpio_tck);
gpio_input(gpio->gpio_tdo);
}
/* return 0 if success else return error code see xsvfExecute() */
@ -62,7 +78,7 @@ int cpld_jtag_program(
refill_buffer_cb refill
) {
int error;
cpld_jtag_setup(jtag);
cpld_jtag_take(jtag);
xsvf_buffer = buffer;
xsvf_buffer_len = buffer_length;
refill_buffer = refill;

View File

@ -31,6 +31,10 @@ typedef struct jtag_gpio_t {
gpio_t gpio_tck;
gpio_t gpio_tdi;
gpio_t gpio_tdo;
#ifdef USER_INTERFACE_PORTAPACK
gpio_t gpio_pp_tms;
gpio_t gpio_pp_tdo;
#endif
} jtag_gpio_t;
typedef struct jtag_t {
@ -39,6 +43,7 @@ typedef struct jtag_t {
typedef void (*refill_buffer_cb)(void);
void cpld_jtag_take(jtag_t* const jtag);
void cpld_jtag_release(jtag_t* const jtag);
/* Return 0 if success else return error code see xsvfExecute() see micro.h.

View File

@ -14,4 +14,8 @@ void hackrf_ui_setBBLNAGain(const uint32_t gain_db) __attribute__((weak));
void hackrf_ui_setBBVGAGain(const uint32_t gain_db) __attribute__((weak));
void hackrf_ui_setBBTXVGAGain(const uint32_t gain_db) __attribute__((weak));
void hackrf_ui_setFirstIFFrequency(const uint64_t freq) __attribute__((weak));
void hackrf_ui_setFilter(const rf_path_filter_t filter) __attribute__((weak));
void hackrf_ui_setAntennaBias(bool antenna_bias) __attribute__((weak));
#endif

View File

@ -33,6 +33,7 @@
#include "w25q80bv_target.h"
#include "i2c_bus.h"
#include "i2c_lpc.h"
#include "cpld_jtag.h"
#include <libopencm3/lpc43xx/cgu.h>
#include <libopencm3/lpc43xx/ccu.h>
#include <libopencm3/lpc43xx/scu.h>
@ -123,6 +124,11 @@ static struct gpio_t gpio_cpld_tms = GPIO(3, 1);
static struct gpio_t gpio_cpld_tdi = GPIO(3, 4);
#endif
#ifdef USER_INTERFACE_PORTAPACK
static struct gpio_t gpio_cpld_pp_tms = GPIO(1, 1);
static struct gpio_t gpio_cpld_pp_tdo = GPIO(1, 8);
#endif
static struct gpio_t gpio_hw_sync_enable = GPIO(5,12);
static struct gpio_t gpio_rx_q_invert = GPIO(0, 13);
@ -270,6 +276,10 @@ jtag_gpio_t jtag_gpio_cpld = {
.gpio_tck = &gpio_cpld_tck,
.gpio_tdi = &gpio_cpld_tdi,
.gpio_tdo = &gpio_cpld_tdo,
#ifdef USER_INTERFACE_PORTAPACK
.gpio_pp_tms = &gpio_cpld_pp_tms,
.gpio_pp_tdo = &gpio_cpld_pp_tdo,
#endif
};
jtag_t jtag_cpld = {
@ -750,16 +760,31 @@ void ssp1_set_mode_max5864(void)
}
void pin_setup(void) {
/* Release CPLD JTAG pins */
scu_pinmux(SCU_PINMUX_CPLD_TDO, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION4);
scu_pinmux(SCU_PINMUX_CPLD_TCK, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
/* Configure all GPIO as Input (safe state) */
gpio_init();
/* TDI and TMS pull-ups are required in all JTAG-compliant devices.
*
* The HackRF CPLD is always present, so let the CPLD pull up its TDI and TMS.
*
* The PortaPack may not be present, so pull up the PortaPack TMS pin from the
* microcontroller.
*
* TCK is recommended to be held low, so use microcontroller pull-down.
*
* TDO is undriven except when in Shift-IR or Shift-DR phases.
* Use the microcontroller to pull down to keep from floating.
*
* LPC43xx pull-up and pull-down resistors are approximately 53K.
*/
#ifdef USER_INTERFACE_PORTAPACK
scu_pinmux(SCU_PINMUX_PP_TMS, SCU_GPIO_PUP | SCU_CONF_FUNCTION0);
scu_pinmux(SCU_PINMUX_PP_TDO, SCU_GPIO_PDN | SCU_CONF_FUNCTION0);
#endif
scu_pinmux(SCU_PINMUX_CPLD_TMS, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
scu_pinmux(SCU_PINMUX_CPLD_TDI, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
gpio_input(&gpio_cpld_tdo);
gpio_input(&gpio_cpld_tck);
gpio_input(&gpio_cpld_tms);
gpio_input(&gpio_cpld_tdi);
scu_pinmux(SCU_PINMUX_CPLD_TDO, SCU_GPIO_PDN | SCU_CONF_FUNCTION4);
scu_pinmux(SCU_PINMUX_CPLD_TCK, SCU_GPIO_PDN | SCU_CONF_FUNCTION0);
/* Configure SCU Pin Mux as GPIO */
scu_pinmux(SCU_PINMUX_LED1, SCU_GPIO_NOPULL);
@ -769,17 +794,12 @@ void pin_setup(void) {
scu_pinmux(SCU_PINMUX_LED4, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION4);
#endif
scu_pinmux(SCU_PINMUX_EN1V8, SCU_GPIO_NOPULL);
/* Configure USB indicators */
#ifdef JAWBREAKER
scu_pinmux(SCU_PINMUX_USB_LED0, SCU_CONF_FUNCTION3);
scu_pinmux(SCU_PINMUX_USB_LED1, SCU_CONF_FUNCTION3);
#endif
/* Configure all GPIO as Input (safe state) */
gpio_init();
gpio_output(&gpio_led[0]);
gpio_output(&gpio_led[1]);
gpio_output(&gpio_led[2]);
@ -787,7 +807,9 @@ void pin_setup(void) {
gpio_output(&gpio_led[3]);
#endif
disable_1v8_power();
gpio_output(&gpio_1v8_enable);
scu_pinmux(SCU_PINMUX_EN1V8, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0);
#ifdef HACKRF_ONE
/* Safe state: start with VAA turned off: */
@ -796,18 +818,20 @@ void pin_setup(void) {
/* Configure RF power supply (VAA) switch control signal as output */
gpio_output(&gpio_vaa_disable);
#ifndef USER_INTERFACE_PORTAPACK
/* Not sure why this is necessary for stock HackRF. Just "rhyming" with the RAD1O code? */
scu_pinmux(SCU_PINMUX_GPIO3_10, SCU_GPIO_PDN | SCU_CONF_FUNCTION0);
scu_pinmux(SCU_PINMUX_GPIO3_11, SCU_GPIO_PDN | SCU_CONF_FUNCTION0);
#endif
#endif
#ifdef RAD1O
/* Configure RF power supply (VAA) switch control signal as output */
gpio_output(&gpio_vaa_enable);
/* Safe state: start with VAA turned off: */
disable_rf_power();
/* Configure RF power supply (VAA) switch control signal as output */
gpio_output(&gpio_vaa_enable);
/* Disable unused clock outputs. They generate noise. */
scu_pinmux(CLK0, SCU_CLK_IN | SCU_CONF_FUNCTION7);
scu_pinmux(CLK2, SCU_CLK_IN | SCU_CONF_FUNCTION7);

View File

@ -77,8 +77,16 @@ extern "C"
/* GPIO Input PinMux */
#define SCU_PINMUX_BOOT0 (P1_1) /* GPIO0[8] on P1_1 */
#define SCU_PINMUX_BOOT1 (P1_2) /* GPIO0[9] on P1_2 */
#ifdef USER_INTERFACE_PORTAPACK
#define SCU_PINMUX_PP_LCD_TE (P2_3) /* GPIO5[3] on P2_3 */
#define SCU_PINMUX_PP_LCD_RDX (P2_4) /* GPIO5[4] on P2_4 */
#define SCU_PINMUX_PP_UNUSED (P2_8) /* GPIO5[7] on P2_8 */
#define SCU_PINMUX_PP_LCD_WRX (P2_9) /* GPIO1[10] on P2_9 */
#define SCU_PINMUX_PP_DIR (P2_13) /* GPIO1[13] on P2_13 */
#else
#define SCU_PINMUX_BOOT2 (P2_8) /* GPIO5[7] on P2_8 */
#define SCU_PINMUX_BOOT3 (P2_9) /* GPIO1[10] on P2_9 */
#endif
/* USB peripheral */
#ifdef JAWBREAKER
@ -206,6 +214,14 @@ extern "C"
#define SCU_RX_LNA (P6_7) /* GPIO5[15] on P6_7 */
#endif
#define SCU_PINMUX_PP_D0 (P7_0) /* GPIO3[8] */
#define SCU_PINMUX_PP_D1 (P7_1) /* GPIO3[9] */
#define SCU_PINMUX_PP_D2 (P7_2) /* GPIO3[10] */
#define SCU_PINMUX_PP_D3 (P7_3) /* GPIO3[11] */
#define SCU_PINMUX_PP_D4 (P7_4) /* GPIO3[12] */
#define SCU_PINMUX_PP_D5 (P7_5) /* GPIO3[13] */
#define SCU_PINMUX_PP_D6 (P7_6) /* GPIO3[14] */
#define SCU_PINMUX_PP_D7 (P7_7) /* GPIO3[15] */
/* TODO add other Pins */
#define SCU_PINMUX_GPIO3_8 (P7_0) /* GPIO3[8] */
#define SCU_PINMUX_GPIO3_9 (P7_1) /* GPIO3[9] */
@ -216,8 +232,10 @@ extern "C"
#define SCU_PINMUX_GPIO3_14 (P7_6) /* GPIO3[14] */
#define SCU_PINMUX_GPIO3_15 (P7_7) /* GPIO3[15] */
#define SCU_PINMUX_PP_TDO (P1_5) /* GPIO1[8] */
#define SCU_PINMUX_SD_POW (P1_5) /* GPIO1[8] */
#define SCU_PINMUX_SD_CMD (P1_6) /* GPIO1[9] */
#define SCU_PINMUX_PP_TMS (P1_8) /* GPIO1[1] */
#define SCU_PINMUX_SD_VOLT0 (P1_8) /* GPIO1[1] */
#define SCU_PINMUX_SD_DAT0 (P1_9) /* GPIO1[2] */
#define SCU_PINMUX_SD_DAT1 (P1_10) /* GPIO1[3] */
@ -225,6 +243,8 @@ extern "C"
#define SCU_PINMUX_SD_DAT3 (P1_12) /* GPIO1[5] */
#define SCU_PINMUX_SD_CD (P1_13) /* GPIO1[6] */
#define SCU_PINMUX_PP_IO_STBX (P2_0) /* GPIO5[0] */
#define SCU_PINMUX_PP_ADDR (P2_1) /* GPIO5[1] */
#define SCU_PINMUX_U0_TXD (P2_0) /* GPIO5[0] */
#define SCU_PINMUX_U0_RXD (P2_1) /* GPIO5[1] */

View File

@ -66,3 +66,14 @@ void i2c_lpc_transfer(i2c_bus_t* const bus,
i2c_stop(port);
}
bool i2c_probe(i2c_bus_t* const bus, const uint_fast8_t device_address) {
const uint32_t port = (uint32_t)bus->obj;
i2c_tx_start(port);
i2c_tx_byte(port, (device_address << 1) | I2C_WRITE);
const bool detected = (I2C_STAT(port) == 0x18);
i2c_stop(port);
return detected;
}

View File

@ -24,6 +24,7 @@
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "i2c_bus.h"
@ -38,5 +39,6 @@ void i2c_lpc_transfer(i2c_bus_t* const bus,
const uint8_t* const data_tx, const size_t count_tx,
uint8_t* const data_rx, const size_t count_rx
);
bool i2c_probe(i2c_bus_t* const bus, const uint_fast8_t device_address);
#endif/*__I2C_LPC_H__*/

View File

@ -415,6 +415,8 @@ void rf_path_set_filter(rf_path_t* const rf_path, const rf_path_filter_t filter)
}
switchctrl_set(rf_path, rf_path->switchctrl);
hackrf_ui_setFilter(filter);
}
void rf_path_set_lna(rf_path_t* const rf_path, const uint_fast8_t enable) {
@ -447,4 +449,6 @@ void rf_path_set_antenna(rf_path_t* const rf_path, const uint_fast8_t enable) {
}
switchctrl_set(rf_path, rf_path->switchctrl);
hackrf_ui_setAntennaBias(enable);
}

View File

@ -157,7 +157,7 @@ void sgpio_configure(
const uint_fast8_t pos = config->slice_mode_multislice ? 0x1f : 0x03;
const bool single_slice = !config->slice_mode_multislice;
const uint_fast8_t slice_count = config->slice_mode_multislice ? 8 : 1;
const uint_fast8_t clk_capture_mode = (direction == SGPIO_DIRECTION_TX) ? 0 : 1;
const uint_fast8_t clk_capture_mode = (direction == SGPIO_DIRECTION_TX) ? 0 : 0;
uint32_t slice_enable_mask = 0;
/* Configure Slice A, I, E, J, C, K, F, L (sgpio_slice_mode_multislice mode) */

View File

@ -185,8 +185,8 @@ void si5351c_configure_clock_control(si5351c_driver_t* const drv, const enum pll
/* Clock to CPU is deactivated as it is not used and creates noise */
/* External clock output is deactivated as it is not used and creates noise */
uint8_t data[] = {16
,SI5351C_CLK_FRAC_MODE | SI5351C_CLK_PLL_SRC(pll) | SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_SELF) | SI5351C_CLK_IDRV(SI5351C_CLK_IDRV_2MA)
,SI5351C_CLK_INT_MODE | SI5351C_CLK_PLL_SRC(pll) | SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_0_4) | SI5351C_CLK_IDRV(SI5351C_CLK_IDRV_2MA)
,SI5351C_CLK_FRAC_MODE | SI5351C_CLK_PLL_SRC(pll) | SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_SELF) | SI5351C_CLK_IDRV(SI5351C_CLK_IDRV_8MA)
,SI5351C_CLK_INT_MODE | SI5351C_CLK_PLL_SRC(pll) | SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_0_4) | SI5351C_CLK_IDRV(SI5351C_CLK_IDRV_2MA) | SI5351C_CLK_INV
,SI5351C_CLK_INT_MODE | SI5351C_CLK_PLL_SRC(pll) | SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_0_4) | SI5351C_CLK_IDRV(SI5351C_CLK_IDRV_2MA)
,SI5351C_CLK_POWERDOWN | SI5351C_CLK_INT_MODE /*not connected, but: plla int mode*/
,SI5351C_CLK_INT_MODE | SI5351C_CLK_PLL_SRC(pll) | SI5351C_CLK_SRC(SI5351C_CLK_SRC_MULTISYNTH_SELF) | SI5351C_CLK_IDRV(SI5351C_CLK_IDRV_6MA) | SI5351C_CLK_INV

View File

@ -116,7 +116,9 @@ bool set_freq(const uint64_t freq)
if( success ) {
freq_cache = freq;
hackrf_ui_setFrequency(freq);
#ifndef USER_INTERFACE_PORTAPACK
operacake_set_range(freq_mhz);
#endif
}
return success;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
/*
* Copyright 2018 Jared Boone
*
* 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.
*/
#ifndef __UI_PORTAPACK_H__
#define __UI_PORTAPACK_H__
#include <stddef.h>
typedef struct ui_color_t {
uint16_t v;
} ui_color_t;
typedef struct ui_point_t {
int16_t x;
int16_t y;
} ui_point_t;
typedef struct ui_size_t {
int16_t width;
int16_t height;
} ui_size_t;
typedef struct ui_rect_t {
ui_point_t point;
ui_size_t size;
} ui_rect_t;
typedef struct ui_bitmap_t {
ui_size_t size;
const uint8_t* const data;
} ui_bitmap_t;
typedef struct ui_font_t {
const ui_size_t glyph_size;
const uint8_t* const data;
char c_start;
size_t c_count;
size_t data_stride;
} ui_font_t;
typedef void (*hackrf_ui_init_fn)(void);
typedef void (*hackrf_ui_set_frequency_fn)(uint64_t frequency);
typedef void (*hackrf_ui_set_sample_rate_fn)(uint32_t sample_rate);
typedef void (*hackrf_ui_set_direction_fn)(const rf_path_direction_t direction);
typedef void (*hackrf_ui_set_filter_bw_fn)(uint32_t bandwidth);
typedef void (*hackrf_ui_set_lna_power_fn)(bool lna_on);
typedef void (*hackrf_ui_set_bb_lna_gain_fn)(const uint32_t gain_db);
typedef void (*hackrf_ui_set_bb_vga_gain_fn)(const uint32_t gain_db);
typedef void (*hackrf_ui_set_bb_tx_vga_gain_fn)(const uint32_t gain_db);
typedef void (*hackrf_ui_set_first_if_frequency_fn)(const uint64_t frequency);
typedef void (*hackrf_ui_set_filter_fn)(const rf_path_filter_t filter);
typedef void (*hackrf_ui_set_antenna_bias_fn)(bool antenna_bias);
typedef struct {
hackrf_ui_init_fn init;
hackrf_ui_set_frequency_fn set_frequency;
hackrf_ui_set_sample_rate_fn set_sample_rate;
hackrf_ui_set_direction_fn set_direction;
hackrf_ui_set_filter_bw_fn set_filter_bw;
hackrf_ui_set_lna_power_fn set_lna_power;
hackrf_ui_set_bb_lna_gain_fn set_bb_lna_gain;
hackrf_ui_set_bb_vga_gain_fn set_bb_vga_gain;
hackrf_ui_set_bb_tx_vga_gain_fn set_bb_tx_vga_gain;
hackrf_ui_set_first_if_frequency_fn set_first_if_frequency;
hackrf_ui_set_filter_fn set_filter;
hackrf_ui_set_antenna_bias_fn set_antenna_bias;
} hackrf_ui_t;
#endif/*__UI_PORTAPACK_H__*/

View File

@ -0,0 +1,47 @@
# xst -intstyle ise -ifn top.xst -ofn top.syr
# ngdbuild -intstyle ise -dd _ngo -uc top.ucf -p xc2c64a-VQ100-7 top.ngc top.ngd
# cpldfit -intstyle ise -p xc2c64a-7-VQ100 -ofmt vhdl -optimize density -loc on -slew slow -init low -inputs 32 -pterms 28 -unused pullup -terminate float -iostd LVCMOS33 top.ngd
# tsim -intstyle ise top top.nga
# taengine -intstyle ise -f top -l top.tim -e {taengine.err}
# hprep6 -s IEEE1149 -i top
# vhdtdtfi -prj sgpio_if -o top.vhi -module top -template /opt/Xilinx/14.7/ISE_DS/ISE/data/vhdlinst.tft -deleteonerror -lib work top.vhd
DESIGN=top
DEVICE=xc2c64a
DEVICE_SPEED=7
DEVICE_PACKAGE=VQ100
OUTFILES_XST=$(DESIGN).ngc $(DESIGN).syr $(DESIGN).ngr $(DESIGN)_xst.xrpt $(DESIGN).lso _xmsgs/xst.xmsgs
OUTFILES_NGDBUILD=$(DESIGN).ngd $(DESIGN).bld $(DESIGN)_ngdbuild.xrpt _xmsgs/ngdbuild.xmsgs _ngo/netlist.lst xlnx_auto_0_xdb/cst.xbcd
OUTFILES_CPLDFIT=$(DESIGN).vm6 $(DESIGN).tspec t6.phd t6.dat t55.phd t55.dat t1.phd t1.dat $(DESIGN).log $(DESIGN).chk $(DESIGN).rpt $(DESIGN).xml $(DESIGN)_build.xml $(DESIGN).pad $(DESIGN)_pad.csv $(DESIGN).pnx $(DESIGN).mfd $(DESIGN).cxt $(DESIGN).gyd _xmsgs/cpldfit.xmsgs
OUTFILES_HPREP6=$(DESIGN).jed tmperr.err _xmsgs/hprep6.xmsgs
OUTFILES_IMPACT_SVF=default.svf _impactbatch.log
OUTFILES_IMPACT_XSVF=default.xsvf _impactbatch.log
all: default.svf default.xsvf
$(DESIGN).ngc: $(DESIGN).xst $(DESIGN).prj
mkdir -p xst/projnav.tmp
xst -intstyle ise -ifn $(DESIGN).xst -ofn $(DESIGN).syr
$(DESIGN).ngd: $(DESIGN).ngc $(DESIGN).ucf
ngdbuild -intstyle ise -dd _ngo -uc $(DESIGN).ucf -p $(DEVICE)-$(DEVICE_PACKAGE)-$(DEVICE_SPEED) $(DESIGN).ngc $(DESIGN).ngd
$(DESIGN).vm6: $(DESIGN).ngd
cpldfit -intstyle ise -p $(DEVICE)-$(DEVICE_SPEED)-$(DEVICE_PACKAGE) -ofmt vhdl -optimize speed -loc on -slew slow -init low -inputs 32 -pterms 36 -unused pullup -terminate float -iostd LVCMOS33 $(DESIGN).ngd
$(DESIGN).jed: $(DESIGN).vm6
hprep6 -s IEEE1149 -i $(DESIGN).vm6
default.svf: $(DESIGN).jed batch_svf
impact -batch batch_svf
default.xsvf: $(DESIGN).jed batch_xsvf
impact -batch batch_xsvf
.PHONY: clean
clean:
rm -f $(OUTFILES_XST) $(OUTFILES_NGDBUILD) $(OUTFILES_CPLDFIT) $(OUTFILES_HPREP6) $(OUTFILES_IMPACT_SVF) $(OUTFILES_IMPACT_XSVF)
rm -rf xlnx_auto_0_xdb/ _ngo/ _xmsgs/ xst/

View File

@ -0,0 +1,7 @@
setMode -bscan
setCable -port svf -file default.svf
addDevice -p 1 -file top.jed
Erase -p 1
Program -p 1 -e -v
Verify -p 1
quit

View File

@ -0,0 +1,7 @@
setMode -bscan
setCable -port xsvf -file default.xsvf
addDevice -p 1 -file top.jed
Erase -p 1
Program -p 1 -e -v
Verify -p 1
quit

File diff suppressed because it is too large Load Diff

BIN
firmware/cpld/sgpio_if/default.xsvf Executable file → Normal file

Binary file not shown.

View File

@ -43,7 +43,7 @@
<property xil_pn:name="Case Implementation Style" xil_pn:value="None" xil_pn:valueState="default"/>
<property xil_pn:name="Clock Enable" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Collapsing Input Limit (4-40)" xil_pn:value="32" xil_pn:valueState="default"/>
<property xil_pn:name="Collapsing Pterm Limit (3-56)" xil_pn:value="28" xil_pn:valueState="default"/>
<property xil_pn:name="Collapsing Pterm Limit (3-56)" xil_pn:value="36" xil_pn:valueState="default"/>
<property xil_pn:name="Compile CPLD Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Compile SIMPRIM (Timing) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Compile UNISIM (Functional) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
@ -80,9 +80,9 @@
<property xil_pn:name="Global Tristate Port Name" xil_pn:value="GTS_PORT" xil_pn:valueState="default"/>
<property xil_pn:name="HDL Equations Style" xil_pn:value="Source" xil_pn:valueState="default"/>
<property xil_pn:name="Hierarchy Separator" xil_pn:value="/" xil_pn:valueState="default"/>
<property xil_pn:name="I/O Voltage Standard" xil_pn:value="LVCMOS18" xil_pn:valueState="default"/>
<property xil_pn:name="I/O Voltage Standard" xil_pn:value="LVCMOS33" xil_pn:valueState="non-default"/>
<property xil_pn:name="ISim UUT Instance Name" xil_pn:value="UUT" xil_pn:valueState="default"/>
<property xil_pn:name="Implementation Template" xil_pn:value="Optimize Density" xil_pn:valueState="default"/>
<property xil_pn:name="Implementation Template" xil_pn:value="Optimize Speed" xil_pn:valueState="non-default"/>
<property xil_pn:name="Implementation Top" xil_pn:value="Architecture|top|Behavioral" xil_pn:valueState="non-default"/>
<property xil_pn:name="Implementation Top File" xil_pn:value="top.vhd" xil_pn:valueState="non-default"/>
<property xil_pn:name="Implementation Top Instance Path" xil_pn:value="/top" xil_pn:valueState="non-default"/>
@ -91,7 +91,7 @@
<property xil_pn:name="Include UNISIM Models in Verilog File" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Include sdf_annotate task in Verilog File" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Incremental Compilation" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Input and tristate I/O Termination Mode" xil_pn:value="Keeper" xil_pn:valueState="default"/>
<property xil_pn:name="Input and tristate I/O Termination Mode" xil_pn:value="Float" xil_pn:valueState="non-default"/>
<property xil_pn:name="Insert Buffers to Prevent Pulse Swallowing" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Instantiation Template Target Language Xps" xil_pn:value="VHDL" xil_pn:valueState="default"/>
<property xil_pn:name="Keep Hierarchy" xil_pn:value="No" xil_pn:valueState="default"/>
@ -103,7 +103,7 @@
<property xil_pn:name="Launch SDK after Export" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Library for Verilog Sources" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Load glbl" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Logic Optimization" xil_pn:value="Density" xil_pn:valueState="default"/>
<property xil_pn:name="Logic Optimization" xil_pn:value="Speed" xil_pn:valueState="default"/>
<property xil_pn:name="Macro Preserve" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Manual Implementation Compile Order" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Max Fanout" xil_pn:value="100000" xil_pn:valueState="non-default"/>
@ -131,7 +131,7 @@
<property xil_pn:name="Other XST Command Line Options" xil_pn:value="" xil_pn:valueState="default"/>
<property xil_pn:name="Output Extended Identifiers" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Output File Name" xil_pn:value="top" xil_pn:valueState="default"/>
<property xil_pn:name="Output Slew Rate" xil_pn:value="Fast" xil_pn:valueState="default"/>
<property xil_pn:name="Output Slew Rate" xil_pn:value="Slow" xil_pn:valueState="non-default"/>
<property xil_pn:name="Overwrite Compiled Libraries" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Package" xil_pn:value="VQ100" xil_pn:valueState="non-default"/>
<property xil_pn:name="Port to be used" xil_pn:value="Auto - default" xil_pn:valueState="default"/>
@ -180,7 +180,7 @@
<property xil_pn:name="Timing Report Format" xil_pn:value="Summary" xil_pn:valueState="default"/>
<property xil_pn:name="Top-Level Source Type" xil_pn:value="HDL" xil_pn:valueState="default"/>
<property xil_pn:name="Tristate On Configuration Pulse Width" xil_pn:value="0" xil_pn:valueState="default"/>
<property xil_pn:name="Unused I/O Pad Termination Mode" xil_pn:value="Keeper" xil_pn:valueState="default"/>
<property xil_pn:name="Unused I/O Pad Termination Mode" xil_pn:value="Pullup" xil_pn:valueState="non-default"/>
<property xil_pn:name="Use 64-bit PlanAhead on 64-bit Systems" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Project File Behavioral" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Project File Fit" xil_pn:value="false" xil_pn:valueState="default"/>
@ -194,7 +194,7 @@
<property xil_pn:name="Use Custom Waveform Configuration File Par" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Custom Waveform Configuration File Translate" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Data Gate" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Use Direct Input for Input Registers" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Use Direct Input for Input Registers" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Use Global Clocks" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Use Global Output Enables" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Use Global Set/Reset" xil_pn:value="true" xil_pn:valueState="default"/>

356
firmware/cpld/sgpio_if/top.jed Executable file → Normal file
View File

@ -1,5 +1,5 @@
Programmer Jedec Bit Map
Date Extracted: Mon May 15 14:19:25 2017
Date Extracted: Mon Jan 21 16:17:38 2019
QF25812*
QP100*
@ -13,22 +13,22 @@ N DEVICE XC2C64A-7-VQ100*
Note Block 0 *
Note Block 0 ZIA *
L000000 1111111111111111*
L000016 1111111111111111*
L000032 1111111011110011*
L000048 1111111111111111*
L000064 1111111111111111*
L000080 1111111011010111*
L000016 1111111011010111*
L000032 1111111011010111*
L000048 1111111011010111*
L000064 1111111011010111*
L000080 1111111111111111*
L000096 1111111111111111*
L000112 1111111111111111*
L000128 1111111011010111*
L000144 1111111111111111*
L000160 1111111111111111*
L000128 1111111111111111*
L000144 1111111011010111*
L000160 1111111011100111*
L000176 1111111111111111*
L000192 1111111111111111*
L000208 1111111111111111*
L000224 1111111111111111*
L000240 1111111111111111*
L000256 1111111111111111*
L000224 1111111011100111*
L000240 1111111011110011*
L000256 1111111011100111*
L000272 1111111111111111*
L000288 1111111111111111*
L000304 1111111111111111*
@ -54,8 +54,8 @@ L000608 1111111111111111*
L000624 1111111111111111*
Note Block 0 PLA AND array *
L000640 11111111111011111111111111111111111111111111111111111111111111111111111111111111*
L000720 11110111111111110111111111111111111111111111111111111111111111111111111111111111*
L000640 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L000720 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L000800 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L000880 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L000960 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
@ -85,35 +85,35 @@ L002800 111111111111111111111111111111111111111111111111111111111111111111111111
L002880 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L002960 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003040 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003120 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003120 11111111111111111111111111110111111111111111111111111111111111111111111111111111*
L003200 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003280 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003360 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003360 11011111111111111111111111111111111111111111111111111111111111111111111111111111*
L003440 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003520 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003600 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003600 11110111111111111111111111111111111111111111111111111111111111111111111111111111*
L003680 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003760 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003840 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003840 11111111011111111111111111111111111111111111111111111111111111111111111111111111*
L003920 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004000 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004080 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004080 11111101111111111111111111111111111111111111111111111111111111111111111111111111*
L004160 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004240 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004320 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004320 11111111111111111101111111111111111111111111111111111111111111111111111111111111*
L004400 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004480 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004560 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004560 11111111111111111111011111111111111111111111111111111111111111111111111111111111*
L004640 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004720 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004800 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004800 11111111111111111111111111111111011111111111111111111111111111111111111111111111*
L004880 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004960 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L005040 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L005040 11111111111111111111111111111101111111111111111111111111111111111111111111111111*
Note Block 0 PLA OR array *
L005120 1111111111111110*
L005136 1111111111111110*
L005120 1111111111111111*
L005136 1111111111111111*
L005152 1111111111111111*
L005168 1111111111111111*
L005184 1111111111111111*
@ -178,39 +178,39 @@ L006097 000001111001111110011111100*
L006124 000001111001111110011111100*
L006151 000001111001111110011111100*
L006178 000001111001111110011111100*
L006205 000001111001111110011111100*
L006232 000001111001111110011111100*
L006259 000001111001111110011111100*
L006286 000001111001111110011111100*
L006313 000001111001111110011111100*
L006340 000001111001111110011111100*
L006367 000001111001111110011111100*
L006394 000001111001111110011111100*
L006421 000001111001100110011111101*
L006205 010101111001110111011111101*
L006232 010101111001110111011111101*
L006259 010101111001110111011111101*
L006286 010101111001110111011111101*
L006313 010101111001110111011111101*
L006340 010101111001110111011111101*
L006367 010101111001110111011111101*
L006394 010101111001110111011111101*
L006421 010101111001110111011111101*
Note Block 1 *
Note Block 1 ZIA *
L006448 1111111111111111*
L006464 1110101011111111*
L006480 1111111011010111*
L006496 1111111011010111*
L006512 1111111011010111*
L006480 1110101011111111*
L006496 1110101011111111*
L006512 1111111111111111*
L006528 1111111011010111*
L006544 1111111111111111*
L006544 1110101011111111*
L006560 1111111111111111*
L006576 1111111011010111*
L006592 1111111011010111*
L006608 1111111011100111*
L006576 1110101011111111*
L006592 1110101011111111*
L006608 1110101011111111*
L006624 1111111111111111*
L006640 1111111111111111*
L006656 1111111111111111*
L006672 1111111011100111*
L006688 1111111011110011*
L006704 1111111011100111*
L006656 1110110011111111*
L006672 1111111111111111*
L006688 1111111111111111*
L006704 1110110011111111*
L006720 1111111111111111*
L006736 1111111111111111*
L006736 1111111011010111*
L006752 1111111111111111*
L006768 1111111011010111*
L006768 1111111111111111*
L006784 1111111111111111*
L006800 1111111111111111*
L006816 1111111111111111*
@ -232,32 +232,32 @@ L007056 1111111111111111*
L007072 1111111111111111*
Note Block 1 PLA AND array *
L007088 11111111110111110111111111111101011111111111111111111111111111111111111111111111*
L007168 11101111111111111111111111111111101111111111111111111111111111111111111111111111*
L007248 11111111110111110111011111111101111111111111111111111111111111111111111111111111*
L007328 11101111111111111111101111111111111111111111111111111111111111111111111111111111*
L007408 11111111110111110101111111111101111111111111111111111111111111111111111111111111*
L007488 11101111111111111110111111111111111111111111111111111111111111111111111111111111*
L007568 11111101110111110111111111111101111111111111111111111111111111111111111111111111*
L007648 11101110111111111111111111111111111111111111111111111111111111111111111111111111*
L007728 11111111010111110111111111111101111111111111111111111111111111111111111111111111*
L007808 11101111101111111111111111111111111111111111111111111111111111111111111111111111*
L007888 11110111110111110111111111111101111111111111111111111111111111111111111111111111*
L007968 11101011111111111111111111111111111111111111111111111111111111111111111111111111*
L008048 11111111110111110111111111111101111111110111111111111111111111111111111111111111*
L008128 11101111111111111111111111111111111111111011111111111111111111111111111111111111*
L008208 11111111110111110111111111110101111111111111111111111111111111111111111111111111*
L008288 11101111111111111111111111111011111111111111111111111111111111111111111111111111*
L007088 11011111110111111111111111111111111101111111111111111111111111111111111111111111*
L007168 11111111111011111111111111111111111111111111111111111111111111111111111111111111*
L007248 11011111111111111111111111111111111101111111111111111111111111111111111111111111*
L007328 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007408 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007488 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007568 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007648 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007728 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007808 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007888 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007968 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008048 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008128 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008208 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008288 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008368 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008448 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008528 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008608 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008608 11111111110111111111111111101111111111111111111111111111111111111111111111111111*
L008688 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008768 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008848 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008848 11111111110111111111111111111111101111111111111111111111111111111111111111111111*
L008928 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009008 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009088 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009088 11111011110111111111111111111111111111111111111111111111111111111111111111111111*
L009168 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009248 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009328 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
@ -266,46 +266,46 @@ L009488 111111111111111111111111111111111111111111111111111111111111111111111111
L009568 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009648 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009728 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009808 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009808 11111111110111111110111111111111111111111111111111111111111111111111111111111111*
L009888 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009968 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010048 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010128 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010208 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010288 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010288 11111110110111111111111111111111111111111111111111111111111111111111111111111111*
L010368 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010448 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010528 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010528 11111111110111111111101111111111111111111111111111111111111111111111111111111111*
L010608 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010688 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010768 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010768 11111111110110111111111111111111111111111111111111111111111111111111111111111111*
L010848 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010928 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011008 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011008 11111111110111111011111111111111111111111111111111111111111111111111111111111111*
L011088 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011168 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011248 11011111111111111111111111111111111111111111111111111111111111111111111111111111*
L011248 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011328 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011408 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011488 11011111111111111111111111111111111111111111111111111111111111111111111111111111*
L011488 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
Note Block 1 PLA OR array *
L011568 1111111111111011*
L011584 1111111111111011*
L011600 1111111111110111*
L011616 1111111111110111*
L011632 1111111111101111*
L011648 1111111111101111*
L011664 1111111111011111*
L011680 1111111111011111*
L011696 1111111101111111*
L011712 1111111101111111*
L011728 1111101111111111*
L011744 1111101111111111*
L011760 1111011111111111*
L011776 1111011111111111*
L011792 1110111111111111*
L011808 1110111111111111*
L011568 1110001101000011*
L011584 1111111111111100*
L011600 1111111111111100*
L011616 1111111111111111*
L011632 1111111111111111*
L011648 1111111111111111*
L011664 1111111111111111*
L011680 1111111111111111*
L011696 1111111111111111*
L011712 1111111111111111*
L011728 1111111111111111*
L011744 1111111111111111*
L011760 1111111111111111*
L011776 1111111111111111*
L011792 1111111111111111*
L011808 1111111111111111*
L011824 1111111111111111*
L011840 1111111111111111*
L011856 1111111111111111*
@ -352,44 +352,44 @@ N Aclk ClkOp Clk:2 ClkFreq R:2 P:2 RegMod:2 INz:2 FB:2 InReg St XorIn:2 RegCom O
L012464 000001111001111110011111100*
L012491 000001111001111110011111100*
L012518 000001111001111110011111100*
L012545 000101111001111100000000011*
L012572 000101111001111101100000011*
L012599 000101111001111101100000011*
L012545 010101111001111101000000011*
L012572 010101111001111100100000011*
L012599 010101111001111100100000011*
L012626 000001111001111110011111100*
L012653 000001111000011100011111100*
L012680 000101111001111101100000011*
L012707 000001111001111100011111100*
L012734 000101111001111101100000011*
L012761 000101111001111101100000011*
L012788 000101111001111101100000011*
L012815 000101111001111101100000011*
L012842 000101111001111101000000011*
L012869 000101111001111101000000011*
L012653 000101111000010000011111001*
L012680 010101111001111100100000011*
L012707 000001111001111100011111000*
L012734 010101111001111100100000011*
L012761 010101111001111100100000011*
L012788 010101111001111100100000011*
L012815 010101111001111100100000011*
L012842 010101111001111100000000011*
L012869 010101111001111100000000011*
Note Block 2 *
Note Block 2 ZIA *
L012896 1111111011100111*
L012912 1111111111111111*
L012928 1111111011110011*
L012944 1111111111111111*
L012960 1111111010110111*
L012896 0110111011111111*
L012912 0110111011111111*
L012928 0110111011111111*
L012944 1010111011111111*
L012960 1010111011111111*
L012976 1111111011010111*
L012992 1111111010110111*
L012992 1010111011111111*
L013008 0110111011111111*
L013024 1111111010110111*
L013040 1111111010110111*
L013056 1111111010110111*
L013072 1111111011010111*
L013088 1111111011010111*
L013104 1111111111111111*
L013024 1111111011010111*
L013040 1010111011111111*
L013056 1100111011111111*
L013072 1110011011111111*
L013088 1010111011111111*
L013104 1010111011111111*
L013120 1100111011111111*
L013136 1111111011010111*
L013136 1100111011111111*
L013152 1111111111111111*
L013168 1111111111111111*
L013184 1111111011010111*
L013200 1111111111111111*
L013216 1111111111111111*
L013232 1111111111111111*
L013168 1010111011111111*
L013184 1100111011111111*
L013200 1100111011111111*
L013216 1010111011111111*
L013232 1100111011111111*
L013248 1111111111111111*
L013264 1111111111111111*
L013280 1111111111111111*
@ -397,9 +397,9 @@ L013296 1111111111111111*
L013312 1111111111111111*
L013328 1111111111111111*
L013344 1111111111111111*
L013360 1111111111111111*
L013360 1111111011100111*
L013376 1111111111111111*
L013392 1111111111111111*
L013392 1110101011111111*
L013408 1111111011100111*
L013424 1111111111111111*
L013440 1111111111111111*
@ -410,44 +410,44 @@ L013504 1111111111111111*
L013520 1111111111111111*
Note Block 2 PLA AND array *
L013536 10110111110111111111111111111111111111111111111111111111111111111011111111111111*
L013616 10111011111011111111111111111111111111111111111111111111111111111011111111111111*
L013696 11110111110111011111111111111111111111111111111111111111111111111011111111111111*
L013776 11111011111011011111111111111111111111111111111111111111111111111011111111111111*
L013856 11110111111011111111111111110111111111111111111111111111111111111111111111111111*
L013936 11111011110111111111111111110111111111111111111111111111111111111111111111111111*
L014016 11111011111111111111111111111111111110111111111111111111111111111111111111111111*
L013536 11111111110111111111111111111111111111111111111111111111111011011011111111111111*
L013616 11111111111011111111110111111111111111111111111111111111111011111011111111111111*
L013696 11111111110111011111111111111111111111111111111111111111111111011011111111111111*
L013776 11111111111011011111110111111111111111111111111111111111111111111011111111111111*
L013856 11111111110111111111111111110111111111111111111111111111111111101111111111111111*
L013936 11111111111011111111111011110111111111111111111111111111111111111111111111111111*
L014016 11111111111011111011111011111111111111111111111111111111111111111111111111111111*
L014096 11111111111011111111111111111111111111111111111111111111111111111111111111111111*
L014176 11111011111111111111111101111111111110111111111111111111111111111111111111111111*
L014256 11111111111111111111111110111111111101111111111111111111111111111111111111111111*
L014336 11110111111111111111111110111111111111111111111111111111111111111111111111111111*
L014416 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014496 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014576 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014656 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014736 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014816 11111111111111111101111111111111111111111111111111111111111111111111111111111111*
L014176 11111111110111111111111111111111111111011111111111111111111111111111111111111111*
L014256 11111111110111111111111111111101111111111111111111111111111111111111111111111111*
L014336 11111111110111111111111111111111111111111101111111111111111111111111111111111111*
L014416 11111111110111111111111111111111111101111111111111111111111111111111111111111111*
L014496 11111111110111111111111111111111110111111111111111111111111111111111111111111111*
L014576 11111111110111111111111111111111111111110111111111111111111111111111111111111111*
L014656 11111111110101111111111111111111111111111111111111111111111111111111111111111111*
L014736 11111111110111111111011111111111111111111111111111111111111111111111111111111111*
L014816 11110111111011111111111111111111111111111111111111111111111111111111111111111111*
L014896 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014976 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015056 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015136 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015216 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015296 11111111111101111111111111111111111111111111111111111111111111111111111111111111*
L015296 11011111111011111111111111111111111111111111111111111111111111111111111111111111*
L015376 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015456 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015536 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015616 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015696 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015776 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015776 11111110111011111111111111111111111111111111111111111111111111111111111111111111*
L015856 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015936 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016016 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016096 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016176 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016256 11111111011111111111111111111111111111111111111111111111111111111111111111111111*
L016256 01111111111011111111111111111111111111111111111111111111111111111111111111111111*
L016336 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016416 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016496 11111111111111110111111111111111111111111111111111111111111111111111111111111111*
L016496 11111111111011111111111101111111111111111111111111111111111111111111111111111111*
L016576 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016656 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016736 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
@ -459,13 +459,13 @@ L017136 111111111111111111111111111111111111111111111111111111111111111111111111
L017216 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017296 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017376 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017456 11111111111111111111011111111111111111111111111111111111111111111111111111111111*
L017456 11111111011011111111111111111111111111111111111111111111111111111111111111111111*
L017536 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017616 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017696 11111111111111111111110111111111111111111111111111111111111111111111111111111111*
L017696 11111111111011111111111111011111111111111111111111111111111111111111111111111111*
L017776 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017856 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017936 11111111111111111111111111111101111111111111111111111111111111111111111111111111*
L017936 11111111111011111101111111111111111111111111111111111111111111111111111111111111*
Note Block 2 PLA OR array *
L018016 0111111111111111*
@ -474,16 +474,16 @@ L018048 0111111111111111*
L018064 0111111111111111*
L018080 0111111111111111*
L018096 0111111111111111*
L018112 1101011100111000*
L018112 1101010100111000*
L018128 1111111111111111*
L018144 1111110111111111*
L018160 1111110111111111*
L018176 1111110111111111*
L018192 1111111111111111*
L018208 1111111111111111*
L018224 1111111111111111*
L018240 1111111111111111*
L018256 1111111111111111*
L018144 1101111111111111*
L018160 1111011111111111*
L018176 1111111101111111*
L018192 1111111110111111*
L018208 1111111111111011*
L018224 1111111111111101*
L018240 1111111111111110*
L018256 1111110111111111*
L018272 1111111111111111*
L018288 1111111111111111*
L018304 1111111111111111*
@ -528,21 +528,21 @@ L018896 1111111111111111*
Note Block 2 I/O Macrocell Configuration 27 bits *
N Aclk ClkOp Clk:2 ClkFreq R:2 P:2 RegMod:2 INz:2 FB:2 InReg St XorIn:2 RegCom Oe:4 Tm Slw Pu*
L018912 000101111001110100000000011*
L018939 000001111000011100011111100*
L018966 000101111000011101001000111*
L018939 000001111000011100011111000*
L018966 000101111000010101001000011*
L018993 000001111001111110011111100*
L019020 000101111000011101001000111*
L019020 000101111000010101001000011*
L019047 000001111001111110011111100*
L019074 000101111000011100001000111*
L019101 000001111000011100011111100*
L019128 000101111000011101001000111*
L019155 000101111000011101001000111*
L019182 000001111000011100011111100*
L019209 000001111000011100011111100*
L019074 000101111000010101001000011*
L019101 000001111000011100011111000*
L019128 000101111000010101001000011*
L019155 000101111000010101001000011*
L019182 000001111000011100011111000*
L019209 000001111000011100011111000*
L019236 000001111001111110011111100*
L019263 000101111000011101001000111*
L019290 000101111000011101001000111*
L019317 000101111000011101001000111*
L019263 000101111000010101001000011*
L019290 000101111000010101001000011*
L019317 000101111000010101001000011*
Note Block 3 *
Note Block 3 ZIA *
@ -705,14 +705,14 @@ L025344 1111111111111111*
Note Block 3 I/O Macrocell Configuration 27 bits *
N Aclk ClkOp Clk:2 ClkFreq R:2 P:2 RegMod:2 INz:2 FB:2 InReg St XorIn:2 RegCom Oe:4 Tm Slw Pu*
L025360 000001111000011100011111100*
L025387 000001111000011100011111100*
L025414 000001111000011100011111100*
L025441 000001111000011100011111100*
L025468 000001111000011100011111100*
L025495 000001111000011100011111100*
L025522 000001111000011100011111100*
L025549 000001111000011100011111100*
L025360 000101111001110000011111001*
L025387 000101111001110000011111001*
L025414 000101111001110000011111001*
L025441 000101111001110000011111001*
L025468 000101111001110000011111001*
L025495 000101111001110000011111001*
L025522 000101111001110000011111001*
L025549 000101111001110000011111001*
L025576 000001111001111110011111100*
L025603 000001111001111110011111100*
L025630 000001111001111110011111100*
@ -733,13 +733,13 @@ Note Global OE Mux *
L025797 11111111*
Note Global Termination *
L025805 0*
L025805 1*
Note Input Voltage Standard for IOB *
L025806 1*
L025806 0*
Note Output Voltage Standard for IOB *
L025807 1*
L025807 0*
Note I/O Bank 0 Vcci *
L025808 0*
@ -753,5 +753,5 @@ L025810 0*
Note I/O Bank 1 Vcco *
L025811 0*
C0AA8*
AABC
C035D*
AA97

View File

@ -29,41 +29,41 @@ TIMEGRP "to_host" OFFSET = OUT 20 ns AFTER "CODEC_X2_CLK";
#PACE: Start of Constraints generated by PACE
#PACE: Start of PACE I/O Pin Assignments
NET "CODEC_CLK" LOC = "P23" | IOSTANDARD = LVCMOS33 ;
NET "CODEC_X2_CLK" LOC = "P27" | IOSTANDARD = LVCMOS33 ;
NET "DA<0>" LOC = "P43" | IOSTANDARD = LVCMOS33 ;
NET "DA<1>" LOC = "P42" | IOSTANDARD = LVCMOS33 ;
NET "DA<2>" LOC = "P41" | IOSTANDARD = LVCMOS33 ;
NET "DA<3>" LOC = "P40" | IOSTANDARD = LVCMOS33 ;
NET "DA<4>" LOC = "P39" | IOSTANDARD = LVCMOS33 ;
NET "DA<5>" LOC = "P37" | IOSTANDARD = LVCMOS33 ;
NET "DA<6>" LOC = "P36" | IOSTANDARD = LVCMOS33 ;
NET "DA<7>" LOC = "P35" | IOSTANDARD = LVCMOS33 ;
NET "DD<0>" LOC = "P34" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "DD<1>" LOC = "P33" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "DD<2>" LOC = "P32" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "DD<3>" LOC = "P30" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "DD<4>" LOC = "P29" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "DD<5>" LOC = "P28" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "DD<6>" LOC = "P24" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "DD<7>" LOC = "P19" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "DD<8>" LOC = "P18" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "DD<9>" LOC = "P17" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_CAPTURE" LOC = "P91" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_DATA<0>" LOC = "P89" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_DATA<1>" LOC = "P79" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_DATA<2>" LOC = "P74" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_DATA<3>" LOC = "P72" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_DATA<4>" LOC = "P67" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_DATA<5>" LOC = "P64" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_DATA<6>" LOC = "P61" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_DATA<7>" LOC = "P77" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "HOST_DIRECTION" LOC = "P71" | IOSTANDARD = LVCMOS33 ;
NET "HOST_DISABLE" LOC = "P76" | IOSTANDARD = LVCMOS33 ;
NET "HOST_Q_INVERT" LOC = "P70" | IOSTANDARD = LVCMOS33 ;
NET "HOST_SYNC_EN" LOC = "P90" | IOSTANDARD = LVCMOS33 ;
NET "HOST_SYNC" LOC = "P55" | IOSTANDARD = LVCMOS33;
NET "HOST_SYNC_CMD" LOC = "P56" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ;
NET "CODEC_CLK" LOC = "P23" ;
NET "CODEC_X2_CLK" LOC = "P27" ;
NET "DA<0>" LOC = "P43" ;
NET "DA<1>" LOC = "P42" ;
NET "DA<2>" LOC = "P41" ;
NET "DA<3>" LOC = "P40" ;
NET "DA<4>" LOC = "P39" ;
NET "DA<5>" LOC = "P37" ;
NET "DA<6>" LOC = "P36" ;
NET "DA<7>" LOC = "P35" ;
NET "DD<0>" LOC = "P34" ;
NET "DD<1>" LOC = "P33" ;
NET "DD<2>" LOC = "P32" ;
NET "DD<3>" LOC = "P30" ;
NET "DD<4>" LOC = "P29" ;
NET "DD<5>" LOC = "P28" ;
NET "DD<6>" LOC = "P24" ;
NET "DD<7>" LOC = "P19" ;
NET "DD<8>" LOC = "P18" ;
NET "DD<9>" LOC = "P17" ;
NET "HOST_CAPTURE" LOC = "P91" ;
NET "HOST_DATA<0>" LOC = "P89" ;
NET "HOST_DATA<1>" LOC = "P79" ;
NET "HOST_DATA<2>" LOC = "P74" ;
NET "HOST_DATA<3>" LOC = "P72" ;
NET "HOST_DATA<4>" LOC = "P67" ;
NET "HOST_DATA<5>" LOC = "P64" ;
NET "HOST_DATA<6>" LOC = "P61" ;
NET "HOST_DATA<7>" LOC = "P77" ;
NET "HOST_DIRECTION" LOC = "P71" ;
NET "HOST_DISABLE" LOC = "P76" ;
NET "HOST_Q_INVERT" LOC = "P70" ;
NET "HOST_SYNC_EN" LOC = "P90" ;
NET "HOST_SYNC" LOC = "P55" | PULLUP ;
NET "HOST_SYNC_CMD" LOC = "P56" ;
#PACE: Start of PACE Area Constraints

View File

@ -47,7 +47,8 @@ entity top is
end top;
architecture Behavioral of top is
signal codec_clk_i : std_logic;
signal codec_clk_rx_i : std_logic;
signal codec_clk_tx_i : std_logic;
signal adc_data_i : std_logic_vector(7 downto 0);
signal dac_data_o : std_logic_vector(9 downto 0);
@ -75,14 +76,11 @@ begin
------------------------------------------------
-- Codec interface
adc_data_i <= DA(7 downto 0);
DD(9 downto 0) <= dac_data_o;
------------------------------------------------
-- Clocks
codec_clk_i <= CODEC_CLK;
BUFG_host : BUFG
port map (
O => host_clk_i,
@ -94,7 +92,6 @@ begin
HOST_DATA <= data_to_host_o when transfer_direction_i = from_adc
else (others => 'Z');
data_from_host_i <= HOST_DATA;
HOST_CAPTURE <= host_data_capture_o;
host_sync_enable <= HOST_SYNC_EN;
@ -109,26 +106,32 @@ begin
q_invert <= HOST_Q_INVERT;
rx_q_invert_mask <= X"80" when q_invert = '1' else X"7f";
tx_q_invert_mask <= X"7F" when q_invert = '1' else X"80";
tx_q_invert_mask <= X"7f" when q_invert = '1' else X"80";
process(host_clk_i)
begin
if rising_edge(host_clk_i) then
if codec_clk_i = '1' then
-- I: non-inverted between MAX2837 and MAX5864
data_to_host_o <= adc_data_i xor X"80";
else
-- Q: inverted between MAX2837 and MAX5864
data_to_host_o <= adc_data_i xor rx_q_invert_mask;
codec_clk_rx_i <= CODEC_CLK;
adc_data_i <= DA(7 downto 0);
if (transfer_direction_i = from_adc) then
if codec_clk_rx_i = '1' then
-- I: non-inverted between MAX2837 and MAX5864
data_to_host_o <= adc_data_i xor X"80";
else
-- Q: inverted between MAX2837 and MAX5864
data_to_host_o <= adc_data_i xor rx_q_invert_mask;
end if;
end if;
end if;
end process;
process(host_clk_i)
begin
if rising_edge(host_clk_i) then
if falling_edge(host_clk_i) then
codec_clk_tx_i <= CODEC_CLK;
data_from_host_i <= HOST_DATA;
if transfer_direction_i = to_dac then
if codec_clk_i = '1' then
if codec_clk_tx_i = '1' then
dac_data_o <= (data_from_host_i xor tx_q_invert_mask) & tx_q_invert_mask(0) & tx_q_invert_mask(0);
else
dac_data_o <= (data_from_host_i xor X"80") & "00";
@ -155,11 +158,11 @@ begin
begin
if rising_edge(host_clk_i) then
if transfer_direction_i = to_dac then
if codec_clk_i = '1' then
if codec_clk_tx_i = '1' then
host_data_capture_o <= host_data_enable_i and (host_sync_latched or not host_sync_enable);
end if;
else
if codec_clk_i = '0' then
if codec_clk_rx_i = '1' then
host_data_capture_o <= host_data_enable_i and (host_sync_latched or not host_sync_enable);
end if;
end if;

View File

@ -27,11 +27,6 @@
enable_language(C CXX ASM)
SET(PATH_HACKRF ../..)
SET(PATH_HACKRF_FIRMWARE ${PATH_HACKRF}/firmware)
SET(PATH_HACKRF_FIRMWARE_COMMON ${PATH_HACKRF_FIRMWARE}/common)
SET(LIBOPENCM3 ${PATH_HACKRF_FIRMWARE}/libopencm3)
include(${PATH_HACKRF_FIRMWARE}/dfu-util.cmake)
#set(VERSION "")
@ -61,11 +56,19 @@ else()
set(MCU_PARTNO LPC4330)
endif()
if(BOARD STREQUAL "RAD1O")
set(USER_INTERFACE RAD1O)
endif()
if(NOT DEFINED USER_INTERFACE)
set(USER_INTERFACE NONE)
endif()
if(NOT DEFINED SRC_M0)
set(SRC_M0 "${PATH_HACKRF_FIRMWARE_COMMON}/m0_sleep.c")
endif()
SET(HACKRF_OPTS "-D${BOARD} -DLPC43XX -D${MCU_PARTNO} -DTX_ENABLE -D'VERSION_STRING=\"${VERSION}\"'")
SET(HACKRF_OPTS "-D${BOARD} -DUSER_INTERFACE_${USER_INTERFACE} -DLPC43XX -D${MCU_PARTNO} -DTX_ENABLE -D'VERSION_STRING=\"${VERSION}\"'")
SET(LDSCRIPT_M4 "-T${PATH_HACKRF_FIRMWARE_COMMON}/${MCU_PARTNO}_M4_memory.ld -Tlibopencm3_lpc43xx_rom_to_ram.ld -T${PATH_HACKRF_FIRMWARE_COMMON}/LPC43xx_M4_M0_image_from_text.ld")
@ -89,7 +92,11 @@ SET(CPUFLAGS_M4 "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16")
SET(CFLAGS_M4 "-std=gnu99 ${CFLAGS_COMMON} ${CPUFLAGS_M4} -DLPC43XX_M4")
SET(CXXFLAGS_M4 "-std=gnu++0x ${CFLAGS_COMMON} ${CPUFLAGS_M4} -DLPC43XX_M4")
SET(LDFLAGS_M4 "${LDFLAGS_COMMON} ${CPUFLAGS_M4} ${LDSCRIPT_M4} -Xlinker -Map=m4.map")
SET(CFLAGS_M4_DFU "-std=gnu99 ${CFLAGS_COMMON} ${CPUFLAGS_M4} -DLPC43XX_M4 -DDFU_MODE")
SET(CFLAGS_M4_DFU "-std=gnu99 ${CFLAGS_COMMON} ${CPUFLAGS_M4} -DLPC43XX_M4")
if(NOT USER_INTERFACE STREQUAL "PORTAPACK")
SET(CFLAGS_M4_DFU "${CFLAGS_M4_DFU} -DDFU_MODE")
endif()
SET(LDFLAGS_M4_DFU "${LDFLAGS_COMMON} ${CPUFLAGS_M4} ${LDSCRIPT_M4_DFU} -Xlinker -Map=m4.map")
set(BUILD_SHARED_LIBS OFF)
@ -132,6 +139,13 @@ macro(DeclareTargets)
)
endif()
if(USER_INTERFACE STREQUAL "PORTAPACK")
SET(SRC_M4
${SRC_M4}
${PATH_HACKRF_FIRMWARE_COMMON}/ui_portapack.c
)
endif()
configure_file(
${PATH_HACKRF_FIRMWARE_COMMON}/m0_bin.s.cmake
m0_bin.s
@ -145,6 +159,7 @@ macro(DeclareTargets)
)
add_executable(${PROJECT_NAME}_m0.elf ${SRC_M0})
add_dependencies(${PROJECT_NAME}_m0.elf libopencm3)
target_link_libraries(
${PROJECT_NAME}_m0.elf
@ -167,6 +182,7 @@ macro(DeclareTargets)
set_target_properties(${PROJECT_NAME}_objects PROPERTIES COMPILE_FLAGS "${CFLAGS_M4}")
add_dependencies(${PROJECT_NAME}_objects ${PROJECT_NAME}_m0.bin)
add_executable(${PROJECT_NAME}.elf $<TARGET_OBJECTS:${PROJECT_NAME}_objects>)
add_dependencies(${PROJECT_NAME}.elf libopencm3)
target_link_libraries(
${PROJECT_NAME}.elf
@ -190,6 +206,7 @@ macro(DeclareTargets)
set_target_properties(${PROJECT_NAME}_dfu_objects PROPERTIES COMPILE_FLAGS "${CFLAGS_M4_DFU}")
add_dependencies(${PROJECT_NAME}_dfu_objects ${PROJECT_NAME}_m0.bin)
add_executable(${PROJECT_NAME}_dfu.elf $<TARGET_OBJECTS:${PROJECT_NAME}_dfu_objects>)
add_dependencies(${PROJECT_NAME}_dfu.elf libopencm3)
target_link_libraries(
${PROJECT_NAME}_dfu.elf
@ -213,7 +230,7 @@ macro(DeclareTargets)
COMMAND rm -f _tmp.dfu _header.bin
COMMAND cp ${PROJECT_NAME}_dfu.bin _tmp.dfu
COMMAND dfu-suffix --vid=0x1fc9 --pid=0x000c --did=0x0 -a _tmp.dfu
COMMAND python ../../dfu.py ${PROJECT_NAME}
COMMAND python ${PATH_DFU_PY} ${PROJECT_NAME}
COMMAND cat _header.bin _tmp.dfu >${PROJECT_NAME}.dfu
COMMAND rm -f _tmp.dfu _header.bin
)

View File

@ -42,7 +42,6 @@ set(SRC_M4
usb_api_register.c
usb_api_spiflash.c
usb_api_transceiver.c
"${PATH_HACKRF_FIRMWARE_COMMON}/operacake.c"
usb_api_operacake.c
usb_api_sweep.c
"${PATH_HACKRF_FIRMWARE_COMMON}/usb_queue.c"
@ -52,6 +51,7 @@ set(SRC_M4
"${PATH_HACKRF_FIRMWARE_COMMON}/xapp058/micro.c"
"${PATH_HACKRF_FIRMWARE_COMMON}/xapp058/ports.c"
"${PATH_HACKRF_FIRMWARE_COMMON}/rom_iap.c"
"${PATH_HACKRF_FIRMWARE_COMMON}/operacake.c"
)
DeclareTargets()

View File

@ -48,7 +48,51 @@
#include "hackrf-ui.h"
static const usb_request_handler_fn vendor_request_handler[] = {
// TODO: Duplicate code/knowledge, copied from /host/libhackrf/src/hackrf.c
// TODO: Factor this into a shared #include so that firmware can use
// the same values.
typedef enum {
HACKRF_VENDOR_REQUEST_SET_TRANSCEIVER_MODE = 1,
HACKRF_VENDOR_REQUEST_MAX2837_WRITE = 2,
HACKRF_VENDOR_REQUEST_MAX2837_READ = 3,
HACKRF_VENDOR_REQUEST_SI5351C_WRITE = 4,
HACKRF_VENDOR_REQUEST_SI5351C_READ = 5,
HACKRF_VENDOR_REQUEST_SAMPLE_RATE_SET = 6,
HACKRF_VENDOR_REQUEST_BASEBAND_FILTER_BANDWIDTH_SET = 7,
HACKRF_VENDOR_REQUEST_RFFC5071_WRITE = 8,
HACKRF_VENDOR_REQUEST_RFFC5071_READ = 9,
HACKRF_VENDOR_REQUEST_SPIFLASH_ERASE = 10,
HACKRF_VENDOR_REQUEST_SPIFLASH_WRITE = 11,
HACKRF_VENDOR_REQUEST_SPIFLASH_READ = 12,
_HACKRF_VENDOR_REQUEST_WRITE_CPLD = 13,
HACKRF_VENDOR_REQUEST_BOARD_ID_READ = 14,
HACKRF_VENDOR_REQUEST_VERSION_STRING_READ = 15,
HACKRF_VENDOR_REQUEST_SET_FREQ = 16,
HACKRF_VENDOR_REQUEST_AMP_ENABLE = 17,
HACKRF_VENDOR_REQUEST_BOARD_PARTID_SERIALNO_READ = 18,
HACKRF_VENDOR_REQUEST_SET_LNA_GAIN = 19,
HACKRF_VENDOR_REQUEST_SET_VGA_GAIN = 20,
HACKRF_VENDOR_REQUEST_SET_TXVGA_GAIN = 21,
_HACKRF_VENDOR_REQUEST_SET_IF_FREQ = 22,
HACKRF_VENDOR_REQUEST_ANTENNA_ENABLE = 23,
HACKRF_VENDOR_REQUEST_SET_FREQ_EXPLICIT = 24,
HACKRF_VENDOR_REQUEST_USB_WCID_VENDOR_REQ = 25,
HACKRF_VENDOR_REQUEST_INIT_SWEEP = 26,
HACKRF_VENDOR_REQUEST_OPERACAKE_GET_BOARDS = 27,
HACKRF_VENDOR_REQUEST_OPERACAKE_SET_PORTS = 28,
HACKRF_VENDOR_REQUEST_SET_HW_SYNC_MODE = 29,
HACKRF_VENDOR_REQUEST_RESET = 30,
HACKRF_VENDOR_REQUEST_OPERACAKE_SET_RANGES = 31,
HACKRF_VENDOR_REQUEST_CLKOUT_ENABLE = 32,
HACKRF_VENDOR_REQUEST_SPIFLASH_STATUS = 33,
HACKRF_VENDOR_REQUEST_SPIFLASH_CLEAR_STATUS = 34,
HACKRF_VENDOR_REQUEST_OPERACAKE_GPIO_TEST = 35,
/* Update to be the next integer after the highest-numbered request. */
_HACKRF_VENDOR_REQUEST_ARRAY_SIZE
} hackrf_vendor_request;
static usb_request_handler_fn vendor_request_handler[] = {
NULL,
usb_vendor_request_set_transceiver_mode,
usb_vendor_request_write_max2837,
@ -198,7 +242,10 @@ int main(void) {
usb_run(&usb_device);
rf_path_init(&rf_path);
#ifndef USER_INTERFACE_PORTAPACK
operacake_init();
#endif
unsigned int phase = 0;

View File

@ -73,7 +73,7 @@ typedef enum {
HACKRF_VENDOR_REQUEST_SET_TXVGA_GAIN = 21,
HACKRF_VENDOR_REQUEST_ANTENNA_ENABLE = 23,
HACKRF_VENDOR_REQUEST_SET_FREQ_EXPLICIT = 24,
// USB_WCID_VENDOR_REQ = 25
HACKRF_VENDOR_REQUEST_USB_WCID_VENDOR_REQ = 25,
HACKRF_VENDOR_REQUEST_INIT_SWEEP = 26,
HACKRF_VENDOR_REQUEST_OPERACAKE_GET_BOARDS = 27,
HACKRF_VENDOR_REQUEST_OPERACAKE_SET_PORTS = 28,