Добавлен ADC SEQ (заготовка пока)

И небольшой рефакторинг
This commit is contained in:
2025-12-26 18:44:38 +03:00
parent 8e350e6a91
commit c7fdf6776f
16 changed files with 1758 additions and 1933 deletions

View File

@@ -3,7 +3,6 @@
*------------------------------------------------------------------------------
* ЦНИИ СЭТ, Разваляев Алексей <wot890089@mail.ru>
*==============================================================================
* Конфигурация портов настраивается в gpio.h
* ЦНИИ СЭТ
*==============================================================================
*/
@@ -15,11 +14,13 @@ void restart_receive(void);
void heartbit(void);
//-- Defines -------------------------------------------------------------------
uint8_t rxbuff[10] = {0};
uint16_t adc_buff[2][100];
//-- Peripheral init functions -------------------------------------------------
void periph_init()
{
sysclk_init();
uart_init_first();
adc_init_first();
tmr_init_first();
gpio_init();
#ifdef RETARGET
@@ -35,6 +36,7 @@ void periph_init()
tmr_start(&htmr0);
tmr_start(&htmr1);
tmr_start(&htmr2);
adc_seq_start(&hadc, ADC_SEQ_Num_0, adc_buff, 100);
}
//-- Main ----------------------------------------------------------------------
@@ -50,6 +52,7 @@ int main()
{
tmr_delay_start(&htmr0, &prev_tick);
GPIO_ToggleBits(GPIOA, GPIO_Pin_8);
adc_sw_start();
}
tmr_delay(&htmr0, 100000);
GPIO_ToggleBits(GPIOA, GPIO_Pin_7);