Use HSI with CAN-based time synchronization
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#define CAN_ID_SLAVE_ERROR 0x001
|
||||
#define CAN_ID_TIME_SYNC 0x002
|
||||
#define CAN_ID_AMS_SLAVE_HEARTBEAT_BASE 0x600
|
||||
#define CAN_HEARTBEAT_TX_TIMEOUT 10 /* ms */
|
||||
|
||||
|
||||
13
Core/Inc/TimeSync.h
Normal file
13
Core/Inc/TimeSync.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef INC_TIME_SYNC_H_
|
||||
#define INC_TIME_SYNC_H_
|
||||
|
||||
#define TARGET_FREQ 16000000 // Hz
|
||||
#define TRIM_FREQ 48000 // Hz
|
||||
#define TIME_SYNC_INTERVAL 1000 // ms
|
||||
#define RCC_CR_HSITRIM_MAX 31
|
||||
|
||||
#define STARTUP_TIME_SYNC_TIME 5000 // ms
|
||||
|
||||
void time_sync_handle_frame();
|
||||
|
||||
#endif // INC_TIME_SYNC_H_
|
||||
Reference in New Issue
Block a user