1 // Copyright 2024 The Pigweed Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 // use this file except in compliance with the License. You may obtain a copy of 5 // the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 // License for the specific language governing permissions and limitations under 13 // the License. 14 #pragma once 15 16 #include <cstdint> 17 18 namespace pw::i2c { 19 20 // I3C CCC (Common Command Code) commands 21 // MIPI Specification for I3C, version 1.1.1 22 // 5.1.9.3 CCC Command Definitions 23 enum class I3cCcc : uint8_t { 24 // Broadcast CCC commands 25 kEncBroadcast = 0x00, 26 kDisecBroadcast = 0x01, 27 kEntdas0Broadcast = 0x02, 28 kEntas1Broadcast = 0x03, 29 kEntas2Broadcast = 0x04, 30 kentas3Broadcast = 0x05, 31 kRstdaaBroadcast = 0x06, 32 kEntdaaBroadcast = 0x07, 33 kDefslvsBroadcast = 0x08, 34 kSetmwlBroadcast = 0x09, 35 kSetmrlBroadcast = 0x0a, 36 kEnttmBroadcast = 0x0b, 37 kEnthdr0Broadcast = 0x20, 38 kEnthdr1Broadcast = 0x21, 39 kEnthdr2Broadcast = 0x22, 40 kEnthdr3Broadcast = 0x23, 41 kEnthdr4Broadcast = 0x24, 42 kEnthdr5Broadcast = 0x25, 43 kEnthdr6Broadcast = 0x26, 44 kEnthdr7Broadcast = 0x27, 45 kSetxtimeBroadcast = 0x28, 46 kSetaasaBroadcast = 0x29, 47 // Direct CCC commands 48 kEncDirect = 0x80, 49 kDisecDirect = 0x81, 50 kEntas0Direct = 0x82, 51 kEntas1Direct = 0x83, 52 kEntas2Direct = 0x84, 53 kEntas3Direct = 0x85, 54 kRstdaaDirect = 0x86, 55 kSetdasaDirect = 0x87, 56 kSetnewdaDirect = 0x88, 57 kSetmwlDirect = 0x89, 58 kSetmrlDirect = 0x8a, 59 kGetmwlDirect = 0x8b, 60 kGetmrlDirect = 0x8c, 61 kGetpidDirect = 0x8d, 62 kGetbcrDirect = 0x8e, 63 kGetdcrDirect = 0x8f, 64 kGetstatusDirect = 0x90, 65 kGetaccmstDirect = 0x91, 66 kGetbrgtgtDirect = 0x93, 67 kGetmxdsDirect = 0x94, 68 kGethdrcapDirect = 0x95, 69 kSetxtimeDirect = 0x98, 70 kGetxtimeDirect = 0x99, 71 }; 72 73 inline constexpr uint8_t kCccDirectBit = 1 << 7; 74 75 enum class I3cCccAction : bool { 76 kWrite, 77 kRead, 78 }; 79 80 } // namespace pw::i2c 81