1use serde::Deserialize;
2use std::collections::HashMap;
3
4#[derive(Debug, Deserialize)]
5pub struct ComponentManifest {
6 pub name: String,
7 pub requires: Vec<String>,
8 pub parameters: Vec<ParameterDef>,
9 pub setup_template: String,
10 pub methods: HashMap<String, MethodDef>,
11}
12
13#[derive(Debug, Deserialize)]
14pub struct ParameterDef {
15 pub name: String,
16 pub param_type: ParameterType,
17 pub required: bool,
18}
19
20#[derive(Debug, Deserialize, PartialEq, Eq, Hash, Clone, Copy)]
21pub enum ParameterType {
22 GpioRef,
23 I2cRef,
24 I2cComponentRef,
25 SpiRef,
26 SpiComponentRef,
27 UartRef,
28 String,
29 Integer,
30 Boolean,
31}
32
33#[derive(Debug, Deserialize)]
34pub struct MethodDef {
35 pub template: String,
36}