Skip to content

Commit

Permalink
Added STM32pedalStomps.pdf; Improved Readme, now containing also CC v…
Browse files Browse the repository at this point in the history
…alues and info on Page2 button and Mode potentiometer; Renamed main to .c and added wrapper for accessing Cpp classes, this is to have the possibility to regenerate the main from the ioc automatically.
  • Loading branch information
caltabid committed May 21, 2021
1 parent c6591f0 commit ce5658f
Show file tree
Hide file tree
Showing 22 changed files with 87 additions and 27 deletions.
Binary file modified Documents/Disc407.bin
Binary file not shown.
Binary file added Documents/STM32pedalStomps.pdf
Binary file not shown.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,34 @@ I got great inspiration from 2 open source projects:

## Specifications

* 10 buttons
* 8 potentiometers
### Features
* 10 buttons (9 general purpose + Page2)
* 8 potentiometers (7 general purpose + Mode)
* 2 expression pedals
* USB MIDI class-compliant

### How to use it
Page2/Looper Btn
* When activated (Led on) use second page for other buttons
* No CC is sent when pressed
Mode potentiometer (#8, the last one)
* Left => Normal mode: Btn sends 127 when activated (Led On) and 0 on deactivation
* Right => Bypass mode: Btn sends 0 when activated (Led On) and 127 on deactivation
* Half => Disable potentiometers CC
* No CC is sent when rotated
Button CC values (excluded Looper/Page2 Btn)
{51, 52, 53, 54, 55, 56, 57, 58, 59}
{61, 62, 63, 64, 65, 66, 67, 68, 69}
Potentiometers CC values (excluded Mode Pot)
{18, 19, 20, 21, 22, 23, 24};
Expression pedal CC values
{16, 17};

## Building Information

### Making hardware

See [Presentation](./Documents/STM32pedalStomps.odp)
See [Presentation](./Documents/STM32pedalStomps.pdf)

Basically you should work some wood:

Expand All @@ -44,7 +62,7 @@ When building the binary file will be created in /stm32/Debug/ or /stm32/Release

* [Binary file for STM32F407G-DISC1](./Documents/Disc407.bin)
* [STM32CubeIDE Project file](./stm32/)
* [Documentation](./Documents/STM32pedalStomps.odp)
* [Documentation](./Documents/STM32pedalStomps.pdf)

## NOTICE

Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Inc/CAllDevices.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* AllDevices.h
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#ifndef SRC_CALLDEVICES_H_
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Inc/CDebounce.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CDebounce.h
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#ifndef SRC_CDEBOUNCE_H_
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Inc/CExp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CExp.h
*
* Created on: May 15, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#ifndef SRC_CEXP_H_
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Inc/CFIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CFIR.h
*
* Created on: May 15, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#ifndef SRC_CFIR_H_
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Inc/CPot.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CPot.h
*
* Created on: May 15, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#ifndef SRC_CPOT_H_
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Inc/CPwmLed.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* PwmLed.h
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#ifndef SRC_PWMLED_H_
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Inc/CStompBtn.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CStompBtn.h
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#ifndef SRC_CSTOMPBTN_H_
Expand Down
20 changes: 20 additions & 0 deletions stm32/Core/Inc/Process.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Process.h
*
* Created on: 21 May 2021
* Author: Daniele Caltabiano
*/

#ifndef INC_PROCESS_H_
#define INC_PROCESS_H_

#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#endif

EXTERNC void ProcessInit(void);
EXTERNC void ProcessExecute(void);

#endif /* INC_PROCESS_H_ */
2 changes: 1 addition & 1 deletion stm32/Core/Inc/midilib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* midilib.h
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#ifndef __MIDI_LIB_H
Expand Down
5 changes: 2 additions & 3 deletions stm32/Core/Src/CAllDevices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* AllDevices.cpp
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#include "CAllDevices.h"
Expand Down Expand Up @@ -63,8 +63,6 @@ void CAllDevices::Update(void)
int i, Mode, StompPolarity, EnablePot;
CStompBtn *ActiveLayer;

HAL_Delay(1);
//this->tick++;
//Wait USB configuration when USB connection error has occurred.
if(USBD_STATE_CONFIGURED != hUsbDeviceFS.dev_state) {
this->LedMain.Set(0, 400, 200);
Expand Down Expand Up @@ -101,6 +99,7 @@ void CAllDevices::Update(void)
if (Exp[0].Update()) this->LedMain.Pulse();
if (Exp[1].Update()) this->LedMain.Pulse();
this->LedMain.Update();
USBD_MIDI_SendPacket();

if( FUNC_SUCCESS == midiGetFromUsbRx(0, &uart_tx_dat) ) {
this->LedMain.Pulse();
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Src/CDebounce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CDebounce.cpp
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#include "CDebounce.h"
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Src/CExp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CExp.cpp
*
* Created on: May 15, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#include "CExp.h"
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Src/CFIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CFIR.cpp
*
* Created on: May 15, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#include "CFIR.h"
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Src/CPot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CPot.cpp
*
* Created on: May 15, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#include "CPot.h"
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Src/CPwmLed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* PwmLed.cpp
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#include <CPwmLed.h>
Expand Down
2 changes: 1 addition & 1 deletion stm32/Core/Src/CStompBtn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CStompBtn.cpp
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#include "CStompBtn.h"
Expand Down
23 changes: 23 additions & 0 deletions stm32/Core/Src/Process.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Process.cpp
*
* Created on: 21 May 2021
* Author: Daniele Caltabiano
*/



#include "Process.h"
#include "CAllDevices.h"

CAllDevices AllDevices;

void ProcessInit(void)
{

}

void ProcessExecute(void)
{
AllDevices.Update();
}
8 changes: 5 additions & 3 deletions stm32/Core/Src/main.cpp → stm32/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "usbd_midi_if.h"
#include "CAllDevices.h"
#include "Process.h"
/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
Expand Down Expand Up @@ -77,7 +77,7 @@ uint16_t *getADCbuffer(void)
int main(void)
{
/* USER CODE BEGIN 1 */
CAllDevices AllDevices;

/* USER CODE END 1 */

/* MCU Configuration--------------------------------------------------------*/
Expand All @@ -86,6 +86,7 @@ int main(void)
HAL_Init();

/* USER CODE BEGIN Init */
ProcessInit();

/* USER CODE END Init */

Expand Down Expand Up @@ -132,7 +133,8 @@ int main(void)
/* USER CODE END WHILE */

/* USER CODE BEGIN 3 */
AllDevices.Update();
HAL_Delay(1);
ProcessExecute();
}
/* USER CODE END 3 */
}
Expand Down
4 changes: 1 addition & 3 deletions stm32/Core/Src/midilib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* midilib.c
*
* Created on: May 14, 2021
* Author: caltabid
* Author: Daniele Caltabiano
*/

#include "midilib.h"
Expand All @@ -19,7 +19,6 @@ void sendMidiNote(uint8_t noteOnOff, uint8_t channel, uint8_t pitch, uint8_t vel
{
midiEventPacket_t MidiMsg = {0x08 | noteOnOff, 0x80 | channel, pitch, velocity};
sendMidiMessage(&MidiMsg.type, 4);
USBD_MIDI_SendPacket();
}

// Event type hard-coded (0x0B = control change, aka "MIDI CC").
Expand All @@ -31,5 +30,4 @@ void sendMidiCC(uint8_t channel, uint8_t control, uint8_t value)
{
midiEventPacket_t MidiMsg = {0x0B, 0xB0 | channel, control, value};
sendMidiMessage(&MidiMsg.type, 4);
USBD_MIDI_SendPacket();
}

0 comments on commit ce5658f

Please sign in to comment.