openUBMC Chip Abstract Layer V0.1
载入中...
搜索中...
未找到
spi.h
浏览该文件的文档.
1/*
2 * Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
3 *
4 * this file licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 * http://license.coscl.org.cn/MulanPSL2
8 *
9 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
10 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
11 * PURPOSE.
12 * See the Mulan PSL v2 for more details.
13 */
14
20#ifndef DRIVER_SPI_H
21#define DRIVER_SPI_H
22
23#include "driver.h"
24
25namespace DRIVER_SPI {
26using namespace bcal;
27
28constexpr string_view_t SPI_TRACE_NAME = "spi";
29
34class Spi : public IDriver {
35public:
36
45 virtual string_t read(int32_t index, uint32_t cs, const string_view_t &cmd) = 0;
46
55 virtual int32_t write(int32_t index, uint32_t cs, const string_view_t &cmd) = 0;
56};
57} // namespace
58#endif
SPI接口
Definition spi.h:34
virtual string_t read(int32_t index, uint32_t cs, const string_view_t &cmd)=0
读取SPI数据
virtual int32_t write(int32_t index, uint32_t cs, const string_view_t &cmd)=0
写SPI数据
BCAL层驱动公共接口
Definition driver.h:41
BCAL 驱动公共接口定义