bsp_define 0.1.57

微内核 BSP 硬件配置 trait 定义
Documentation
//! 系统时钟定义

/// 设置下一个事件回调
pub type SetNextEventFunc = fn(u64) -> bool;
/// 停止当前时钟事件回调
pub type SetStateStoppedFunc = fn();

/// 系统时钟实现
pub trait ClockImpl {
    /// 系统时钟初始化
    fn init(&self);

    /// 系统时钟处理器初始化
    ///
    /// 该回调将在每个处理器上调用
    fn init_cpu(&self) {}

    /// 获取下一个事件回调函数
    fn get_set_next_event(&self) -> SetNextEventFunc;
    /// 获取停止当前时钟事件回调函数
    fn get_set_state_stopped(&self) -> SetStateStoppedFunc;

    /// 时钟事件源频率(单位 Hz)
    fn rate(&self) -> usize;
    /// 时钟事件源最小 tick
    fn min_delta(&self) -> u64;
    /// 时钟事件源最大 tick
    fn max_delta(&self) -> u64;
}