add CS43L22 Audio chip testing functions

This commit is contained in:
2025-03-09 15:24:26 +02:00
parent 9a40b5a6fb
commit 13db07642e
6 changed files with 106 additions and 19 deletions
+18 -12
View File
@@ -27,6 +27,7 @@
#include "DNI.h"
#include "PCA9685.h"
#include "24AA02E48.h"
#include "CS43L22.h"
/* USER CODE END Includes */
@@ -59,17 +60,19 @@ void ((*executors[])(void)) = {
DNI_show_celsius,
DNI_show_fahrenheit,
PCA9685_run_test,
EEPROM_24AA02E48_run_test
EEPROM_24AA02E48_run_test,
CS43L22_run_test
};
void ((*cleanup_functions[])(void)) = {
NULL,
NULL,
PCA9685_cleanup,
NULL
NULL,
CS43L22_cleanup
};
int delay_between_runs[] = {250, 250, -1, -1};
int delay_between_runs[] = {250, 250, -1, -1, -1};
size_t current_executor_id = 0;
@@ -89,6 +92,12 @@ static void MX_I2C1_Init(void);
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
void switch_to_next_test(void)
{
current_executor_id += 1;
current_executor_id %= 5;
}
void buttons_switch_to_interrupt(void)
{
// save current executor ID
@@ -209,12 +218,6 @@ void button_init_and_test(void)
HAL_Delay(200);
}
void switch_to_next_test(void)
{
current_executor_id += 1;
current_executor_id %= 4;
}
/* USER CODE END 0 */
/**
@@ -443,7 +446,8 @@ static void MX_GPIO_Init(void)
|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15
|GPIO_PIN_4, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_RESET);
@@ -463,8 +467,10 @@ static void MX_GPIO_Init(void)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
/*Configure GPIO pins : PD12 PD13 PD14 PD15 */
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
/*Configure GPIO pins : PD12 PD13 PD14 PD15
PD4 */
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15
|GPIO_PIN_4;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;