18 lines
396 B
C
18 lines
396 B
C
#ifndef INC_CLOCK_SYNC_H_
|
|
#define INC_CLOCK_SYNC_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
#define CLOCK_TARGET_FREQ 16000000 // Hz
|
|
#define HSI_TRIM_FREQ 48000 // Hz
|
|
#define CLOCK_SYNC_INTERVAL 1000 // ms
|
|
#define RCC_CR_HSITRIM_MAX 31
|
|
|
|
#define STARTUP_CLOCK_SYNC_TIME 5000 // ms
|
|
|
|
void clock_sync_handle_frame();
|
|
void clock_sync_startup_check();
|
|
void trim_hsi(int32_t delta);
|
|
|
|
#endif // INC_CLOCK_SYNC_H_
|