blob: 2733863b62a8834ac08bd5f3938a6d8e199fcc46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Mock for the TCPM interface */
#include "common.h"
#include "tcpm/tcpm.h"
/* Copied from usb_prl_sm.c, line 99. */
#define MOCK_CHK_BUF_SIZE 7
/* Define a struct to hold the data we need to control the mocks. */
struct mock_tcpm_t {
uint32_t mock_rx_chk_buf[MOCK_CHK_BUF_SIZE];
uint32_t mock_header;
int mock_has_pending_message;
};
extern struct mock_tcpm_t mock_tcpm[CONFIG_USB_PD_PORT_MAX_COUNT];
void mock_tcpm_reset(void);
void mock_tcpm_rx_msg(int port, uint16_t header, int cnt, const uint32_t *data);
|