Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ jobs:
- uses: fiam/arm-none-eabi-gcc@v1
with:
release: '9-2020-q2'
- run: cd motorControllerV1 && cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./cmake/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug . && cmake --build . -- -j 4
- run: cd motor_controller && cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./cmake/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug . && cmake --build . -- -j 4
- run: cd examples/adc && cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./cmake/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug . && cmake --build . -- -j 4
- run: cd examples/dac && cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./cmake/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug . && cmake --build . -- -j 4
- run: cd examples/blinky && cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./cmake/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug . && cmake --build . -- -j 4
- run: cd examples/pwm && cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./cmake/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug . && cmake --build . -- -j 4
- run: cd examples/pollingInput && cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./cmake/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug . && cmake --build . -- -j 4
- run: cd examples/interruptInput && cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./cmake/arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug . && cmake --build . -- -j 4

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
[submodule "common/etl"]
path = common/etl
url = https://github.com/ETLCPP/etl
[submodule "ChibiOS-Contrib"]
path = ChibiOS-Contrib
url = https://github.com/ChibiOS/ChibiOS-Contrib
1 change: 1 addition & 0 deletions ChibiOS-Contrib
Submodule ChibiOS-Contrib added at 2c374c
61 changes: 61 additions & 0 deletions adc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

#STM32Cube IDE build files
Debug/
.settings

#CMake build files
build/

#VS code settings
.vscode/.cortex-debug.peripherals.state.json
.vscode/.cortex-debug.registers.state.json

#python unnecessary file
__pycache__/
.idea/
10 changes: 10 additions & 0 deletions adc/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-vscode.cpptools",
"twxs.cmake",
"ms-vscode.cmake-tools",
"marus25.cortex-debug"
]
}
17 changes: 17 additions & 0 deletions adc/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"cwd": "${workspaceRoot}",
"executable": "${command:cmake.launchTargetPath}",
"name": "Debug Microcontroller",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"configFiles": ["${workspaceFolder}/../common/f3_openocd.cfg"],
"svdFile": "${workspaceFolder}/../common/SVD/STM32F303.svd",
"demangle": true,
"runToMain": true
}
]
}
7 changes: 7 additions & 0 deletions adc/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

{
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE" : "${workspaceFolder}/cmake/arm-none-eabi-gcc.cmake",
},
"cmake.parallelJobs": 12
}
23 changes: 23 additions & 0 deletions adc/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "CMake Build",
"command": "cmd",
"args": ["-c", "${input:buildCommand}"],
"type": "shell",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
],
"inputs": [
{
"id": "buildCommand",
"type": "command",
"command": "cmake.tasksBuildCommand"
}
]
}
41 changes: 41 additions & 0 deletions adc/App/Src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include "ch.h"
#include "hal.h"
#include "chprintf.h"
static const ADCConversionGroup adcCfg = {
.circular = false,
.num_channels = 1,
.end_cb = NULL,
.error_cb = NULL,
.cfgr = ADC_CFGR_CONT,
.tr1 = ADC_TR_DISABLED,
.tr2 = ADC_TR_DISABLED,
.tr3 = ADC_TR_DISABLED,
.awd2cr = 0U,
.awd3cr = 0U,
.smpr = {
ADC_SMPR1_SMP_AN1(ADC_SMPR_SMP_19P5),
0
},
.sqr = {
ADC_SQR1_SQ1_N(ADC_CHANNEL_IN1),
0,
0,
0
}
};
int main(void)
{
chSysInit();
halInit();
palSetPadMode(GPIOA, GPIOA_PIN0, PAL_MODE_INPUT_ANALOG);
sdStart(&SD2, NULL);
adcStart(&ADCD1, NULL);
while(1) {
adcsample_t buffer[2];
msg_t status = adcConvert(&ADCD1, &adcCfg, buffer, 2);
chprintf((BaseSequentialStream*)&SD2, "ADC 0 is %d \r\n", buffer[0]);
chThdSleepMilliseconds(20);
}
}


Loading