| /* |
| * Copyright 2024 Google LLC |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| #pragma once |
| |
| #include <cstdint> |
| |
| namespace google |
| { |
| namespace hoth |
| { |
| namespace internal |
| { |
| |
| /* Host command response codes (16-bit). Note that response codes should be |
| * stored in a uint16_t rather than directly in a value of this type. |
| */ |
| enum ec_status |
| { |
| EC_RES_SUCCESS = 0, |
| EC_RES_INVALID_COMMAND = 1, |
| EC_RES_ERROR = 2, |
| EC_RES_INVALID_PARAM = 3, |
| EC_RES_ACCESS_DENIED = 4, |
| EC_RES_INVALID_RESPONSE = 5, |
| EC_RES_INVALID_VERSION = 6, |
| EC_RES_INVALID_CHECKSUM = 7, |
| EC_RES_IN_PROGRESS = 8, /* Accepted, command in progress */ |
| EC_RES_UNAVAILABLE = 9, /* No response available */ |
| EC_RES_TIMEOUT = 10, /* We got a timeout */ |
| EC_RES_OVERFLOW = 11, /* Table / data overflow */ |
| EC_RES_INVALID_HEADER = 12, /* Header contains invalid data */ |
| EC_RES_REQUEST_TRUNCATED = 13, /* Didn't get the entire request */ |
| EC_RES_RESPONSE_TOO_BIG = 14, /* Response was too big to handle */ |
| EC_RES_BUS_ERROR = 15, /* Communications bus error */ |
| EC_RES_BUSY = 16, /* Up but too busy. Should retry */ |
| EC_RES_INVALID_HEADER_VERSION = 17, /* Header version invalid */ |
| EC_RES_INVALID_HEADER_CRC = 18, /* Header CRC invalid */ |
| EC_RES_INVALID_DATA_CRC = 19, /* Data CRC invalid */ |
| EC_RES_DUP_UNAVAILABLE = 20, /* Can't resend response */ |
| |
| EC_RES_MAX = UINT16_MAX /**< Force enum to be 16 bits */ |
| }; |
| |
| #define EC_CMD_BOARD_SPECIFIC_BASE 0x3E00 |
| #define EC_CMD_BOARD_SPECIFIC_LAST 0x3FFF |
| |
| } // namespace internal |
| } // namespace hoth |
| } // namespace google |