Below is the documentation for the most importatnt functions. More documentation is found inside the code itself.
Convention: functionName : parameter1, parameter2, ... : return value1, return value2, ...
- HAL_TIM_PeriodElapsedCallback : void : void
- main : no arguments : returns void (never returns)
Callback whenever the Timer TIM15 raises an interrupt (when the timer == value AR register) This is where the ADC performs the conversion.
Check if ready then performs inference and outputs the result using UART2.
- aiInit : ai_u8 activations : void
- aiRun : const void * in_data (input float buffer with the 187 ECG samples), void * out_data (output int buffer of size 5 (5 classes)) : int (prediction status)
- MX_CUBE_AI_Init : void : void
- MX_CUBE_AI_Process : void : int (the prediction class)
Initializes the Neural Network
Performs the Inference
Calls aiInit
Initializes the input buffer by converting the ECG buffer to bytes then feeding it to aiRun which outputs the prediction then the predicted class is returned