### FFT Bin Example Setup Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm__fft__bin__example__f32_8c_source.html Defines the number of samples for the FFT test and declares external input and static output buffers. It also initializes global variables for FFT size, inverse FFT flag, and bit reversal. ```c #include "arm_math.h" #define TEST_LENGTH_SAMPLES 2048 extern float32_t testInput_f32_10khz[TEST_LENGTH_SAMPLES]; static float32_t testOutput[TEST_LENGTH_SAMPLES/2]; uint32_t fftSize = 1024; uint32_t ifftFlag = 0; uint32_t doBitReverse = 1; /* Reference index at which max energy of bin ocuurs */ uint32_t refIndex = 213, testIndex = 0; ``` -------------------------------- ### Sine and Cosine Example Setup Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm__sin__cos__example__f32_8c_source.html Includes necessary headers and defines constants for the sine and cosine calculation example. MAX_BLOCKSIZE defines the maximum buffer size, and DELTA is a small value used for comparisons or calculations. ```c #include #include "arm_math.h" /*---------------------------------------------------------------------------- * Defines each of the tests performed *----------------------------------------------------------------------------*/ #define MAX_BLOCKSIZE 32 #define DELTA (0.000001f) ``` -------------------------------- ### Linear Interpolation Example Setup Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm__linear__interp__example__f32_8c.html This snippet shows the definitions for the linear interpolation example, including test length and spacing. It is used to configure the test parameters. ```c #define SNR_THRESHOLD 90 #define TEST_LENGTH_SAMPLES 10 #define XSPACING (0.00005f) ``` -------------------------------- ### Sine and Cosine Example Main Function Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm__sin__cos__example__f32_8c.html The main function serves as the entry point for the sine and cosine example. It orchestrates the execution of the example, likely involving setup, processing, and verification steps. ```c #include #include "arm_math.h" int32_t main(void) { return 0; } ``` -------------------------------- ### Variance Example Setup Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm__variance__example__f32_8c_source.html Includes necessary headers and defines constants for the variance calculation example. MAX_BLOCKSIZE sets the maximum size of the input array, and DELTA is a small value used in calculations. ```c #include #include "[arm\_math.h](arm__math_8h.html)" /* ---------------------------------------------------------------------- * Defines each of the tests performed * ------------------------------------------------------------------- */ #define MAX_BLOCKSIZE 32 #define DELTA (0.000001f) /* ---------------------------------------------------------------------- * Declare I/O buffers * ------------------------------------------------------------------- */ [float32_t](arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715 "32-bit floating-point type definition.") [wire1](arm__signal__converge__example__f32_8c.html#a16e759789fbc05f878863f009066c8ea)[[MAX_BLOCKSIZE](arm__variance__example__f32_8c.html#af8a1d2ed31f7c9a00fec46a798edb61b)]; [float32_t](arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715 "32-bit floating-point type definition.") [wire2](arm__signal__converge__example__f32_8c.html#a4e370163c81ae2b72cc655a6b79e4c6a)[[MAX_BLOCKSIZE](arm__variance__example__f32_8c.html#af8a1d2ed31f7c9a00fec46a798edb61b)]; [float32_t](arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715 "32-bit floating-point type definition.") [wire3](arm__signal__converge__example__f32_8c.html#a7e2cceadf6ec7f0aa0f698a680fa3a4b)[[MAX_BLOCKSIZE](arm__variance__example__f32_8c.html#af8a1d2ed31f7c9a00fec46a798edb61b)]; ``` -------------------------------- ### Floating-point Convolution Example Setup Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm_convolution_example_f32_8c-example.html This section defines constants and declares buffers for the floating-point convolution example. It sets the maximum block size and the output buffer size, which is twice the block size. ```c #include "[arm\_math.h](arm__math_8h.html)" #include "math\_helper.h" /* ---------------------------------------------------------------------- * Defines each of the tests performed * ------------------------------------------------------------------- */ #define MAX_BLOCKSIZE 128 #define DELTA (0.000001f) #define SNR_THRESHOLD 90 /* ---------------------------------------------------------------------- * Declare I/O buffers * ------------------------------------------------------------------- */ [float32_t](arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715 "32-bit floating-point type definition.") [Ak](arm__convolution__example__f32_8c.html#aed74eacd4b96cc7f71b64d18f2e95705)[[MAX_BLOCKSIZE](arm__convolution__example__f32_8c.html#af8a1d2ed31f7c9a00fec46a798edb61b)]; /* Input A */ [float32_t](arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715 "32-bit floating-point type definition.") [Bk](arm__convolution__example__f32_8c.html#a88a0167516ae7ed66203fd60e6ddeea3)[[MAX_BLOCKSIZE](arm__convolution__example__f32_8c.html#af8a1d2ed31f7c9a00fec46a798edb61b)]; /* Input B */ [float32_t](arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715 "32-bit floating-point type definition.") [AxB](arm__convolution__example__f32_8c.html#a13521f3164dc55679f43b7cb2e41e098)[[MAX_BLOCKSIZE](arm__convolution__example__f32_8c.html#af8a1d2ed31f7c9a00fec46a798edb61b) * 2]; /* Output */ ``` -------------------------------- ### Dot Product Example Setup Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm__dotproduct__example__f32_8c.html Defines the maximum block size for the dot product operation and a small delta value for floating-point comparisons. These are used to configure and verify the dot product calculation. ```c #include #include "arm_math.h" ``` ```c #define MAX_BLOCKSIZE 32 #define DELTA (0.000001f) ``` -------------------------------- ### Example Bootloader Log Message Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/Marlin/src/HAL/HC32/README.md Observe serial output during boot for messages indicating the application start address, such as 'GotoApp->addr=0xC000'. This message appears before Marlin's startup messages. ```text version 1.2 sdio init success! Disk init Tips ------ None Firmware file GotoApp->addr=0xC000 start [...] ``` -------------------------------- ### Example Linker Script Memory Regions Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/Marlin/src/HAL/HC32/README.md Examine linker scripts for memory regions, particularly 'FLASH', to find the application start address. The 'ORIGIN' value of the FLASH region indicates this address. ```ld MEMORY { FLASH (rx): ORIGIN = 0x0000C000, LENGTH = 512K OTP (rx): ORIGIN = 0x03000C00, LENGTH = 1020 RAM (rwx): ORIGIN = 0x1FFF8000, LENGTH = 188K RET_RAM (rwx): ORIGIN = 0x200F0000, LENGTH = 4K } ``` -------------------------------- ### begin() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2208_stepper-members.html Initializes the TMC2208Stepper with default settings. This static method should be called before using other methods. ```APIDOC ## begin() ### Description Initializes the TMC2208Stepper with default settings. This static method should be called before using other methods. ### Method Static method ### Parameters None ### Returns void ``` -------------------------------- ### Start Velocity Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5130_stepper.html Methods to set and get the start velocity. ```APIDOC ## VSTART ### Description Sets or gets the start velocity. ### Method - `VSTART()`: Gets the current start velocity. - `VSTART(uint32_t input)`: Sets the start velocity. ### Parameters #### Path Parameters - `input` (uint32_t) - The start velocity value to set. ### Return Value - `uint32_t`: The current start velocity when read. ``` -------------------------------- ### Get Hysteresis Start Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2209_stepper.html Retrieves the current hysteresis start value. ```APIDOC ## hysteresis_start ### Description Retrieves the current hysteresis start value. ### Method `uint8_t hysteresis_start()` ### Parameters None ### Returns - `uint8_t`: The current hysteresis start value. ``` -------------------------------- ### Hysteresis Start Control Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2660_stepper.html Methods to get and set the hysteresis start value. ```APIDOC ## hstrt ### Description Controls and retrieves the hysteresis start value. ### Methods - `void hstrt(uint8_t)`: Sets the hysteresis start. - `uint8_t hstrt()`: Gets the hysteresis start. ``` -------------------------------- ### begin() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c5130_stepper_8cpp_source.html Initializes the TMC5130Stepper driver. ```APIDOC ## begin() ### Description Initializes the TMC5130Stepper driver, setting up necessary configurations. ### Method `void begin()` ``` -------------------------------- ### Setup Working Directory Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/buildroot/share/dwin/bin/README.md Create a new directory and copy the target .ICO file into it for processing. This ensures a clean working environment. ```sh mkdir hackicons cp 7.ICO hackicons cd hackicons ``` -------------------------------- ### VSTART() - Get Start Velocity Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5130_stepper.html Retrieves the current start velocity setting for the TMC5130 stepper driver. ```APIDOC ## VSTART() ### Description Retrieves the current start velocity setting. ### Method `uint32_t TMC5130Stepper::VSTART()` ### Parameters None ### Return Value `uint32_t` - The current start velocity value. ``` -------------------------------- ### begin Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c2208_stepper_8cpp_source.html Initializes the TMC2208Stepper with default settings and enables necessary features. ```APIDOC ## void begin() ### Description Initializes the TMC2208Stepper. If SW_CAPABLE_PLATFORM is defined, it calls `beginSerial` with a default baud rate of 115200. It then disables PDN/UART and enables MSTEP register selection. ### Method `void` ``` -------------------------------- ### hstrt() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c_stepper.html Gets the HSTRT (Homing Start) parameter. ```APIDOC ## hstrt() ### Description Retrieves the current HSTRT parameter value. ### Returns - uint8_t: The current HSTRT value. ``` -------------------------------- ### begin() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2208_stepper.html Initializes the TMC2208Stepper. ```APIDOC ## begin() ### Description Initializes the TMC2208Stepper. This function should be called after the constructor. ### Method void ### Parameters None ``` -------------------------------- ### hysteresis_start Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c_stepper-members.html Sets or gets the hysteresis start value. ```APIDOC ## hysteresis_start ### Description Sets or gets the hysteresis start value. ### Parameters #### Path Parameters - **value** (uint8_t) - The value to set for hysteresis start. ### Method Sets the hysteresis start value. ### Endpoint N/A (Class method) ## hysteresis_start ### Description Gets the hysteresis start value. ### Method Gets hysteresis start. ### Endpoint N/A (Class method) ``` -------------------------------- ### begin() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2160_stepper.html Initializes the TMC2160Stepper module. ```APIDOC ## begin() ### Description Initializes the TMC2160Stepper module. ### Method void ### Endpoint begin() ``` -------------------------------- ### TMC2660Stepper::hysteresis_start Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c_stepper_8h_source.html Gets the hysteresis start value for the driver. ```APIDOC ## TMC2660Stepper::hysteresis_start ### Description Gets the hysteresis start value for the driver. ### Signature `uint8_t hysteresis_start()` ``` -------------------------------- ### begin() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2130_stepper-members.html Initializes the TMC2130Stepper. ```APIDOC ## begin() ### Description Initializes the TMC2130Stepper, likely setting up communication or default states. ### Method `void begin()` ### Endpoint N/A ### Parameters None ### Request Example ```cpp stepper.begin(); ``` ### Response None ``` -------------------------------- ### hysteresis_start (TMCStepper) Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5160_stepper.html Sets or gets the hysteresis start value. ```APIDOC ## hysteresis_start (TMCStepper) ### Description Sets or gets the hysteresis start value. ### Method - `hysteresis_start(uint8_t value)`: Sets the hysteresis start value. - `hysteresis_start()`: Gets the current hysteresis start value. ### Parameters #### Input Parameter for Set Method - **value** (uint8_t) - The desired hysteresis start value. ### Return Value - `hysteresis_start()`: Returns the current hysteresis start value (uint8_t). ``` -------------------------------- ### begin() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5161_stepper.html Initializes the TMC5161 stepper driver. ```APIDOC ## begin() ### Description Initializes the TMC5161 stepper driver. This method should be called after the object is created to prepare the driver for operation. ### Method void ### Endpoint begin() ``` -------------------------------- ### Hysteresis Start Configuration Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c_stepper_8h_source.html Set and get the hysteresis start value for the TMC stepper driver. This parameter is related to the driver's current control. ```APIDOC ## hysteresis_start ### Description Sets or gets the hysteresis start value for the TMC stepper driver. This value is part of the driver's current control mechanism. ### Methods - `void hysteresis_start(uint8_t value)`: Sets the hysteresis start value. - `uint8_t hysteresis_start()`: Gets the current hysteresis start value. ### Parameters - `value` (uint8_t): The desired hysteresis start value. ``` -------------------------------- ### begin() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2130_stepper.html Initializes the TMC2130Stepper driver. This function should be called after the constructor. ```APIDOC ## begin() ### Description Initializes the TMC2130Stepper driver. This function should be called after the constructor to set up the driver for operation. ### Method `void` ### Definition ```cpp void TMC2130Stepper::begin(void) ``` ``` -------------------------------- ### Get Hysteresis Start for TMC2660Stepper Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c2660_stepper_8cpp_source.html Returns the hysteresis start value for the TMC2660 stepper driver. This value is derived from an internal register and incremented by one. ```cpp uint8_t TMC2660Stepper::hysteresis_start() { return hstrt()+1; } ``` -------------------------------- ### Register Hardware Platform Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/buildroot/share/cmake/CMakeLists.txt A commented-out example showing how to register a custom hardware platform. ```cmake #register_hardware_platform(/home/tom/test/Sanguino) ``` -------------------------------- ### TMC5130Stepper::VSTART Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5130_stepper-members.html Sets or gets the starting velocity for the stepper motor. ```APIDOC ## VSTART ### Description Sets or gets the starting velocity for the stepper motor. ### Method `VSTART(uint32_t input)` or `VSTART()` ### Parameters - `input` (uint32_t) - The starting velocity value to set. ### Returns - `uint32_t` - The current starting velocity when called without arguments. - `void` - When setting the starting velocity. ``` -------------------------------- ### TMC2660Stepper::hstrt Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2660_stepper-members.html Sets or gets the HSTRT (hysteresis start) value. ```APIDOC ## hstrt(uint8_t) ### Description Sets the HSTRT value. ### Method Setter ### Parameters - **value** (uint8_t) - The HSTRT value to set. ### Response None ``` ```APIDOC ## hstrt() ### Description Gets the HSTRT value. ### Method Getter ### Parameters None ### Response - uint8_t: The current HSTRT value. ``` -------------------------------- ### Manual Initialization of Q15 Matrix Instance Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/group__group_matrix.html Demonstrates how to manually initialize a Q15 matrix instance, allowing it to be placed in a const data section. ```c arm_matrix_instance_q15 S = {nRows, nColumns, pData}; ``` -------------------------------- ### TMC5130Stepper::begin() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5130_stepper.html Initializes the TMC5130Stepper driver, preparing it for operation. ```APIDOC ## begin() ### Description Initializes the TMC5130Stepper driver. This function should be called before any other operations. ### Method void ``` -------------------------------- ### Hysteresis Control Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2130_stepper.html Functions to set and get hysteresis start and end values. ```APIDOC ## Hysteresis Control ### `void hysteresis_end(int8_t value)` Sets the hysteresis end value. ### `int8_t hysteresis_end()` Gets the current hysteresis end value. ### `void hysteresis_start(uint8_t value)` Sets the hysteresis start value. ### `uint8_t hysteresis_start()` Gets the current hysteresis start value. ``` -------------------------------- ### TMC2660Stepper::begin Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c2660_stepper_8cpp_source.html Initializes the TMC2660Stepper driver. This should be called before any other operations. ```APIDOC ## TMC2660Stepper::begin ### Description Initializes the TMC2660Stepper driver. This should be called before any other operations. ### Method `void begin()` ### Returns None ``` -------------------------------- ### Test Signal Convergence Example Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm__signal__converge__example__f32_8c.html This function serves as an example entry point for testing signal convergence. It likely initializes and calls other convergence-related functions. ```c arm_status test_signal_converge_example(void) ``` -------------------------------- ### Get Hysteresis Start Value Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c_stepper_8cpp_source.html Retrieves the hysteresis start value from the stepper motor driver. The value read from the HSTRT register is adjusted by +1 to provide the user-facing value. ```cpp uint8_t TMCStepper::hysteresis_start() { return [hstrt](class_t_m_c_stepper.html#ae40affb96ca05b4380adbdd961b62c7e)()+1; } ``` -------------------------------- ### Hysteresis Control Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2160_stepper.html Methods to set and get the hysteresis start value for the stepper driver. ```APIDOC ## hysteresis_start (uint8_t value) ### Description Sets the hysteresis start value for the stepper driver. ### Parameters * **value** (uint8_t) - The hysteresis start value to set. ``` ```APIDOC ## hysteresis_start () ### Description Retrieves the current hysteresis start value from the stepper driver. ### Returns * uint8_t - The current hysteresis start value. ``` -------------------------------- ### Matrix Initialization and Operations Example Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm__matrix__example__f32_8c_source.html Initializes matrices, performs transpose, multiplication, and inversion. Ensure correct matrix dimensions and data arrays are provided. ```c int32_t main(void) { arm_matrix_instance_f32 A; /* Matrix A Instance */ arm_matrix_instance_f32 AT; /* Matrix AT(A transpose) instance */ arm_matrix_instance_f32 ATMA; /* Matrix ATMA( AT multiply with A) instance */ arm_matrix_instance_f32 ATMAI; /* Matrix ATMAI(Inverse of ATMA) instance */ arm_matrix_instance_f32 B; /* Matrix B instance */ arm_matrix_instance_f32 X; /* Matrix X(Unknown Matrix) instance */ uint32_t srcRows, srcColumns; /* Temporary variables */ arm_status status; /* Initialise A Matrix Instance with numRows, numCols and data array(A_f32) */ srcRows = 4; srcColumns = 4; arm_mat_init_f32(&A, srcRows, srcColumns, (float32_t *)A_f32); /* Initialise Matrix Instance AT with numRows, numCols and data array(AT_f32) */ srcRows = 4; srcColumns = 4; arm_mat_init_f32(&AT, srcRows, srcColumns, AT_f32); /* calculation of A transpose */ status = arm_mat_trans_f32(&A, &AT); /* Initialise ATMA Matrix Instance with numRows, numCols and data array(ATMA_f32) */ srcRows = 4; srcColumns = 4; arm_mat_init_f32(&ATMA, srcRows, srcColumns, ATMA_f32); /* calculation of AT Multiply with A */ status = arm_mat_mult_f32(&AT, &A, &ATMA); /* Initialise ATMAI Matrix Instance with numRows, numCols and data array(ATMAI_f32) */ srcRows = 4; srcColumns = 4; arm_mat_init_f32(&ATMAI, srcRows, srcColumns, ATMAI_f32); /* calculation of Inverse((Transpose(A) * A) */ status = arm_mat_inverse_f32(&ATMA, &ATMAI); /* calculation of (Inverse((Transpose(A) * A)) * Transpose(A)) */ ``` -------------------------------- ### Setup Motherboard Settings Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/buildroot/share/cmake/CMakeLists.txt Configures motherboard settings by reading from Configuration.h. It returns the board and CPU type, which can also be set manually. ```cmake setup_motherboard(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/../../../Marlin) ``` -------------------------------- ### hysteresis_start Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2208_stepper-members.html Sets or gets the hysteresis start value for the driver. Can be called with or without a parameter. ```APIDOC ## hysteresis_start ### Description Sets or retrieves the hysteresis start value, affecting motor behavior during microstepping. ### Method Overloads 1. **hysteresis_start(uint8_t value)** - Sets the hysteresis start value. 2. **hysteresis_start()** - Gets the current hysteresis start value. ``` -------------------------------- ### Initialization and Configuration Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c2130_stepper.html Methods for initializing the driver and setting default configurations. ```APIDOC ## Initialization and Configuration ### Description Provides methods to begin the stepper driver operation and set default parameters. ### Methods - **`begin()`**: Initializes the TMC2130Stepper driver. - **`defaults()`**: Resets the driver to its default configuration settings. - **`setSPISpeed(uint32_t speed)`**: Sets the SPI communication speed. - **`switchCSpin(bool state)`**: Manually controls the Chip Select (CS) pin state. - **`isEnabled()`**: Checks if the stepper driver is enabled. ``` -------------------------------- ### TMCStepper::hysteresis_start Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c_stepper_8cpp_source.html Sets or gets the hysteresis start value for the stepper motor driver. ```APIDOC ## TMCStepper::hysteresis_start ### Description Manages the hysteresis start value for the stepper motor driver. This value influences the motor's current control characteristics. ### Overloads 1. **`void hysteresis_start(uint8_t value)`** Sets the hysteresis start value. The input value is adjusted internally before being applied to the driver. 2. **`uint8_t hysteresis_start()`** Retrieves the current hysteresis start value. The value read from the driver is adjusted internally before being returned. ### Parameters - **`value`** (uint8_t) - The value to set for the hysteresis start. Note that the actual value stored in the driver is `value - 1`. ### Returns - `uint8_t`: The current hysteresis start value (adjusted internally). ``` -------------------------------- ### HSTRT Setting Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5130_stepper.html Methods to set and get the HSTRT value, which controls the hysteresis start of the chopper. ```APIDOC ## HSTRT ### Description Sets or gets the HSTRT (hysteresis start) parameter for the chopper. ### Methods - `void hstrt(uint8_t B)`: Sets the HSTRT value. - `uint8_t hstrt()`: Gets the HSTRT value. ``` -------------------------------- ### Create ICO File Example Output Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/buildroot/share/dwin/bin/README.md Example output from the makeIco.py script, indicating the process of scanning the icon directory and the number of icons included in the generated ICO file. ```text $ cd buildroot/share/dwin $ ./bin/makeIco.py icons-7 7.ICO Making .ico file '7.ICO' from contents of 'icons-7' Scanning icon directory icons-7 ...Scanned 16 icon files Scanning done. 16 icons included. ``` -------------------------------- ### init() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_s_w___s_p_i_class-members.html Initializes the SW_SPIClass instance. ```APIDOC ## init() ### Description Initializes the software SPI communication. ### Method [void] ### Endpoint [N/A - Method Call] ``` -------------------------------- ### TMC2130Stepper::hstrt Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_c_h_o_p_c_o_n_f_8cpp_source.html Gets the HSTRT value from the CHOPCONF register. This value controls the hysteresis start of the chopper. ```APIDOC ## TMC2130Stepper::hstrt ### Description Gets the HSTRT value from the CHOPCONF register. This value controls the hysteresis start of the chopper. ### Method Signature `uint8_t hstrt()` ### Returns * (uint8_t) - The current HSTRT value. ``` -------------------------------- ### begin() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_s_w___s_p_i_class-members.html Begins an SPI transaction. ```APIDOC ## begin() ### Description Starts an SPI transaction, typically involving asserting the chip select line. ### Method [void] ``` -------------------------------- ### FIR Filter Initialization and Processing Example Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm_fir_example_f32_8c-example.html This snippet demonstrates the initialization and processing steps for a floating-point FIR filter. It includes setting up the filter instance, processing data in blocks, and comparing the output to a reference. ```c uint32_t blockSize = BLOCK_SIZE; uint32_t numBlocks = TEST_LENGTH_SAMPLES/BLOCK_SIZE; float32_t snr; int32_t main(void) { uint32_t i; arm_fir_instance_f32 S; arm_status status; float32_t *inputF32, *outputF32; /* Initialize input and output buffer pointers */ inputF32 = &testInput_f32_1kHz_15kHz[0]; outputF32 = &testOutput[0]; /* Call FIR init function to initialize the instance structure. */ arm_fir_init_f32(&S, NUM_TAPS, (float32_t *)&firCoeffs32[0], &firStateF32[0], blockSize); /* ---------------------------------------------------------------------- ** Call the FIR process function for every blockSize samples ------------------------------------------------------------------- */ for(i=0; i < numBlocks; i++) { arm_fir_f32(&S, inputF32 + (i * blockSize), outputF32 + (i * blockSize), blockSize); } /* ---------------------------------------------------------------------- ** Compare the generated output against the reference output computed ** in MATLAB. ** ------------------------------------------------------------------- */ snr = arm_snr_f32(&refOutput[0], &testOutput[0], TEST_LENGTH_SAMPLES); if (snr < SNR_THRESHOLD_F32) { status = ARM_MATH_TEST_FAILURE; } else { status = ARM_MATH_SUCCESS; } /* ---------------------------------------------------------------------- ** Loop here if the signal does not match the reference output. ------------------------------------------------------------------- */ if( status != ARM_MATH_SUCCESS) { while(1); } } ``` -------------------------------- ### Main Function for FFT Bin Example Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/arm__fft__bin__example__f32_8c_source.html Initializes the CFFT/CIFFT module and sets the status to success. This function serves as the entry point for the FFT bin calculation example. ```c int32_t main(void) { arm_status status; arm_cfft_radix4_instance_f32 S; float32_t maxValue; status = ARM_MATH_SUCCESS; /* Initialize the CFFT/CIFFT module */ ``` -------------------------------- ### TMCStepper::hysteresis_start Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c_stepper_8h_source.html Gets the hysteresis start value for the stepper motor driver. This parameter influences the motor's behavior under varying loads. ```APIDOC ## TMCStepper::hysteresis_start ### Description Retrieves the configured hysteresis start value. Hysteresis is a property that affects the motor's response to changes in load, helping to maintain smooth operation. ### Method `uint8_t hysteresis_start()` ### Parameters None ### Return Value Returns a `uint8_t` representing the hysteresis start value. ``` -------------------------------- ### TMCStepper::hstrt Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c_stepper_8h_source.html Virtual function to get the HSTRT (High Start Speed) setting for TMC stepper drivers. This is a pure virtual function. ```APIDOC ## TMCStepper::hstrt ### Description This is a pure virtual function that must be implemented by derived classes. It is intended to retrieve the HSTRT (High Start Speed) setting, which defines the speed at which the driver starts microstepping. ### Signature `virtual uint8_t hstrt() = 0` ### Returns - `uint8_t`: The HSTRT setting. (Implementation specific to derived classes). ``` -------------------------------- ### TMC2660Stepper::begin Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c2660_stepper_8cpp_source.html Initializes the TMC2660Stepper by setting up the CS pin and default motor parameters. ```APIDOC ## TMC2660Stepper::begin ### Description Initializes the TMC2660Stepper by setting up the CS pin as an output and calling `switchCSpin(HIGH)`. It also sets default values for `toff` (off-time) and `tbl` (blank-time). ### Method `void begin()` ### Parameters None ### Example ```cpp TMC2660Stepper stepper(1, 0.11); stepper.begin(); ``` ``` -------------------------------- ### hysteresis_start() Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/functions_func_h.html This function is available in TMC2660Stepper and TMCStepper classes and is related to setting or getting a hysteresis start value, likely for microstepping or current control. ```APIDOC ## hysteresis_start() ### Description This function is available in both TMC2660Stepper and TMCStepper classes. It is used to manage the hysteresis start point, which can affect motor performance, particularly in microstepping or current control scenarios. ### Method N/A (Function signature) ### Endpoint N/A (Class member function) ### Parameters None ### Response Returns the hysteresis start value or a reference to the class object. ``` -------------------------------- ### Fletchers Checksum Implementation Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/docs/BinaryFileTransferProtocol.md A C++ implementation example for calculating the 16-bit Fletchers checksum required for packet validation in the BFT protocol. The checksum excludes the Start Token. ```c++ uint16_t cs = 0; for (size_t i = 2; i> 8) + cslow) % 255) << 8) | cslow; } ``` -------------------------------- ### INIT_REGISTER(VSTOP) Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5160_stepper-members.html Initializes the TMC5130Stepper with VSTOP settings. ```APIDOC ## INIT_REGISTER(VSTOP) ### Description Initializes the TMC5130Stepper with VSTOP settings. ### Method protected ### Parameters * **VSTOP** (type not specified) - Description not specified ``` -------------------------------- ### DMAC Channel Destination Address Register (ch_num = 0) Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/Device/ATMEL/sam3xa/html/DMAC.html This register defines the starting destination memory address for data transfers for a specific DMAC channel (channel 0 in this example). It is read-write. ```APIDOC ## DMAC Channel Destination Address Register ### Description This register specifies the memory address to which the DMAC will write data for a given channel. This is a read-write register. ### Register Name DMAC_DADDR[ch_num] ### Access read-write ### Address 0x400C4040 (for channel 0) ### Fields - **DADDR** (read-write) - Channel x Destination Address. This field holds the 32-bit memory address for the destination of the DMA transfer. ``` -------------------------------- ### Manual Initialization of Q31 Matrix Instance Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Documentation/DSP_Lib/html/group__group_matrix.html Demonstrates how to manually initialize a Q31 matrix instance, allowing it to be placed in a const data section. ```c arm_matrix_instance_q31 S = {nRows, nColumns, pData}; ``` -------------------------------- ### INIT_REGISTER(VSTART) Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5160_stepper-members.html Initializes the TMC5130Stepper with VSTART settings. ```APIDOC ## INIT_REGISTER(VSTART) ### Description Initializes the TMC5130Stepper with VSTART settings. ### Method protected ### Parameters * **VSTART** (type not specified) - Description not specified ``` -------------------------------- ### DMAC Channel Source Address Register (ch_num = 0) Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/Device/ATMEL/sam3xa/html/DMAC.html This register defines the starting source memory address for data transfers for a specific DMAC channel (channel 0 in this example). It is read-write. ```APIDOC ## DMAC Channel Source Address Register ### Description This register specifies the memory address from which the DMAC will read data for a given channel. This is a read-write register. ### Register Name DMAC_SADDR[ch_num] ### Access read-write ### Address 0x400C403C (for channel 0) ### Fields - **SADDR** (read-write) - Channel x Source Address. This field holds the 32-bit memory address for the source of the DMA transfer. ``` -------------------------------- ### Initialization and Configuration Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c_stepper_8h_source.html Methods for initializing the driver, setting default configurations, and managing SPI speed. ```APIDOC ## Initialization and Configuration ### Description Provides methods to initialize the driver, set default parameters, and configure SPI communication. ### Methods - `void begin()` - `void defaults()` - `void setSPISpeed(uint32_t speed)` - `void switchCSpin(bool state)` ### Description for Methods - `begin()`: Initializes the TMC2130Stepper driver. - `defaults()`: Sets the driver to its default configuration. - `setSPISpeed(uint32_t speed)`: Sets the SPI communication speed. - `switchCSpin(bool state)`: Manually switches the Chip Select pin state. ``` -------------------------------- ### Initialization and Defaults Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/class_t_m_c5161_stepper.html Functions to initialize the driver and set default configurations. ```APIDOC ## begin() ### Description Initializes the TMC5161Stepper driver. ### Method void ``` ```APIDOC ## defaults() ### Description Applies default configuration settings to the TMC5161Stepper driver. ### Method void ``` -------------------------------- ### TMC2160Stepper::begin Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/ArduinoAddons/arduino-1.8.5/libraries/TMCStepper/docs/_t_m_c2160_stepper_8cpp_source.html Initializes the TMC2160Stepper hardware. This method should be called before any other operations. ```APIDOC ## void begin() ### Description Initializes the TMC2160Stepper hardware. ### Method `void` ### Parameters None ### Request Example ```cpp TMC2160Stepper stepper(RPI_GPIO_25, RPI_GPIO_24, RPI_GPIO_23, RPI_GPIO_22); stepper.begin(); ``` ### Response None ``` -------------------------------- ### Wipe Sequence Commands Source: https://github.com/drunken-octopus/drunken-octopus-marlin/blob/master/config/examples/AlephObjects/custom/Oliveoil_TAZ6ArchimBLTouch/Yellowfin_DualExtruderV3/Configuration_summary.txt Defines a sequence of G-code commands executed for nozzle wiping during tool changes or print starts. This sequence includes heating, homing, wiping motions, and fan control. Adjust nozzle temperatures and coordinates as needed for your specific setup. ```gcode #define WIPE_SEQUENCE_COMMANDS "M117 Hot end heating...\nM104 S170 T0\nM104 S170 T1\nG28 O1\nM117 Wiping nozzle\nT0\nG1 X-26 Y25 Z10 F4000\nM109 R170 T0\nM109 R170 T1\nG1 Z1\nM114\nG1 X-26 Y25\nG1 X-26 Y95\nG1 X-26 Y25\nG1 X-26 Y95\nG1 X-26 Y25\nG1 X-26 Y95\nG1 X-26 Y25\nG1 X-26 Y95\nG1 X-26 Y25\nG1 X-26 Y95\nG1 X-26 Y25\nG1 X-26 Y95\nG1 Z15\nM400\nM106 S255\nM109 R160 T0\nM109 R160 T1\nM107" ```