package atdf

  1. Overview
  2. Docs

Source file variant.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
type t = {
  order_code : string;
  package : string;
  pinout : string option;
  speed_max : int;
  vcc : float * float;
  temperature : int * int;
}
[@@deriving show]

let of_xml xml =
  Xml_decoder.assert_element "variant" xml;

  let order_code = Xml_decoder.(attribute "ordercode" string xml)
  and temperature =
    Xml_decoder.(attribute "tempmin" int xml, attribute "tempmax" int xml)
  and speed_max = Xml_decoder.(attribute "speedmax" int xml)
  and pinout = Xml_decoder.(attribute_opt "pinout" string xml)
  and package = Xml_decoder.(attribute "package" string xml)
  and vcc =
    Xml_decoder.(attribute "vccmin" float xml, attribute "vccmax" float xml)
  in

  { order_code; package; pinout; speed_max; vcc; temperature }