cros_ec_message.h 651 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Chromium OS Matrix Keyboard Message Protocol definitions
  4. *
  5. * Copyright (c) 2012 The Chromium OS Authors.
  6. */
  7. #ifndef _CROS_MESSAGE_H
  8. #define _CROS_MESSAGE_H
  9. /*
  10. * Command interface between EC and AP, for LPC, I2C and SPI interfaces.
  11. *
  12. * This is copied from the Chromium OS Open Source Embedded Controller code.
  13. */
  14. enum {
  15. /* The header byte, which follows the preamble */
  16. MSG_HEADER = 0xec,
  17. MSG_HEADER_BYTES = 3,
  18. MSG_TRAILER_BYTES = 2,
  19. MSG_PROTO_BYTES = MSG_HEADER_BYTES + MSG_TRAILER_BYTES,
  20. /* Max length of messages */
  21. MSG_BYTES = EC_PROTO2_MAX_PARAM_SIZE + MSG_PROTO_BYTES,
  22. };
  23. #endif