From 7641376596d580bb2497aee46585f800355c3414 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sun, 7 Jan 2024 18:19:44 -0500 Subject: [PATCH] update STM32F4XX_Platform submodule; remove unneeded EXTERNAL_OSC defines (this can handily be done in Makefiles if necessary so we'll default the hardcode to 12mhz); correct some minor file formatting; --- Defines.h | 7 ------- IO.h | 18 ++++++++++++------ IOSTM.cpp | 16 ++++++++++++++-- STM32F4XX_Platform | 2 +- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Defines.h b/Defines.h index b956fd2..e99482a 100644 --- a/Defines.h +++ b/Defines.h @@ -129,16 +129,9 @@ typedef unsigned long long ulong64_t; // Frequencies such as 12.0 Mhz (48000 * 250) and 14.4 Mhz (48000 * 300) are suitable. // Frequencies such as 10.0 Mhz (48000 * 208.333) or 20 Mhz (48000 * 416.666) are not suitable. // -// For 12 MHz #ifndef EXTERNAL_OSC #define EXTERNAL_OSC 12000000 #endif -// For 12.288 MHz -// #define EXTERNAL_OSC 12288000 -// For 14.4 MHz -// #define EXTERNAL_OSC 14400000 -// For 19.2 MHz -// #define EXTERNAL_OSC 19200000 // Sanity check to make sure EXTERNAL_OSC is a valid integer multiple of 48kHz #if (EXTERNAL_OSC % 48000 != 0) diff --git a/IO.h b/IO.h index 485b1ea..9e82cd5 100644 --- a/IO.h +++ b/IO.h @@ -102,19 +102,25 @@ class DSP_FW_API IO { void selfTest(); #if SPI_ENABLED -void SPI_Write(uint8_t* bytes, uint8_t length); + /// + void SPI_Write(uint8_t* bytes, uint8_t length); -uint16_t SPI_Read(); + /// + uint16_t SPI_Read(); #endif #if DIGIPOT_ENABLED -void SetDigipot(uint8_t value); + /// + void SetDigipot(uint8_t value); -void SetTxDigipot(uint8_t value); + /// + void SetTxDigipot(uint8_t value); -void SetRxDigipot(uint8_t value); + /// + void SetRxDigipot(uint8_t value); -void SetRsDigipot(uint8_t value); + /// + void SetRsDigipot(uint8_t value); #endif private: diff --git a/IOSTM.cpp b/IOSTM.cpp index bea9753..14ed7f7 100644 --- a/IOSTM.cpp +++ b/IOSTM.cpp @@ -488,6 +488,10 @@ void IO::SetDigipot(uint8_t value) SPI_Write(bytes, 2); } +/// +/// +/// +/// void IO::SetTxDigipot(uint8_t value) { // Set CS for TX pot to low @@ -496,6 +500,10 @@ void IO::SetTxDigipot(uint8_t value) GPIO_WriteBit(PORT_CS_TXPOT, PIN_CS_TXPOT, Bit_SET); } +/// +/// +/// +/// void IO::SetRxDigipot(uint8_t value) { // Set CS for RX pot to low @@ -504,6 +512,10 @@ void IO::SetRxDigipot(uint8_t value) GPIO_WriteBit(PORT_CS_RXPOT, PIN_CS_RXPOT, Bit_SET); } +/// +/// +/// +/// void IO::SetRsDigipot(uint8_t value) { // Set CS for TX pot to low @@ -763,7 +775,7 @@ void IO::startInt() nvicStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&nvicStructure); - #if defined(SPI_ENABLED) +#if defined(SPI_ENABLED) SPI_InitTypeDef SPI_Initstruct; SPI_Initstruct.SPI_Direction = SPI_Direction_2Lines_FullDuplex; SPI_Initstruct.SPI_Mode = SPI_Mode_Master; @@ -776,7 +788,7 @@ void IO::startInt() SPI_Initstruct.SPI_FirstBit = SPI_FirstBit_MSB; SPI_Init(SPI_PERIPH, &SPI_Initstruct); SPI_Cmd(SPI_PERIPH, ENABLE); - #endif +#endif GPIO_ResetBits(PORT_COSLED, PIN_COSLED); GPIO_SetBits(PORT_LED, PIN_LED); diff --git a/STM32F4XX_Platform b/STM32F4XX_Platform index 9d0edc6..2141c19 160000 --- a/STM32F4XX_Platform +++ b/STM32F4XX_Platform @@ -1 +1 @@ -Subproject commit 9d0edc6fa63a7fc33426c985f878e34699497b0a +Subproject commit 2141c1906188675017a321a7835ac68b63433272