Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
b1fd0bd
add SAMM code from last year
planeflight Mar 31, 2026
effa315
change pinouts in main.c
planeflight Mar 31, 2026
4899164
changed gpio.c and removed the extra pinouts
planeflight Mar 31, 2026
f46c2ec
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Mar 31, 2026
8bbfe39
Merge branch 'main' into SensorMigration
dchansen06 Mar 31, 2026
824b55e
Merge branch 'main' into SensorMigration
dchansen06 Mar 31, 2026
8fc611e
Merge branch 'main' into SensorMigration
dchansen06 Mar 31, 2026
8b2d3b3
Merge branch 'main' into SensorMigration
dchansen06 Apr 3, 2026
83e55d0
Added new folders under SAMM
Shrav816 Apr 3, 2026
a87ae15
added and configured IMU
TurtleTest2 Apr 3, 2026
ce994e5
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 3, 2026
3ee54ac
Merge branch 'main' into SensorMigration
dchansen06 Apr 7, 2026
b98a494
Merge branch 'main' into SensorMigration
dchansen06 Apr 7, 2026
1faab9c
Merge branch 'main' into SensorMigration
dchansen06 Apr 7, 2026
126385c
Moved some common files, corrected I2C pin for ToF
Shrav816 Apr 7, 2026
a9a8c53
Additions to mag encoder files
Shrav816 Apr 9, 2026
3dcfbe2
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 9, 2026
c080b8f
Corrected GPIO pins for SPI and FDCAN
Shrav816 Apr 9, 2026
4bb0eaf
Merge branch 'main' into SensorMigration
dchansen06 Apr 10, 2026
44cfb2a
Reorganized files under IMUandMAG
Shrav816 Apr 10, 2026
5164eee
Further reorganization, modifying some G4 files to H5
Shrav816 Apr 10, 2026
ec1b39d
Renaming g4 files, (partly) setting up cmake
Shrav816 Apr 10, 2026
a31f77a
More cmake changes
Shrav816 Apr 10, 2026
8f31c7c
Automatic CMake Format: Standardized formatting automatically
github-actions[bot] Apr 10, 2026
5e4ee01
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 10, 2026
e39de18
Merge branch 'main' into SensorMigration
dchansen06 Apr 10, 2026
e994bd3
Mag updates, set up CMake
Shrav816 Apr 10, 2026
0c66d0f
MAG changes
Shrav816 Apr 10, 2026
25b93fd
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 10, 2026
7f97648
Merge branch 'main' into SensorMigration
dchansen06 Apr 13, 2026
1af33bf
Merge branch 'main' into SensorMigration
dchansen06 Apr 14, 2026
d149348
Changed HSE, LSE, CSI clock speeds to match H5
Shrav816 Apr 13, 2026
905881d
Updates to mag functions
Shrav816 Apr 14, 2026
c52ac3a
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 14, 2026
8cda034
Changed CMakeLists.txt - SAMM_MAG needs to be changed to SAMM_Mag, MA…
anthony9975 Apr 14, 2026
0dd5d31
Some small fixes hopefully
dchansen06 Apr 14, 2026
2be366b
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 14, 2026
c2e2b60
Fixed includes
Shrav816 Apr 14, 2026
d61f2a5
Merge branch 'main' into SensorMigration
dchansen06 Apr 14, 2026
573da1b
Fixed adc issues
Shrav816 Apr 14, 2026
469339a
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 14, 2026
05b108c
Fixed some more includes
Shrav816 Apr 14, 2026
ebc6fe4
More debugging for linker problems
Shrav816 Apr 14, 2026
dc5ea22
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 14, 2026
7e1c192
Merge branch 'main' into SensorMigration
dchansen06 Apr 14, 2026
8fc1c00
Merge branch 'main' into SensorMigration
dchansen06 Apr 14, 2026
9c9e892
Merge branch 'main' into SensorMigration
dchansen06 Apr 17, 2026
9105460
Merge branch 'main' into SensorMigration
dchansen06 Apr 17, 2026
9343d1b
Removed FDCAN files, removed some linker errors
Shrav816 Apr 17, 2026
8c9fbb7
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 17, 2026
14fead5
Modified CMake files to address removing fdcan
Shrav816 Apr 17, 2026
0f3457a
Merge branch 'main' into SensorMigration
dchansen06 Apr 17, 2026
d94d7b7
Added safety and changed read and write, added error checker function…
kiranduriseti1 Apr 17, 2026
7002bfb
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 17, 2026
f032f5d
Merge branch 'main' into SensorMigration
dchansen06 Apr 17, 2026
9229db9
Minor changes
Shrav816 Apr 17, 2026
aa242c3
Automatic Clang-Format: Standardized formatting automatically
github-actions[bot] Apr 17, 2026
54c5725
Merge branch 'main' into SensorMigration
dchansen06 Apr 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ add_gr_project(STM32G474xE AnalogCalibration)
add_gr_project(STM32G474xE CANine)
add_gr_project(STM32G431x8 TireTemp)

