1# action
2
3## Description
4
5Action to execute.
6
7Actions are executed to perform the following regulator operations:
8
9- [presence_detection](presence_detection.md)
10- [configuration](configuration.md)
11- [sensor_monitoring](sensor_monitoring.md)
12- [phase_fault_detection](phase_fault_detection.md)
13
14Many actions read from or write to a hardware device. Initially this is the
15[device](device.md) that contains the regulator operation. However, the device
16can be changed using the [set_device](set_device.md) action.
17
18## Properties
19
20| Name                     |      Required       | Type                                                    | Description                                                          |
21| :----------------------- | :-----------------: | :------------------------------------------------------ | :------------------------------------------------------------------- |
22| comments                 |         no          | array of strings                                        | One or more comment lines describing this action.                    |
23| and                      | see [notes](#notes) | array of actions                                        | Action type [and](and.md).                                           |
24| compare_presence         | see [notes](#notes) | [compare_presence](compare_presence.md)                 | Action type [compare_presence](compare_presence.md).                 |
25| compare_vpd              | see [notes](#notes) | [compare_vpd](compare_vpd.md)                           | Action type [compare_vpd](compare_vpd.md).                           |
26| i2c_capture_bytes        | see [notes](#notes) | [i2c_capture_bytes](i2c_capture_bytes.md)               | Action type [i2c_capture_bytes](i2c_capture_bytes.md).               |
27| i2c_compare_bit          | see [notes](#notes) | [i2c_compare_bit](i2c_compare_bit.md)                   | Action type [i2c_compare_bit](i2c_compare_bit.md).                   |
28| i2c_compare_byte         | see [notes](#notes) | [i2c_compare_byte](i2c_compare_byte.md)                 | Action type [i2c_compare_byte](i2c_compare_byte.md).                 |
29| i2c_compare_bytes        | see [notes](#notes) | [i2c_compare_bytes](i2c_compare_bytes.md)               | Action type [i2c_compare_bytes](i2c_compare_bytes.md).               |
30| i2c_write_bit            | see [notes](#notes) | [i2c_write_bit](i2c_write_bit.md)                       | Action type [i2c_write_bit](i2c_write_bit.md).                       |
31| i2c_write_byte           | see [notes](#notes) | [i2c_write_byte](i2c_write_byte.md)                     | Action type [i2c_write_byte](i2c_write_byte.md).                     |
32| i2c_write_bytes          | see [notes](#notes) | [i2c_write_bytes](i2c_write_bytes.md)                   | Action type [i2c_write_bytes](i2c_write_bytes.md).                   |
33| if                       | see [notes](#notes) | [if](if.md)                                             | Action type [if](if.md).                                             |
34| log_phase_fault          | see [notes](#notes) | [log_phase_fault](log_phase_fault.md)                   | Action type [log_phase_fault](log_phase_fault.md).                   |
35| not                      | see [notes](#notes) | action                                                  | Action type [not](not.md).                                           |
36| or                       | see [notes](#notes) | array of actions                                        | Action type [or](or.md).                                             |
37| pmbus_read_sensor        | see [notes](#notes) | [pmbus_read_sensor](pmbus_read_sensor.md)               | Action type [pmbus_read_sensor](pmbus_read_sensor.md).               |
38| pmbus_write_vout_command | see [notes](#notes) | [pmbus_write_vout_command](pmbus_write_vout_command.md) | Action type [pmbus_write_vout_command](pmbus_write_vout_command.md). |
39| run_rule                 | see [notes](#notes) | string                                                  | Action type [run_rule](run_rule.md).                                 |
40| set_device               | see [notes](#notes) | string                                                  | Action type [set_device](set_device.md).                             |
41
42### Notes
43
44- You must specify exactly one action type property, such as "i2c_write_byte" or
45  "run_rule".
46
47## Return Value
48
49When the action completes, it returns a true or false value. The documentation
50for the specified action type describes what value will be returned.
51
52## Examples
53
54```json
55{
56  "comments": ["Set frequency to 800kHz"],
57  "i2c_write_byte": {
58    "register": "0x2C",
59    "value": "0x0F"
60  }
61}
62```
63
64```json
65{
66  "run_rule": "set_voltage_rule"
67}
68```
69