diff options
| author | Dawsyn Schraiber <[email protected]> | 2025-06-20 00:10:22 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-20 00:10:22 -0400 |
| commit | 5375c6d876f115a2bd75ec45796e5333ba928082 (patch) | |
| tree | 51d8701b6e0b10b3171c8a146304a3accf57d150 /include/spi_flash.h | |
| parent | e07f105022f3ad6e3c6ee2dfe4cc01eb91c1f373 (diff) | |
| download | active-drag-system-main.tar.gz active-drag-system-main.tar.bz2 active-drag-system-main.zip | |
# Dawsyn's Final Commit
This one is a little emotional as this is my final commit in this repository and as a member of Rocketry at Virginia Tech. This merges the changes seen in the branch known as 'big_kahuna' into main. This is the version of the ADS software as seen on [Roadkill](https://drive.google.com/file/d/120BvI-0ntliHo6i9UxcCn2pXAl-JsdP_/view?usp=drive_link) in the 2025 IREC competition. There are bound to be bugs, but I have found it useful to have the final competition version to be the one present on main at the end of every academic year. Hopefully this is useful to the next lead.
## Primary Changes
+ NEW I2C drivers to support sensors present on new ADS custom PCB
+ NEW logging library found in separate repository and pulled in as submodule ([pico-logger](https://github.com/rocketryvt/pico-logger))
+ No longer dependent on different flash chip from one used for code storage! Compile executable as RP2040 'copy-to-ram' type to increase flash read/write speeds!
+ NEW fixed-point libraries to allow for increased performance and sensor sampling speeds on RP2040 that lacks FPU
+ FreeRTOS Simultaneous Multi-processing (SMP) architecture for task handling and easier introduction / testing of new features
+ Serial monitor / command system with task performance monitoring commands
+ WORKING Kalman filter that takes altitude from barometer as measurement and z-axis acceleration from IMU as control to generate state vector containing filtered altitude and vertical velocity
+ NEW CFD equations from the Ben-ogrithm (to replace the Chen-ogrithm) that includes:
+ Apogee prediction model that takes current drag force, altitude, and vertical velocity
+ Current Drag Force equation based on current deployment and vertical velocity to use for Apogee Prediction model
+ Desired Drag force equation based on current altitude and vertical velocity to generate what drag force is needed to reach 10K ft
+ Deployment percentage equation based on current velocity and desired drag force to map to flap deployment percentage
Diffstat (limited to 'include/spi_flash.h')
| -rw-r--r-- | include/spi_flash.h | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/include/spi_flash.h b/include/spi_flash.h deleted file mode 100644 index d3c0247..0000000 --- a/include/spi_flash.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef SPI_FLASH -#define SPI_FLASH - -#include <stdint.h> -#include "hardware/spi.h" -#include "boards/pico_w.h" -#include "pico/stdlib.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define FLASH_PAGE_SIZE 256 -#define FLASH_NUM_PAGES 32768 -#define FLASH_SECTOR_SIZE 4096 -#define FLASH_BLOCK_SIZE 65536 -#define FLASH_PHYS_SIZE (FLASH_PAGE_SIZE * FLASH_NUM_PAGES) - -#define FLASH_CMD_PAGE_PROGRAM 0x02 -#define FLASH_CMD_READ 0x03 -#define FLASH_CMD_STATUS 0x05 -#define FLASH_CMD_WRITE_EN 0x06 -#define FLASH_CMD_SECTOR_ERASE 0x20 -#define FLASH_CMD_BLOCK_ERASE 0xD8 -#define FLASH_CMD_CHIP_ERASE 0xC7 - -#define FLASH_STATUS_BUSY_MASK 0x01 - -// #define FLASH_TEST - -#define PACKET_SIZE 32 - - -static uint8_t page_buffer[FLASH_PAGE_SIZE]; -static uint32_t base_addr = 0; - -void write_entry(uint8_t* data_entry); - -void __not_in_flash_func(flash_read)(spi_inst_t *spi, uint cs_pin, uint32_t addr, uint8_t *dest, size_t len); - - -void __not_in_flash_func(flash_write_enable)(spi_inst_t *spi, uint cs_pin); -void __not_in_flash_func(flash_page_program)(spi_inst_t *spi, uint cs_pin, uint32_t addr, uint8_t* src); -void __not_in_flash_func(flash_write)(spi_inst_t *spi, uint cs_pin, uint32_t addr, uint8_t* src, size_t size); - -void __not_in_flash_func(flash_wait_done)(spi_inst_t *spi, uint cs_pin); - -void __not_in_flash_func(flash_sector_erase)(spi_inst_t *spi, uint cs_pin, uint32_t addr); -void __not_in_flash_func(flash_block_erase)(spi_inst_t *spi, uint cs_pin, uint32_t addr); -void __not_in_flash_func(flash_erase)(spi_inst_t *spi, uint cs_pin); - -#ifdef __cplusplus -} -#endif -#endif |
