Syncing some more, not sure if these are more or less up-to-date than what's on here already.....
This commit is contained in:
parent
c90ef72637
commit
3236178786
7 changed files with 144 additions and 9058 deletions
|
@ -5,7 +5,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1817748837169192119" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings Cross ARM" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1613057635135174505" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings Cross ARM" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
@ -16,7 +16,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1789670160413558094" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings Cross ARM" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1669766548766606208" id="ilg.gnuarmeclipse.managedbuild.cross.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings Cross ARM" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -1,8 +0,0 @@
|
|||
|
||||
/*
|
||||
* Placeholder to list other libraries required by the application.
|
||||
|
||||
GROUP(
|
||||
)
|
||||
|
||||
*/
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Memory Spaces Definitions.
|
||||
*
|
||||
* Need modifying for a specific board.
|
||||
* FLASH.ORIGIN: starting address of flash
|
||||
* FLASH.LENGTH: length of flash
|
||||
* RAM.ORIGIN: starting address of RAM bank 0
|
||||
* RAM.LENGTH: length of RAM bank 0
|
||||
*
|
||||
* The values below can be addressed in further linker scripts
|
||||
* using functions like 'ORIGIN(RAM)' or 'LENGTH(RAM)'.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
|
||||
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
MEMORY_ARRAY (xrw) : ORIGIN = 0x20002000, LENGTH = 32
|
||||
}
|
||||
|
||||
/*
|
||||
* For external ram use something like:
|
||||
|
||||
RAM (xrw) : ORIGIN = 0x64000000, LENGTH = 2048K
|
||||
|
||||
*/
|
|
@ -1,389 +0,0 @@
|
|||
/*
|
||||
* Default linker script for STM32Fxxx.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The '__stack' definition is required by crt0, do not remove it.
|
||||
*/
|
||||
__stack = ORIGIN(RAM) + LENGTH(RAM);
|
||||
|
||||
_estack = __stack; /* STM specific definition */
|
||||
|
||||
/*
|
||||
* Default stack sizes.
|
||||
* These are used by the startup in order to allocate stacks
|
||||
* for the different modes.
|
||||
*/
|
||||
|
||||
__Main_Stack_Size = 1024 ;
|
||||
|
||||
PROVIDE ( _Main_Stack_Size = __Main_Stack_Size ) ;
|
||||
|
||||
__Main_Stack_Limit = __stack - __Main_Stack_Size ;
|
||||
|
||||
/*"PROVIDE" allows to easily override these values from an object file or the command line. */
|
||||
PROVIDE ( _Main_Stack_Limit = __Main_Stack_Limit ) ;
|
||||
|
||||
/*
|
||||
* There will be a link error if there is not this amount of
|
||||
* RAM free at the end.
|
||||
*/
|
||||
_Minimum_Stack_Size = 256 ;
|
||||
|
||||
/*
|
||||
* Default heap definitions.
|
||||
* The heap start immediately after the last statically allocated
|
||||
* .sbss/.noinit section, and extends up to the main stack limit.
|
||||
*/
|
||||
PROVIDE ( _Heap_Begin = _end_noinit ) ;
|
||||
PROVIDE ( _Heap_Limit = __stack - __Main_Stack_Size ) ;
|
||||
|
||||
/*
|
||||
* The entry point is informative, for debuggers and simulators,
|
||||
* since the Cortex-M vector points to it anyway.
|
||||
*/
|
||||
ENTRY(_start)
|
||||
|
||||
|
||||
/* Sections Definitions */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/*
|
||||
* For Cortex-M devices, the beginning of the startup code is stored in
|
||||
* the .isr_vector section, which goes to FLASH
|
||||
*/
|
||||
.isr_vector :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.isr_vector)) /* Interrupt vectors */
|
||||
|
||||
KEEP(*(.cfmconfig)) /* Freescale configuration words */
|
||||
|
||||
/*
|
||||
* This section is here for convenience, to store the
|
||||
* startup code at the beginning of the flash area, hoping that
|
||||
* this will increase the readability of the listing.
|
||||
*/
|
||||
*(.after_vectors .after_vectors.*) /* Startup code and ISR */
|
||||
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
.inits :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
|
||||
/*
|
||||
* These are the old initialisation sections, intended to contain
|
||||
* naked code, with the prologue/epilogue added by crti.o/crtn.o
|
||||
* when linking with startup files. The standalone startup code
|
||||
* currently does not run these, better use the init arrays below.
|
||||
*/
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
. = ALIGN(4);
|
||||
|
||||
/*
|
||||
* The preinit code, i.e. an array of pointers to initialisation
|
||||
* functions to be performed before constructors.
|
||||
*/
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
|
||||
/*
|
||||
* Used to run the SystemInit() before anything else.
|
||||
*/
|
||||
KEEP(*(.preinit_array_sysinit .preinit_array_sysinit.*))
|
||||
|
||||
/*
|
||||
* Used for other platform inits.
|
||||
*/
|
||||
KEEP(*(.preinit_array_platform .preinit_array_platform.*))
|
||||
|
||||
/*
|
||||
* The application inits. If you need to enforce some order in
|
||||
* execution, create new sections, as before.
|
||||
*/
|
||||
KEEP(*(.preinit_array .preinit_array.*))
|
||||
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
|
||||
/*
|
||||
* The init code, i.e. an array of pointers to static constructors.
|
||||
*/
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
|
||||
/*
|
||||
* The fini code, i.e. an array of pointers to static destructors.
|
||||
*/
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
. = ALIGN(4);
|
||||
|
||||
} >FLASH
|
||||
|
||||
/*
|
||||
* For some STRx devices, the beginning of the startup code
|
||||
* is stored in the .flashtext section, which goes to FLASH.
|
||||
*/
|
||||
.flashtext :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
*(.flashtext .flashtext.*) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
|
||||
/*
|
||||
* The program code is stored in the .text section,
|
||||
* which goes to FLASH.
|
||||
*/
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
|
||||
*(.text .text.*) /* all remaining code */
|
||||
|
||||
*(.rodata .rodata.*) /* read-only data (constants) */
|
||||
|
||||
*(vtable) /* C++ virtual tables */
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
|
||||
/*
|
||||
* Stub sections generated by the linker, to glue together
|
||||
* ARM and Thumb code. .glue_7 is used for ARM code calling
|
||||
* Thumb code, and .glue_7t is used for Thumb code calling
|
||||
* ARM code. Apparently always generated by the linker, for some
|
||||
* architectures, so better leave them here.
|
||||
*/
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
|
||||
} >FLASH
|
||||
|
||||
/* ARM magic sections */
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
__etext = .;
|
||||
|
||||
/*
|
||||
* This address is used by the startup code to
|
||||
* initialise the .data section.
|
||||
*/
|
||||
_sidata = _etext;
|
||||
|
||||
/* MEMORY_ARRAY */
|
||||
/*
|
||||
.ROarraySection :
|
||||
{
|
||||
*(.ROarraySection .ROarraySection.*)
|
||||
} >MEMORY_ARRAY
|
||||
*/
|
||||
|
||||
/*
|
||||
* The initialised data section.
|
||||
* The program executes knowing that the data is in the RAM
|
||||
* but the loader puts the initial values in the FLASH (inidata).
|
||||
* It is one task of the startup to copy the initial values from
|
||||
* FLASH to RAM.
|
||||
*/
|
||||
.data : AT ( _sidata )
|
||||
{
|
||||
. = ALIGN(4);
|
||||
|
||||
/* This is used by the startup code to initialise the .data section */
|
||||
_sdata = . ; /* STM specific definition */
|
||||
__data_start__ = . ;
|
||||
*(.data_begin .data_begin.*)
|
||||
|
||||
*(.data .data.*)
|
||||
|
||||
*(.data_end .data_end.*)
|
||||
. = ALIGN(4);
|
||||
|
||||
/* This is used by the startup code to initialise the .data section */
|
||||
_edata = . ; /* STM specific definition */
|
||||
__data_end__ = . ;
|
||||
|
||||
} >RAM
|
||||
|
||||
|
||||
/*
|
||||
* The uninitialised data section. NOLOAD is used to avoid
|
||||
* the "section `.bss' type changed to PROGBITS" warning
|
||||
*/
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .; /* standard newlib definition */
|
||||
_sbss = .; /* STM specific definition */
|
||||
*(.bss_begin .bss_begin.*)
|
||||
|
||||
*(.bss .bss.*)
|
||||
*(COMMON)
|
||||
|
||||
*(.bss_end .bss_end.*)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .; /* standard newlib definition */
|
||||
_ebss = . ; /* STM specific definition */
|
||||
} >RAM
|
||||
|
||||
.noinit (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_noinit = .;
|
||||
|
||||
*(.noinit .noinit.*)
|
||||
|
||||
. = ALIGN(4) ;
|
||||
_end_noinit = .;
|
||||
} > RAM
|
||||
|
||||
/* Mandatory to be word aligned, _sbrk assumes this */
|
||||
PROVIDE ( end = _end_noinit ); /* was _ebss */
|
||||
PROVIDE ( _end = _end_noinit );
|
||||
PROVIDE ( __end = _end_noinit );
|
||||
PROVIDE ( __end__ = _end_noinit );
|
||||
|
||||
/*
|
||||
* Used for validation only, do not allocate anything here!
|
||||
*
|
||||
* This is just to check that there is enough RAM left for the Main
|
||||
* stack. It should generate an error if it's full.
|
||||
*/
|
||||
._check_stack :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
|
||||
. = . + _Minimum_Stack_Size ;
|
||||
|
||||
. = ALIGN(4);
|
||||
} >RAM
|
||||
|
||||
.bss_CCMRAM : ALIGN(4)
|
||||
{
|
||||
*(.bss.CCMRAM .bss.CCMRAM.*)
|
||||
} > CCMRAM
|
||||
|
||||
/*
|
||||
* The FLASH Bank1.
|
||||
* The C or assembly source must explicitly place the code
|
||||
* or data there using the "section" attribute.
|
||||
*/
|
||||
.b1text :
|
||||
{
|
||||
*(.b1text) /* remaining code */
|
||||
*(.b1rodata) /* read-only data (constants) */
|
||||
*(.b1rodata.*)
|
||||
} >FLASHB1
|
||||
|
||||
/*
|
||||
* The EXTMEM.
|
||||
* The C or assembly source must explicitly place the code or data there
|
||||
* using the "section" attribute.
|
||||
*/
|
||||
|
||||
/* EXTMEM Bank0 */
|
||||
.eb0text :
|
||||
{
|
||||
*(.eb0text) /* remaining code */
|
||||
*(.eb0rodata) /* read-only data (constants) */
|
||||
*(.eb0rodata.*)
|
||||
} >EXTMEMB0
|
||||
|
||||
/* EXTMEM Bank1 */
|
||||
.eb1text :
|
||||
{
|
||||
*(.eb1text) /* remaining code */
|
||||
*(.eb1rodata) /* read-only data (constants) */
|
||||
*(.eb1rodata.*)
|
||||
} >EXTMEMB1
|
||||
|
||||
/* EXTMEM Bank2 */
|
||||
.eb2text :
|
||||
{
|
||||
*(.eb2text) /* remaining code */
|
||||
*(.eb2rodata) /* read-only data (constants) */
|
||||
*(.eb2rodata.*)
|
||||
} >EXTMEMB2
|
||||
|
||||
/* EXTMEM Bank0 */
|
||||
.eb3text :
|
||||
{
|
||||
*(.eb3text) /* remaining code */
|
||||
*(.eb3rodata) /* read-only data (constants) */
|
||||
*(.eb3rodata.*)
|
||||
} >EXTMEMB3
|
||||
|
||||
|
||||
/* After that there are only debugging sections. */
|
||||
|
||||
/* This can remove the debugging information from the standard libraries */
|
||||
/*
|
||||
DISCARD :
|
||||
{
|
||||
libc.a ( * )
|
||||
libm.a ( * )
|
||||
libgcc.a ( * )
|
||||
}
|
||||
*/
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
/*
|
||||
* DWARF debug sections.
|
||||
* Symbols in the DWARF debugging sections are relative to the beginning
|
||||
* of the section so we begin them at 0.
|
||||
*/
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
/* SGI/MIPS DWARF 2 extensions */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
}
|
|
@ -82,6 +82,7 @@ uint8_t modeLast = 2;
|
|||
|
||||
float agcLevel = 0;
|
||||
float agcScale = 160; //Higher is lower volume.. for now
|
||||
float txAgcLevel = 0;
|
||||
|
||||
|
||||
int ifShift = 0;
|
||||
|
@ -272,62 +273,62 @@ void setupPeripheralPower()
|
|||
|
||||
void configDMA(SPI_HandleTypeDef *hspi)
|
||||
{
|
||||
static DMA_HandleTypeDef hdma_tx;
|
||||
static DMA_HandleTypeDef hdma_rx;
|
||||
|
||||
|
||||
hdma_tx.Instance = SPIx_TX_DMA_STREAM;
|
||||
|
||||
hdma_tx.Init.Channel = SPIx_TX_DMA_CHANNEL;
|
||||
hdma_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
|
||||
hdma_tx.Init.PeriphInc = DMA_PINC_DISABLE;
|
||||
hdma_tx.Init.MemInc = DMA_MINC_ENABLE;
|
||||
hdma_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
|
||||
hdma_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
|
||||
hdma_tx.Init.Mode = DMA_NORMAL;
|
||||
hdma_tx.Init.Priority = DMA_PRIORITY_LOW;
|
||||
hdma_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||
hdma_tx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
|
||||
hdma_tx.Init.MemBurst = DMA_MBURST_INC4;
|
||||
hdma_tx.Init.PeriphBurst = DMA_PBURST_INC4;
|
||||
|
||||
HAL_DMA_Init(&hdma_tx);
|
||||
|
||||
/* Associate the initialized DMA handle to the the SPI handle */
|
||||
__HAL_LINKDMA(hspi, hdmatx, hdma_tx);
|
||||
|
||||
/* Configure the DMA handler for Transmission process */
|
||||
hdma_rx.Instance = SPIx_RX_DMA_STREAM;
|
||||
|
||||
hdma_rx.Init.Channel = SPIx_RX_DMA_CHANNEL;
|
||||
hdma_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
|
||||
hdma_rx.Init.PeriphInc = DMA_PINC_DISABLE;
|
||||
hdma_rx.Init.MemInc = DMA_MINC_ENABLE;
|
||||
hdma_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
|
||||
hdma_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
|
||||
hdma_rx.Init.Mode = DMA_NORMAL;
|
||||
hdma_rx.Init.Priority = DMA_PRIORITY_HIGH;
|
||||
hdma_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||
hdma_rx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
|
||||
hdma_rx.Init.MemBurst = DMA_MBURST_INC4;
|
||||
hdma_rx.Init.PeriphBurst = DMA_PBURST_INC4;
|
||||
|
||||
HAL_DMA_Init(&hdma_rx);
|
||||
|
||||
/* Associate the initialized DMA handle to the the SPI handle */
|
||||
__HAL_LINKDMA(hspi, hdmarx, hdma_rx);
|
||||
|
||||
/*##-4- Configure the NVIC for DMA #########################################*/
|
||||
/* NVIC configuration for DMA transfer complete interrupt (SPI3_TX) */
|
||||
HAL_NVIC_SetPriority(15/*SPIx_DMA_TX_IRQn*/, 0, 1);
|
||||
HAL_NVIC_EnableIRQ(SPIx_DMA_TX_IRQn);
|
||||
|
||||
/* NVIC configuration for DMA transfer complete interrupt (SPI3_RX) */
|
||||
HAL_NVIC_SetPriority(SPIx_DMA_RX_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(SPIx_DMA_RX_IRQn);
|
||||
|
||||
|
||||
//HAL_DMA_Start();
|
||||
// static DMA_HandleTypeDef hdma_tx;
|
||||
// static DMA_HandleTypeDef hdma_rx;
|
||||
//
|
||||
//
|
||||
// hdma_tx.Instance = SPIx_TX_DMA_STREAM;
|
||||
//
|
||||
// hdma_tx.Init.Channel = SPIx_TX_DMA_CHANNEL;
|
||||
// hdma_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
|
||||
// hdma_tx.Init.PeriphInc = DMA_PINC_DISABLE;
|
||||
// hdma_tx.Init.MemInc = DMA_MINC_ENABLE;
|
||||
// hdma_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
|
||||
// hdma_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
|
||||
// hdma_tx.Init.Mode = DMA_NORMAL;
|
||||
// hdma_tx.Init.Priority = DMA_PRIORITY_LOW;
|
||||
// hdma_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||
// hdma_tx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
|
||||
// hdma_tx.Init.MemBurst = DMA_MBURST_INC4;
|
||||
// hdma_tx.Init.PeriphBurst = DMA_PBURST_INC4;
|
||||
//
|
||||
// HAL_DMA_Init(&hdma_tx);
|
||||
//
|
||||
// /* Associate the initialized DMA handle to the the SPI handle */
|
||||
// __HAL_LINKDMA(hspi, hdmatx, hdma_tx);
|
||||
//
|
||||
// /* Configure the DMA handler for Transmission process */
|
||||
// hdma_rx.Instance = SPIx_RX_DMA_STREAM;
|
||||
//
|
||||
// hdma_rx.Init.Channel = SPIx_RX_DMA_CHANNEL;
|
||||
// hdma_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
|
||||
// hdma_rx.Init.PeriphInc = DMA_PINC_DISABLE;
|
||||
// hdma_rx.Init.MemInc = DMA_MINC_ENABLE;
|
||||
// hdma_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
|
||||
// hdma_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
|
||||
// hdma_rx.Init.Mode = DMA_NORMAL;
|
||||
// hdma_rx.Init.Priority = DMA_PRIORITY_HIGH;
|
||||
// hdma_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||
// hdma_rx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
|
||||
// hdma_rx.Init.MemBurst = DMA_MBURST_INC4;
|
||||
// hdma_rx.Init.PeriphBurst = DMA_PBURST_INC4;
|
||||
//
|
||||
// HAL_DMA_Init(&hdma_rx);
|
||||
//
|
||||
// /* Associate the initialized DMA handle to the the SPI handle */
|
||||
// __HAL_LINKDMA(hspi, hdmarx, hdma_rx);
|
||||
//
|
||||
// /*##-4- Configure the NVIC for DMA #########################################*/
|
||||
// /* NVIC configuration for DMA transfer complete interrupt (SPI3_TX) */
|
||||
// HAL_NVIC_SetPriority(15/*SPIx_DMA_TX_IRQn*/, 0, 1);
|
||||
// HAL_NVIC_EnableIRQ(SPIx_DMA_TX_IRQn);
|
||||
//
|
||||
// /* NVIC configuration for DMA transfer complete interrupt (SPI3_RX) */
|
||||
// HAL_NVIC_SetPriority(SPIx_DMA_RX_IRQn, 0, 0);
|
||||
// HAL_NVIC_EnableIRQ(SPIx_DMA_RX_IRQn);
|
||||
//
|
||||
//
|
||||
// //HAL_DMA_Start();
|
||||
}
|
||||
|
||||
|
||||
|
@ -440,6 +441,10 @@ int isFwd;
|
|||
int dcOffset2 = 1535;
|
||||
int dcOffset3 = 1518;
|
||||
|
||||
int dac1OutVal = 0;
|
||||
int dac2OutVal = 0;
|
||||
int txDacOutValMax = 0;
|
||||
|
||||
void captureSamples()
|
||||
{
|
||||
if(adcConfigured)
|
||||
|
@ -473,8 +478,18 @@ int isFwd;
|
|||
// dac2SetValue(samplesB[sampleIndex*2+1] + samplesA[(FFT_SIZE - filterKernelLength)
|
||||
// + sampleIndex * 2] /*/ (agcLevel * agcScale)*/ * 4096 * gain + 2048);
|
||||
// } else {
|
||||
dac1SetValue(samplesB[(sampleIndex)*2] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
dac2SetValue(samplesB[(sampleIndex)*2+1] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
|
||||
dac1OutVal = samplesB[(sampleIndex)*2] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048;
|
||||
dac2OutVal = samplesB[(sampleIndex)*2+1] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048;
|
||||
|
||||
if(transmitting == 1)
|
||||
{
|
||||
if(dac1OutVal > txDacOutValMax) txDacOutValMax = dac1OutVal;
|
||||
if(dac2OutVal > txDacOutValMax) txDacOutValMax = dac2OutVal;
|
||||
}
|
||||
|
||||
dac1SetValue(dac1OutVal);
|
||||
dac2SetValue(dac2OutVal);
|
||||
// }
|
||||
|
||||
|
||||
|
@ -510,8 +525,21 @@ int isFwd;
|
|||
// dac2SetValue(samplesC[sampleIndex*2+1] + samplesB[(FFT_SIZE - filterKernelLength)
|
||||
// + sampleIndex * 2] /*/ (agcLevel * agcScale)*/ * 4096 * gain + 2048);
|
||||
// } else {
|
||||
dac1SetValue(samplesC[(sampleIndex)*2] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
dac2SetValue(samplesC[(sampleIndex)*2+1] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
//dac1SetValue(samplesC[(sampleIndex)*2] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
//dac2SetValue(samplesC[(sampleIndex)*2+1] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
|
||||
dac1OutVal = samplesC[(sampleIndex)*2] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048;
|
||||
dac2OutVal = samplesC[(sampleIndex)*2+1] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048;
|
||||
|
||||
if(transmitting == 1)
|
||||
{
|
||||
if(dac1OutVal > txDacOutValMax) txDacOutValMax = dac1OutVal;
|
||||
if(dac2OutVal > txDacOutValMax) txDacOutValMax = dac2OutVal;
|
||||
}
|
||||
|
||||
dac1SetValue(dac1OutVal);
|
||||
dac2SetValue(dac2OutVal);
|
||||
|
||||
// }
|
||||
|
||||
if(sampleIndex >= FFT_SIZE - filterKernelLength - 1)
|
||||
|
@ -544,8 +572,22 @@ int isFwd;
|
|||
// dac2SetValue(samplesA[sampleIndex*2+1] + samplesC[(FFT_SIZE - filterKernelLength)
|
||||
// + sampleIndex * 2] /*/ (agcLevel * agcScale)*/ * 4096 * gain + 2048);
|
||||
// } else {
|
||||
dac1SetValue(samplesA[(sampleIndex)*2] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
dac2SetValue(samplesA[(sampleIndex)*2+1] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
//dac1SetValue(samplesA[(sampleIndex)*2] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
//dac2SetValue(samplesA[(sampleIndex)*2+1] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048);
|
||||
|
||||
dac1OutVal = samplesA[(sampleIndex)*2] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048;
|
||||
dac2OutVal = samplesA[(sampleIndex)*2+1] /*/ (agcLevel * agcScale)*/ * 4096 * afGain + 2048;
|
||||
|
||||
if(transmitting == 1)
|
||||
{
|
||||
if(dac1OutVal > txDacOutValMax) txDacOutValMax = dac1OutVal;
|
||||
if(dac2OutVal > txDacOutValMax) txDacOutValMax = dac2OutVal;
|
||||
}
|
||||
|
||||
dac1SetValue(dac1OutVal);
|
||||
dac2SetValue(dac2OutVal);
|
||||
|
||||
|
||||
// }
|
||||
|
||||
if(sampleIndex >= FFT_SIZE - filterKernelLength - 1)
|
||||
|
@ -670,39 +712,39 @@ uint8_t aTxBuffer[] = "Chris a baby! ";
|
|||
uint8_t aRxBuffer[256];
|
||||
void configUartPeripheral()
|
||||
{
|
||||
//Enable Clocks
|
||||
__GPIOB_CLK_ENABLE();
|
||||
__USART1_CLK_ENABLE();
|
||||
|
||||
//Setup TX Pin
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_6;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
|
||||
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
//Setup RX Pin
|
||||
//It doesn't get set as an input?
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_7;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
|
||||
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
//Configure NVIC
|
||||
HAL_NVIC_SetPriority(USART1_IRQn, 0, 1);
|
||||
HAL_NVIC_EnableIRQ(USART1_IRQn);
|
||||
|
||||
UartHandle.Instance = USART1;
|
||||
UartHandle.Init.BaudRate = 9600;
|
||||
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
UartHandle.Init.StopBits = UART_STOPBITS_1;
|
||||
UartHandle.Init.Parity = UART_PARITY_NONE;
|
||||
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
UartHandle.Init.Mode = UART_MODE_TX_RX;
|
||||
|
||||
HAL_UART_Init(&UartHandle);
|
||||
// //Enable Clocks
|
||||
// __GPIOB_CLK_ENABLE();
|
||||
// __USART1_CLK_ENABLE();
|
||||
//
|
||||
// //Setup TX Pin
|
||||
// GPIO_InitStruct.Pin = GPIO_PIN_6;
|
||||
// GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
// GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
// GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
|
||||
// GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
|
||||
//
|
||||
// HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
//
|
||||
// //Setup RX Pin
|
||||
// //It doesn't get set as an input?
|
||||
// GPIO_InitStruct.Pin = GPIO_PIN_7;
|
||||
// GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
|
||||
//
|
||||
// HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
//
|
||||
// //Configure NVIC
|
||||
// HAL_NVIC_SetPriority(USART1_IRQn, 0, 1);
|
||||
// HAL_NVIC_EnableIRQ(USART1_IRQn);
|
||||
//
|
||||
// UartHandle.Instance = USART1;
|
||||
// UartHandle.Init.BaudRate = 9600;
|
||||
// UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
// UartHandle.Init.StopBits = UART_STOPBITS_1;
|
||||
// UartHandle.Init.Parity = UART_PARITY_NONE;
|
||||
// UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
// UartHandle.Init.Mode = UART_MODE_TX_RX;
|
||||
//
|
||||
// HAL_UART_Init(&UartHandle);
|
||||
}
|
||||
|
||||
|
||||
|
@ -821,7 +863,8 @@ main(int argc, char* argv[])
|
|||
Adafruit_GFX_fillRect(310, 8, 3, 3, HAL_GPIO_ReadPin(TOUCH1.port, TOUCH1.pin) ? ILI9340_RED : ILI9340_BLUE);
|
||||
Adafruit_GFX_fillRect(310, 12, 3, 3, HAL_GPIO_ReadPin(TOUCH2.port, TOUCH2.pin) ? ILI9340_RED : ILI9340_BLUE);
|
||||
|
||||
if(HAL_GPIO_ReadPin(TOUCH1.port, TOUCH1.pin))
|
||||
//if(HAL_GPIO_ReadPin(TOUCH1.port, TOUCH1.pin))
|
||||
if(1) //I am locking it in transmit for some testing.
|
||||
{
|
||||
transmitting = 1;
|
||||
HAL_GPIO_WritePin(DAC_MUX.port, DAC_MUX.pin, 1); //0 = speaker/earphone. 1=TX Drivers
|
||||
|
@ -830,7 +873,7 @@ main(int argc, char* argv[])
|
|||
HAL_GPIO_WritePin(AMP_SWITCH_A.port, AMP_SWITCH_A.pin, 1); //Route through amp.
|
||||
HAL_GPIO_WritePin(AMP_SWITCH_B.port, AMP_SWITCH_B.pin, 0); //always reverse of above.
|
||||
HAL_GPIO_WritePin(AMP_POWER.port, AMP_POWER.pin, 0); //0 is on.
|
||||
tone = 0;
|
||||
tone = 200;
|
||||
} else {
|
||||
transmitting = 0;
|
||||
HAL_GPIO_WritePin(DAC_MUX.port, DAC_MUX.pin, 0); //0 = speaker/earphone. 1=TX Drivers
|
||||
|
@ -1156,7 +1199,8 @@ void fillSamepleWithTone(int tone, float *samples)
|
|||
samples[i] = 0;
|
||||
}
|
||||
|
||||
samples[tone] = 1;
|
||||
samples[tone*2] = 0.9;
|
||||
samples[tone*2+1] = 0.9;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue