1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/// Do not modify the discriminants in this structure. They are used in `libstd` directly.
#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Debug)]
pub enum Opcode {
    /// Get the elapsed time in milliseconds
    ElapsedMs = 0,

    /// Sleep for the specified numer of milliseconds
    SleepMs = 1,

    /// Recalculate the sleep time
    RecalculateSleep = 2,

    /// Suspend/resume callback
    SuspendResume = 3,

    /// force a WDT update
    PingWdt = 4,

    /// Return the version string of Xous. We bury it here because this is a small, lightweight server we can rebuild on every run.
    GetVersion = 5,

    /// Lock the given Mutex, blocking if it is already locked.
    ///
    /// # Arguments
    ///
    /// *arg1*: An integer of some sort, such as the address of the Mutex
    LockMutex = 6,

    /// Unlock the given Mutex
    ///
    /// # Arguments
    ///
    /// *arg1*: An integer of some sort, such as the address of the Mutex
    UnlockMutex = 7,

    /// Wait for a given condition to be signalled
    ///
    /// # Arguments
    ///
    /// *arg1*: An integer of some sort, such as the address of the Condvar
    /// *arg2*: The number of milliseconds to wait, or 0 to wait forever
    WaitForCondition = 8,

    /// Notify a condition
    ///
    /// # Arguments
    ///
    /// *arg1*: An integer of some sort, such as the address of the Condvar
    /// *arg2*: The number of conditions to notify
    NotifyCondition = 9,
}

#[derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)]
pub struct VersionString {
    pub version: xous_ipc::String::<512>,
}