# SAMM
include("SAMM/samm.cmake")
add_gr_project(STM32H523xE SAMM SAMM_TOF)
add_gr_project(STM32H523xE SAMM SAMM_Mag)

# Development
add_gr_project(STM32G474xE G4PERTESTING)
add_gr_project(STM32G474xE G4SPITESTING)
Expand Down
70 changes: 70 additions & 0 deletions SAMM/Core/Extras/CircBuF/circularBuffer.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#include "circularBuffer.h"
CircularBuffer *circular_buffer_init(size_t capacity, size_t max_array_size)
{
CircularBuffer *cb = malloc(sizeof(CircularBuffer));
if (!cb) {
return NULL;
}

cb->buffer = malloc(capacity * sizeof(void *));
if (!cb->buffer) {
free(cb);
return NULL;
}

for (size_t i = 0; i < capacity; i++) {
cb->buffer[i] = malloc(max_array_size);
if (!cb->buffer[i]) {
for (size_t j = 0; j < i; j++) {
free(cb->buffer[j]);
}
free(cb->buffer);
free(cb);
return NULL;
}
}
cb->capacity = capacity;
cb->max_arr_size = max_array_size;
cb->head = 0;
cb->tail = 0;
cb->size = 0;
return cb;
}

void circularBufferDestroy(CircularBuffer *cb)
{
if (!cb) {
return;
}

for (size_t i = 0; i < cb->capacity; i++) {
free(cb->buffer[i]);
}
free(cb->buffer);
free(cb);
}

int circularBufferPush(CircularBuffer *cb, void *array, size_t array_size)
{
if (!cb || cb->size == cb->capacity || array_size > cb->max_arr_size) {
return -1; // Buffer is full or array is too large
}

// Copy the array into the buffer
memcpy(cb->buffer[cb->head], array, array_size);
cb->head = (cb->head + 1) % cb->capacity;
cb->size++;
return 0;
}

void *circularBufferPop(CircularBuffer *cb)
{
if (!cb || cb->size == 0) {
return NULL; // Buffer is empty
}

void *array = cb->buffer[cb->tail];
cb->tail = (cb->tail + 1) % cb->capacity;
cb->size--;
return array;
}
22 changes: 22 additions & 0 deletions SAMM/Core/Extras/CircBuF/circularBuffer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef __circularBuffer_h__
#define __circularBuffer_h__

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct {
void **buffer; // Array of void pointers
uint8_t capacity; // Maximum number of elements in the buffer
uint8_t head; // Index of the next element to write
uint8_t tail; // Index of the next element to read
uint8_t size; // Current number of elements in the buffer
uint8_t max_arr_size; // Maximum size of the array
} CircularBuffer;

CircularBuffer *circular_buffer_init(size_t capacity, size_t max_array_size);
void circularBufferDestroy(CircularBuffer *cb);
int circularBufferPush(CircularBuffer *cb, void *array, size_t array_size);
void *circularBufferPop(CircularBuffer *cb);
#endif
Loading
Loading