[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E9X7ZXVHFSBV2SR7B59SD1":3,"skill-same:01M7E9X7ZXVHFSBV2SR7B59SD1":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":14,"repositoryHtmlUrl":34,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M7E9X7ZXVHFSBV2SR7B59SD1","automotive-protocols",null,"Expert skill in BroadR-Reach automotive Ethernet physical layer (100BASE-T1) for cost-effective high-speed networking over single twisted pair. Covers 8 topics across automotive-protocols domain.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fautomotive\u002Fautomotive-protocols\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: automotive-protocols\ndescription: >\n  Expert skill in BroadR-Reach automotive Ethernet physical layer (100BASE-T1) for cost-effective high-speed networking over single twisted pair. Covers 8 topics across automotive-protocols domain.\ntags: [automotive, automotive-protocols]\nsource: \"https:\u002F\u002Fgithub.com\u002Fpangzhenying2025\u002Fhermes-automotive-skills\"\nsource_repository: \"pangzhenying2025\u002Fhermes-automotive-skills\"\nsource_path: \"skills\u002Fautomotive-protocols\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n# Automotive Protocols\n\n8 skill files covering automotive-protocols domain.\n\n## Applicable Standards\n\n- AEC-Q100 (Automotive component qualification)\n- ANSI\u002FTIA\u002FEIA-644-A (LVDS Standard)\n- ASPICE Level 3\n- AUTOSAR 4.4\n- AUTOSAR LIN Driver\n- Automotive EMC compliance\n- BroadR-Reach specification\n- FPD-Link (Flat Panel Display Link)\n- IEEE 1722 AVTP (Audio Video Transport Protocol)\n- IEEE 802.1 AVB (Audio Video Bridging)\n- IEEE 802.1 TSN (Time-Sensitive Networking)\n- IEEE 802.3bw (100BASE-T1)\n- ISO 14230 (KWP2000 over MOST)\n- ISO 17458 (FlexRay Communications System)\n- ISO 17987 (LIN Specification)\n- ISO 26262 (Functional Safety)\n- ISO 26262 ASIL-D (Functional Safety)\n- LIN 2.2A specification\n- MIPI CSI-2 (Camera Serial Interface)\n- MOST Cooperation standard\n- MOST Specification Rev. 3.0\n- MOST150 (150 Mbps)\n- OPEN Alliance TC1 specification\n- OPEN Alliance TC8 specification\n- OpenLDI (Open LVDS Display Interface)\n- PSI5 Specification v2.3\n- SAE J2602\n- SAE J2716 (SENT Specification)\n- SOME\u002FIP (Scalable service-Oriented MiddlewarE)\n\n## Instructions\n\n## BroadR-Reach Protocol\n\n## Core Competencies\n\nExpert in BroadR-Reach physical layer for automotive Ethernet over single twisted pair.\n\n### Physical Layer Characteristics\n- Single unshielded twisted pair (UTP)\n- 100 Mbps full-duplex bidirectional\n- Cable length up to 15 meters (50 feet)\n- Voltage range: -2V to +2V differential\n- PAM3 (3-level Pulse Amplitude Modulation) encoding\n- Frequency: 33.33 MHz fundamental\n\n### Cable Requirements\n- Unshielded twisted pair (UTP)\n- AWG 24-26 gauge typical\n- Impedance: 100 ohms ±15%\n- Capacitance: \u003C60 pF\u002Fm\n- Low crosstalk for bundled cables\n- Automotive temperature range (-40°C to +125°C)\n\n### PHY Features\n- Auto-negotiation (ANEG)\n- Link partner detection\n- Cable diagnostics (TDR - Time Domain Reflectometry)\n- Sleep\u002Fwake functionality\n- EMI\u002FEMC compliance for automotive\n- Power over Data Line (PoDL) support\n\n### Connector Types\n- FAKRA coaxial connector (legacy)\n- USCAR connector\n- Rosenberger HFM connector\n- Amphenol Mini50 connector\n- Automotive-grade shielding\n\n## Design Approach\n\n1. Physical Layer Design\n   - Select appropriate cable type\n   - Plan cable routing (avoid EMI sources)\n   - Calculate maximum cable length\n   - Choose connectors and terminations\n\n2. PHY Configuration\n   - Configure auto-negotiation\n   - Set master\u002Fslave mode\n   - Enable cable diagnostics\n   - Configure sleep\u002Fwake behavior\n\n3. EMC\u002FEMI Mitigation\n   - Proper grounding strategy\n   - Common-mode choke selection\n   - Cable shielding and routing\n   - Ferrite bead placement\n\n4. Validation and Testing\n   - Eye diagram analysis\n   - TDR cable verification\n   - EMC compliance testing\n   - Temperature stress testing\n\n## Implementation Examples\n\n### PHY Initialization\n```c\n\u002F\u002F BroadR-Reach PHY configuration\ntypedef struct {\n    uint8_t phyAddress;        \u002F\u002F MDIO address (0-31)\n    bool masterMode;           \u002F\u002F Master\u002Fslave mode\n    bool autoNegEnable;        \u002F\u002F Auto-negotiation\n    bool sleepEnable;          \u002F\u002F Sleep mode support\n    uint8_t ledMode;           \u002F\u002F LED indicator config\n} BRR_PhyConfig_t;\n\nvoid BRR_InitPhy(const BRR_PhyConfig_t* config) {\n    \u002F\u002F Software reset\n    BRR_MdioWrite(config->phyAddress, PHY_BASIC_CONTROL, PHY_RESET);\n\n    \u002F\u002F Wait for reset complete\n    while (BRR_MdioRead(config->phyAddress, PHY_BASIC_CONTROL) & PHY_RESET);\n\n    \u002F\u002F Configure basic control register\n    uint16_t bcr = 0;\n    if (config->autoNegEnable) {\n        bcr |= PHY_AUTONEG_ENABLE | PHY_RESTART_AUTONEG;\n    }\n    bcr |= PHY_FULL_DUPLEX | PHY_SPEED_100M;\n\n    BRR_MdioWrite(config->phyAddress, PHY_BASIC_CONTROL, bcr);\n\n    \u002F\u002F Configure master\u002Fslave mode\n    uint16_t msCfg = BRR_MdioRead(\n        config->phyAddress,\n        PHY_MASTER_SLAVE_CONTROL\n    );\n\n    if (config->masterMode) {\n        msCfg |= PHY_MASTER_MODE;\n    } else {\n        msCfg &= ~PHY_MASTER_MODE;\n    }\n\n    BRR_MdioWrite(config->phyAddress, PHY_MASTER_SLAVE_CONTROL, msCfg);\n\n    \u002F\u002F Configure sleep mode\n    if (config->sleepEnable) {\n        uint16_t sleepReg = BRR_MdioRead(\n            config->phyAddress,\n            PHY_SLEEP_CONTROL\n        );\n        sleepReg |= PHY_SLEEP_ENABLE;\n        BRR_MdioWrite(config->phyAddress, PHY_SLEEP_CONTROL, sleepReg);\n    }\n\n    \u002F\u002F Configure LED indicators\n    BRR_MdioWrite(config->phyAddress, PHY_LED_CONTROL, config->ledMode);\n}\n```\n\n### Link Status Monitoring\n```c\n\u002F\u002F Monitor link status and cable health\ntypedef struct {\n    bool linkUp;\n    bool masterMode;\n    uint16_t linkSpeed;        \u002F\u002F Mbps\n    bool fullDuplex;\n    uint16_t cableLength;      \u002F\u002F Estimated meters\n    bool cableFault;\n} BRR_LinkStatus_t;\n\nBRR_LinkStatus_t BRR_GetLinkStatus(uint8_t phyAddress) {\n    BRR_LinkStatus_t status = {0};\n\n    \u002F\u002F Read basic status register\n    uint16_t bsr = BRR_MdioRead(phyAddress, PHY_BASIC_STATUS);\n\n    status.linkUp = (bsr & PHY_LINK_STATUS) != 0;\n\n    if (status.linkUp) {\n        \u002F\u002F Read master\u002Fslave status\n        uint16_t msStatus = BRR_MdioRead(\n            phyAddress,\n            PHY_MASTER_SLAVE_STATUS\n        );\n        status.masterMode = (msStatus & PHY_MASTER_STATUS) != 0;\n\n        \u002F\u002F Link speed is always 100 Mbps for BroadR-Reach\n        status.linkSpeed = 100;\n        status.fullDuplex = true;\n\n        \u002F\u002F Estimate cable length via TDR\n        status.cableLength = BRR_EstimateCableLength(phyAddress);\n\n        \u002F\u002F Check for cable faults\n        status.cableFault = BRR_CheckCableFault(phyAddress);\n    }\n\n    return status;\n}\n```\n\n### Cable Diagnostics (TDR)\n```c\n\u002F\u002F Time Domain Reflectometry for cable diagnostics\ntypedef enum {\n    CABLE_OK,\n    CABLE_OPEN,\n    CABLE_SHORT,\n    CABLE_CROSSTALK,\n    CABLE_IMPEDANCE_MISMATCH\n} BRR_CableFault_t;\n\nBRR_CableFault_t BRR_RunCableDiagnostics(uint8_t phyAddress) {\n    \u002F\u002F Trigger TDR test\n    uint16_t tdrCtrl = BRR_MdioRead(phyAddress, PHY_TDR_CONTROL);\n    tdrCtrl |= PHY_TDR_START;\n    BRR_MdioWrite(phyAddress, PHY_TDR_CONTROL, tdrCtrl);\n\n    \u002F\u002F Wait for completion (typically \u003C1ms)\n    uint32_t timeout = 1000;  \u002F\u002F 1ms timeout\n    while (timeout--) {\n        tdrCtrl = BRR_MdioRead(phyAddress, PHY_TDR_CONTROL);\n        if (!(tdrCtrl & PHY_TDR_START)) {\n            break;\n        }\n        DelayUs(1);\n    }\n\n    \u002F\u002F Read TDR result\n    uint16_t tdrResult = BRR_MdioRead(phyAddress, PHY_TDR_RESULT);\n\n    \u002F\u002F Parse fault type\n    uint8_t faultType = (tdrResult >> 12) & 0x0F;\n\n    switch (faultType) {\n        case 0x0: return CABLE_OK;\n        case 0x1: return CABLE_OPEN;\n        case 0x2: return CABLE_SHORT;\n        case 0x3: return CABLE_CROSSTALK;\n        case 0x4: return CABLE_IMPEDANCE_MISMATCH;\n        default:  return CABLE_OK;\n    }\n}\n\nuint16_t BRR_EstimateCableLength(uint8_t phyAddress) {\n    \u002F\u002F Read TDR distance measurement\n    uint16_t tdrDistance = BRR_MdioRead(phyAddress, PHY_TDR_DISTANCE);\n\n    \u002F\u002F Convert to meters (formula vendor-specific)\n    \u002F\u002F Typical: distance_m = (tdr_value * 0.1)\n    uint16_t lengthMeters = (tdrDistance * 10) \u002F 100;\n\n    return lengthMeters;\n}\n```\n\n### Sleep\u002FWake Functionality\n```c\n\u002F\u002F Enter sleep mode for power saving\nvoid BRR_EnterSleepMode(uint8_t phyAddress) {\n    \u002F\u002F Send sleep request\n    uint16_t sleepCtrl = BRR_MdioRead(phyAddress, PHY_SLEEP_CONTROL);\n    sleepCtrl |= PHY_SLEEP_REQUEST;\n    BRR_MdioWrite(phyAddress, PHY_SLEEP_CONTROL, sleepCtrl);\n\n    \u002F\u002F Wait for sleep acknowledge\n    uint32_t timeout = 10000;  \u002F\u002F 10ms\n    while (timeout--) {\n        sleepCtrl = BRR_MdioRead(phyAddress, PHY_SLEEP_CONTROL);\n        if (sleepCtrl & PHY_SLEEP_ACK) {\n            break;\n        }\n        DelayUs(1);\n    }\n\n    LogInfo(\"PHY entered sleep mode\");\n}\n\n\u002F\u002F Wake from sleep mode\nvoid BRR_WakeFromSleep(uint8_t phyAddress) {\n    \u002F\u002F Method 1: Send wake pulse on MDC line\n    BRR_SendWakePulse();\n\n    \u002F\u002F Method 2: Toggle PHY_WAKE pin (if available)\n    \u002F\u002F GPIO_SetPin(PHY_WAKE_PIN, HIGH);\n    \u002F\u002F DelayUs(100);\n    \u002F\u002F GPIO_SetPin(PHY_WAKE_PIN, LOW);\n\n    \u002F\u002F Wait for link to re-establish\n    uint32_t timeout = 100000;  \u002F\u002F 100ms\n    while (timeout--) {\n        uint16_t bsr = BRR_MdioRead(phyAddress, PHY_BASIC_STATUS);\n        if (bsr & PHY_LINK_STATUS) {\n            break;\n        }\n        DelayUs(1);\n    }\n\n    LogInfo(\"PHY woke from sleep mode\");\n}\n```\n\n### EMC\u002FEMI Configuration\n```c\n\u002F\u002F Configure EMI reduction features\nvoid BRR_ConfigureEMI(uint8_t phyAddress) {\n    \u002F\u002F Enable spread spectrum clocking for EMI reduction\n    uint16_t emiCtrl = BRR_MdioRead(phyAddress, PHY_EMI_CONTROL);\n\n    emiCtrl |= PHY_SSC_ENABLE;           \u002F\u002F Spread spectrum enable\n    emiCtrl |= PHY_SLEW_RATE_LIMIT;      \u002F\u002F Limit slew rate\n    emiCtrl |= PHY_COMMON_MODE_FILTER;   \u002F\u002F Enable CM filter\n\n    BRR_MdioWrite(phyAddress, PHY_EMI_CONTROL, emiCtrl);\n\n    \u002F\u002F Configure output driver strength (reduce overshoot)\n    uint16_t driverCfg = BRR_MdioRead(phyAddress, PHY_DRIVER_CONTROL);\n    driverCfg &= ~PHY_DRIVER_STRENGTH_MASK;\n    driverCfg |= PHY_DRIVER_STRENGTH_MEDIUM;  \u002F\u002F Medium strength\n    BRR_MdioWrite(phyAddress, PHY_DRIVER_CONTROL, driverCfg);\n}\n```\n\n### Power over Data Line (PoDL) Configuration\n```c\n\u002F\u002F Configure PoDL for powered devices (e.g., cameras)\ntypedef struct {\n    bool enable;\n    uint8_t powerClass;        \u002F\u002F 0-8 (IEEE 802.3bu)\n    uint16_t maxPowerMw;       \u002F\u002F Maximum power in mW\n} BRR_PoDL_Config_t;\n\nvoid BRR_ConfigurePoDL(uint8_t phyAddress, const BRR_PoDL_Config_t* cfg) {\n    if (!cfg->enable) {\n        \u002F\u002F Disable PoDL\n        BRR_MdioWrite(phyAddress, PHY_PODL_CONTROL, 0);\n        return;\n    }\n\n    \u002F\u002F Configure PoDL PSE (Power Sourcing Equipment)\n    uint16_t podlCtrl = 0;\n    podlCtrl |= PHY_PODL_ENABLE;\n    podlCtrl |= (cfg->powerClass \u003C\u003C 8) & PHY_PODL_CLASS_MASK;\n\n    BRR_MdioWrite(phyAddress, PHY_PODL_CONTROL, podlCtrl);\n\n    \u002F\u002F Set power limit\n    BRR_MdioWrite(phyAddress, PHY_PODL_POWER_LIMIT, cfg->maxPowerMw);\n\n    LogInfo(\"PoDL configured: Class %d, Max %d mW\",\n            cfg->powerClass, cfg->maxPowerMw);\n}\n```\n\n## Use Case: Surround View Camera System\n\n### Network Architecture\n```\nCentral Camera ECU (Master)\n  |\n  +-- Front Camera (PD, Slave) - 5m cable\n  +-- Rear Camera (PD, Slave) - 8m cable\n  +-- Left Camera (PD, Slave) - 12m cable\n  +-- Right Camera (PD, Slave) - 12m cable\n```\n\n### Cable Installation Guidelines\n- Route away from high-power lines (>50cm separation)\n- Avoid sharp bends (\u003C50mm radius)\n- Use cable ties every 15cm\n- Ground shielding at one point only\n- Install common-mode chokes near PHY\n\n### PHY Configuration for Cameras\n- Master mode at ECU\n- Slave mode at cameras\n- PoDL Class 3 (1-3.6W per camera)\n- Auto-negotiation enabled\n- Sleep mode for power saving when idle\n\n## Deliverables\n\n- PHY selection and configuration guide\n- Cable routing diagram\n- EMC test plan and results\n- TDR cable verification reports\n- Driver implementation (MDIO\u002FPHY)\n- Power budget analysis (PoDL)\n- Integration test specifications\n\n## Common Issues and Solutions\n\n### Link Instability\n- Check cable quality and length (\u003C15m)\n- Verify impedance matching (100 ohms)\n- Test with TDR for cable faults\n- Ensure proper master\u002Fslave configuration\n\n### EMI Emissions Failures\n- Enable spread spectrum clocking\n- Add\u002Frelocate common-mode chokes\n- Improve cable shielding and grounding\n- Reduce driver output strength\n\n### Auto-Negotiation Failures\n- Verify both PHYs support ANEG\n- Check for forced speed\u002Fduplex settings\n- Monitor MDIO communication errors\n- Validate PHY firmware version\n\n### PoDL Power Issues\n- Check cable resistance (\u003C2 ohms for AWG24)\n- Verify power class compatibility\n- Monitor voltage drop along cable\n- Ensure adequate PSE power budget\n\n## Ethernet AVB\u002FTSN Protocol\n\n## Core Competencies\n\nExpert in Automotive Ethernet with AVB\u002FTSN for deterministic, low-latency networking.\n\n### Physical Layer (100BASE-T1 \u002F 1000BASE-T1)\n- Single twisted pair (BroadR-Reach PHY)\n- 100 Mbps or 1 Gbps data rate\n- Cable length up to 15m (100BASE-T1) or 40m (1000BASE-T1)\n- Point-to-point topology (switched network)\n- PoE support for camera power\n\n### TSN Technology Stack\n- IEEE 802.1AS (Time Synchronization - gPTP)\n- IEEE 802.1Qbv (Time-Aware Shaper - TAS)\n- IEEE 802.1Qav (Credit-Based Shaper - CBS)\n- IEEE 802.1Qcc (Stream Reservation Protocol - SRP)\n- IEEE 802.1CB (Frame Replication and Elimination)\n\n### Protocol Layers\n```\nApplication (SOME\u002FIP, DoIP, AVTP)\n         |\nTransport (UDP\u002FTCP)\n         |\nNetwork (IPv4\u002FIPv6)\n         |\nData Link (AVB\u002FTSN + VLAN)\n         |\nPhysical (100BASE-T1 \u002F 1000BASE-T1)\n```\n\n### Time-Sensitive Traffic Classes\n- **Class A (CDT)**: Critical Data Traffic (e.g., ADAS sensor data)\n  - Max latency: 2ms\n  - Priority: Highest (PCP 6-7)\n- **Class B**: Audio\u002FVideo streaming\n  - Max latency: 50ms\n  - Priority: High (PCP 4-5)\n- **Best Effort**: Non-critical data\n  - No latency guarantee\n  - Priority: Normal (PCP 0-3)\n\n## Design Approach\n\n1. Network Architecture Design\n   - Define topology (star, daisy-chain, hybrid)\n   - Calculate bandwidth requirements\n   - Plan VLAN and QoS strategy\n   - Design fault tolerance (redundancy)\n\n2. TSN Configuration\n   - Configure gPTP domains\n   - Design Time-Aware Shaper schedules\n   - Allocate bandwidth per traffic class\n   - Configure stream reservation\n\n3. SOME\u002FIP Service Design\n   - Define service interfaces (FIDL)\n   - Implement service discovery\n   - Design event\u002Fmethod communication\n   - Configure serialization\n\n4. Validation and Testing\n   - Timing verification (end-to-end latency)\n   - Bandwidth utilization monitoring\n   - Fault injection testing\n   - TSN schedule validation\n\n## Implementation Examples\n\n### gPTP Time Synchronization (IEEE 802.1AS)\n```c\n\u002F\u002F Initialize gPTP for time synchronization\ntypedef struct {\n    uint8_t domainNumber;      \u002F\u002F gPTP domain (0-127)\n    uint8_t priority1;         \u002F\u002F Grandmaster priority\n    uint8_t priority2;\n    uint8_t logSyncInterval;   \u002F\u002F Sync message interval (log2)\n    uint8_t logAnnounceInterval;\n} gPTP_Config_t;\n\nvoid gPTP_Init(const gPTP_Config_t* config) {\n    \u002F\u002F Configure as grandmaster or slave\n    gPTP_SetDomain(config->domainNumber);\n    gPTP_SetPriority(config->priority1, config->priority2);\n\n    \u002F\u002F Set sync interval (e.g., -3 = 125us, 0 = 1s)\n    gPTP_SetSyncInterval(config->logSyncInterval);\n\n    \u002F\u002F Enable time synchronization\n    gPTP_Enable();\n}\n\n\u002F\u002F Get synchronized network time\nuint64_t gPTP_GetNetworkTime(void) {\n    uint64_t seconds;\n    uint32_t nanoseconds;\n\n    gPTP_GetTime(&seconds, &nanoseconds);\n\n    return (seconds * 1000000000ULL) + nanoseconds;\n}\n```\n\n### Time-Aware Shaper Configuration (IEEE 802.1Qbv)\n```c\n\u002F\u002F TAS gate control list for deterministic scheduling\ntypedef struct {\n    uint8_t gateStates;        \u002F\u002F Bitmap of open gates (per TC)\n    uint32_t timeIntervalNs;   \u002F\u002F Interval duration\n} TAS_GateEntry_t;\n\ntypedef struct {\n    uint64_t basetime;         \u002F\u002F Schedule start time (gPTP)\n    uint32_t cycleTime;        \u002F\u002F Total cycle duration\n    TAS_GateEntry_t entries[8];\n    uint8_t entryCount;\n} TAS_Schedule_t;\n\n\u002F\u002F Example: 1ms cycle with dedicated slots for each traffic class\nconst TAS_Schedule_t adasSchedule = {\n    .basetime = 0,             \u002F\u002F Align to gPTP epoch\n    .cycleTime = 1000000,      \u002F\u002F 1ms cycle\n    .entryCount = 4,\n    .entries = {\n        \u002F\u002F Time slot 1: Critical ADAS data (300us)\n        {.gateStates = 0b11000000, .timeIntervalNs = 300000},\n\n        \u002F\u002F Time slot 2: Audio\u002FVideo (400us)\n        {.gateStates = 0b00110000, .timeIntervalNs = 400000},\n\n        \u002F\u002F Time slot 3: Best effort (200us)\n        {.gateStates = 0b00001111, .timeIntervalNs = 200000},\n\n        \u002F\u002F Time slot 4: Guard band (100us)\n        {.gateStates = 0b00000000, .timeIntervalNs = 100000}\n    }\n};\n\nvoid TAS_ConfigureSchedule(uint8_t port, const TAS_Schedule_t* schedule) {\n    \u002F\u002F Program TAS registers on switch\u002Fendpoint\n    TAS_SetBaseTime(port, schedule->basetime);\n    TAS_SetCycleTime(port, schedule->cycleTime);\n\n    for (uint8_t i = 0; i \u003C schedule->entryCount; i++) {\n        TAS_SetGateEntry(\n            port,\n            i,\n            schedule->entries[i].gateStates,\n            schedule->entries[i].timeIntervalNs\n        );\n    }\n\n    \u002F\u002F Enable TAS\n    TAS_Enable(port);\n}\n```\n\n### AVTP Camera Streaming (IEEE 1722)\n```c\n\u002F\u002F AVTP stream for camera video\ntypedef struct {\n    uint64_t streamId;         \u002F\u002F Unique stream identifier\n    uint8_t  destMac[6];       \u002F\u002F Multicast MAC address\n    uint16_t vlanId;\n    uint8_t  priority;         \u002F\u002F PCP value\n    uint32_t maxFrameSize;     \u002F\u002F Maximum video frame size\n    uint16_t maxIntervalFrames;\u002F\u002F Frames per interval\n} AVTP_StreamConfig_t;\n\n\u002F\u002F Configure AVTP stream\nvoid AVTP_ConfigureStream(const AVTP_StreamConfig_t* config) {\n    \u002F\u002F Register stream with SRP\n    SRP_RegisterStream(\n        config->streamId,\n        config->destMac,\n        config->vlanId,\n        config->priority,\n        config->maxFrameSize,\n        config->maxIntervalFrames\n    );\n\n    \u002F\u002F Configure talker\n    AVTP_SetStreamId(config->streamId);\n    AVTP_SetFormat(AVTP_FORMAT_H264);\n}\n\n\u002F\u002F Send video frame via AVTP\nvoid AVTP_SendVideoFrame(\n    uint64_t streamId,\n    uint8_t* frameData,\n    uint32_t frameSize,\n    uint64_t timestamp\n) {\n    \u002F\u002F Build AVTP header\n    AVTP_Header_t header;\n    header.subtype = AVTP_SUBTYPE_CVF;  \u002F\u002F Compressed Video Format\n    header.streamId = streamId;\n    header.timestamp = timestamp;       \u002F\u002F gPTP timestamp\n    header.streamDataLength = frameSize;\n    header.sequenceNum = avtpSeqNum++;\n\n    \u002F\u002F Transmit with high priority\n    ETH_SendPacket(\n        &header,\n        sizeof(header),\n        frameData,\n        frameSize,\n        PRIORITY_HIGH\n    );\n}\n```\n\n### SOME\u002FIP Service Implementation\n```cpp\n\u002F\u002F SOME\u002FIP service definition (Franca IDL)\n\u002F*\ninterface SensorFusion {\n    version { major 1 minor 0 }\n\n    method GetObjectList {\n        out {\n            ObjectList objects\n        }\n    }\n\n    broadcast ObjectDetected {\n        out {\n            Object detectedObject\n        }\n    }\n}\n*\u002F\n\n\u002F\u002F Service implementation\nclass SensorFusionService : public SomeIpService {\npublic:\n    SensorFusionService() : SomeIpService(SERVICE_ID, INSTANCE_ID) {\n        \u002F\u002F Register methods\n        RegisterMethod(METHOD_GET_OBJECT_LIST,\n                      &SensorFusionService::HandleGetObjectList);\n\n        \u002F\u002F Offer service\n        OfferService();\n    }\n\n    void HandleGetObjectList(const Message& request, Message& response) {\n        \u002F\u002F Gather object list from sensors\n        ObjectList objects = GetTrackedObjects();\n\n        \u002F\u002F Serialize response\n        Serializer serializer;\n        serializer \u003C\u003C objects;\n\n        \u002F\u002F Send response\n        response.SetPayload(serializer.GetData());\n        SendResponse(response);\n    }\n\n    void NotifyObjectDetected(const Object& obj) {\n        \u002F\u002F Broadcast event\n        Message event(SERVICE_ID, INSTANCE_ID, EVENT_OBJECT_DETECTED);\n\n        Serializer serializer;\n        serializer \u003C\u003C obj;\n\n        event.SetPayload(serializer.GetData());\n        BroadcastEvent(event);\n    }\n\nprivate:\n    static const uint16_t SERVICE_ID = 0x1234;\n    static const uint16_t INSTANCE_ID = 0x0001;\n    static const uint16_t METHOD_GET_OBJECT_LIST = 0x0100;\n    static const uint16_t EVENT_OBJECT_DETECTED = 0x8000;\n};\n```\n\n### Stream Reservation Protocol (SRP)\n```c\n\u002F\u002F Reserve bandwidth for AVB\u002FTSN stream\ntypedef struct {\n    uint64_t streamId;\n    uint8_t  destMac[6];\n    uint16_t vlanId;\n    uint8_t  priority;\n    uint32_t maxFrameSize;\n    uint16_t maxIntervalFrames;\n    uint32_t accumulatedLatency;  \u002F\u002F Max end-to-end latency\n} SRP_TalkerAdvertise_t;\n\nSRP_Status_t SRP_AdvertiseStream(const SRP_TalkerAdvertise_t* talker) {\n    \u002F\u002F Calculate required bandwidth\n    uint32_t bandwidth = (talker->maxFrameSize * 8 *\n                         talker->maxIntervalFrames) \u002F 125000;  \u002F\u002F Mbps\n\n    \u002F\u002F Send MSRP Talker Advertise\n    MSRP_SendTalkerAdvertise(\n        talker->streamId,\n        talker->destMac,\n        talker->vlanId,\n        talker->priority,\n        talker->maxFrameSize,\n        talker->maxIntervalFrames,\n        talker->accumulatedLatency\n    );\n\n    \u002F\u002F Wait for listener ready\n    return SRP_WaitForListenerReady(talker->streamId, 1000);\n}\n```\n\n## Use Case: ADAS Sensor Fusion System\n\n### Network Architecture\n```\nCentral ADAS ECU (Switch + Compute)\n  |\n  +-- Front Camera (1920x1080@30fps, H.264)\n  +-- Rear Camera (1920x1080@30fps, H.264)\n  +-- Left Camera (1280x720@30fps, H.264)\n  +-- Right Camera (1280x720@30fps, H.264)\n  +-- Front Radar (Object list @ 50Hz)\n  +-- Lidar (Point cloud @ 10Hz)\n  +-- Gateway ECU (CAN\u002FFlexRay bridge)\n```\n\n### Bandwidth Requirements (1000BASE-T1)\n- Front Camera: ~8 Mbps (H.264)\n- Rear Camera: ~8 Mbps\n- Left Camera: ~4 Mbps\n- Right Camera: ~4 Mbps\n- Radar: ~1 Mbps\n- Lidar: ~20 Mbps\n- Control\u002Fdiagnostics: ~5 Mbps\n- **Total**: ~50 Mbps (5% of 1 Gbps)\n\n### TSN Configuration\n- gPTP domain 0 for time sync (125us sync interval)\n- TAS cycle: 1ms\n- Critical traffic (radar, control): 300us window\n- Video traffic: 600us window\n- Best effort: 100us window\n\n## Deliverables\n\n- Network topology diagram\n- TSN schedule configuration\n- SOME\u002FIP service definitions (FIDL)\n- Bandwidth allocation spreadsheet\n- gPTP configuration\n- Driver\u002Fmiddleware implementation\n- Integration test specifications\n- Timing analysis report\n\n## Common Issues and Solutions\n\n### Time Sync Failures\n- Verify gPTP domain configuration\n- Check grandmaster selection algorithm\n- Monitor path delay measurements\n- Validate switch support for gPTP\n\n### Packet Loss in Critical Traffic\n- Check TAS gate schedule alignment\n- Verify bandwidth reservation via SRP\n- Monitor queue depths and drops\n- Validate switch buffer configuration\n\n### High Latency\n- Optimize TAS schedule (reduce guard bands)\n- Check for best-effort traffic starvation\n- Verify priority tag configuration\n- Analyze per-hop latency in switches\n\n### SOME\u002FIP Discovery Issues\n- Check multicast routing configuration\n- Verify service offer\u002Ffind timing\n- Monitor UDP port conflicts\n- Validate firewall\u002FVLAN settings\n\n## FlexRay Protocol\n\n## Core Competencies\n\nExpert in FlexRay protocol for deterministic, fault-tolerant automotive communication.\n\n### Physical Layer\n- Dual-channel redundant communication (Channel A\u002FB)\n- Differential signaling at 10 Mbps\n- Bus Guardian for fault isolation\n- Star, bus, or hybrid topologies\n- Cable length up to 24m per segment\n\n### Data Link Layer\n- Static and dynamic segments\n- Time Division Multiple Access (TDMA)\n- Cycle time: 1-16 ms (configurable)\n- Frame size: 0-254 bytes payload\n- CRC and frame checksums\n\n### Communication Cycle Structure\n```\n|\u003C------- Communication Cycle ------->|\n| Static | Dynamic | Symbol | NIT     |\n| Segment| Segment | Window | (Idle)  |\n```\n\n- Static Segment: Guaranteed deterministic slots\n- Dynamic Segment: Flexible priority-based transmission\n- Symbol Window: Network management\n- Network Idle Time (NIT): Clock synchronization\n\n### Timing and Synchronization\n- Global time synchronization across all nodes\n- Offset and rate correction\n- Maximum drift tolerance: 1500 ppm\n- Startup and wakeup procedures\n- Coldstart vs. non-coldstart nodes\n\n### Configuration Parameters\n- Slot assignment (static\u002Fdynamic)\n- Payload length per slot\n- Base cycle multiplier\n- Action point offsets\n- Bus Guardian parameters\n\n## Design Approach\n\n1. Network Planning\n   - Define communication matrix\n   - Calculate bandwidth requirements\n   - Assign static\u002Fdynamic slots\n   - Configure redundancy strategy\n\n2. Cluster Configuration\n   - Set global cycle parameters\n   - Configure clock synchronization\n   - Define startup sequence\n   - Set Bus Guardian parameters\n\n3. Node Implementation\n   - Configure Communication Controller (CC)\n   - Implement AUTOSAR FlexRay Driver\n   - Define frame triggering\n   - Implement error handling\n\n4. Validation and Testing\n   - Timing verification (WCET analysis)\n   - Fault injection testing\n   - Startup sequence validation\n   - Load and stress testing\n\n## Implementation Examples\n\n### Static Slot Configuration (AUTOSAR)\n```c\n\u002F\u002F FlexRay static slot transmission\nconst Fr_LPduType staticPdu = {\n    .FrameId = 10,              \u002F\u002F Static slot ID\n    .Channel = FR_CHANNEL_AB,   \u002F\u002F Both channels\n    .CycleRepetition = 1,       \u002F\u002F Every cycle\n    .CycleOffset = 0,\n    .Payload = 16,              \u002F\u002F 16 bytes (8 words)\n    .HeaderCRC = 0x1A3          \u002F\u002F Calculated CRC\n};\n\n\u002F\u002F Transmit in static slot\nStd_ReturnType result = Fr_TransmitTxLPdu(\n    0,                          \u002F\u002F Controller ID\n    10,                         \u002F\u002F Frame ID\n    txData,                     \u002F\u002F Payload pointer\n    16                          \u002F\u002F Length\n);\n```\n\n### Dynamic Slot Usage\n```c\n\u002F\u002F Dynamic segment configuration\nconst Fr_DynamicSlotConfig_t dynConfig = {\n    .SlotId = 50,               \u002F\u002F Dynamic slot start\n    .PayloadLength = 32,\n    .MinislotCount = 20,        \u002F\u002F Number of minislots\n    .Priority = 5               \u002F\u002F Transmission priority\n};\n\n\u002F\u002F Conditional transmission in dynamic segment\nif (Fr_CheckTxLPduStatus(0, 50) == FR_TRANSMITTED) {\n    Fr_TransmitTxLPdu(0, 50, dynamicData, 32);\n}\n```\n\n### Startup Sequence\n```c\n\u002F\u002F FlexRay startup procedure\nvoid FlexRay_Startup(void) {\n    \u002F\u002F Initialize Communication Controller\n    Fr_Init(&Fr_Config);\n\n    \u002F\u002F Configure cluster parameters\n    Fr_ControllerInit(0);\n\n    \u002F\u002F Start communication (coldstart node)\n    Fr_StartCommunication(0);\n\n    \u002F\u002F Wait for normal active state\n    Fr_PocStateType pocState;\n    do {\n        Fr_GetPOCStatus(0, &pocState);\n    } while (pocState != FR_POCSTATE_NORMAL_ACTIVE);\n}\n```\n\n### Bus Guardian Configuration\n```c\n\u002F\u002F Bus Guardian prevents babbling idiot\nconst Fr_BusGuardianConfig_t bgConfig = {\n    .GuardianEnable = TRUE,\n    .ActionPointOffset = 5,     \u002F\u002F Macroticks before slot start\n    .MaxTxDuration = 50,        \u002F\u002F Maximum transmission time\n    .MinislotDuration = 2       \u002F\u002F Minislot size (macroticks)\n};\n```\n\n## Use Case: Steer-by-Wire System\n\n### Network Architecture\n```\nSteering ECU (Coldstart) \u003C--Channel A\u002FB--> Actuator ECU 1\n                        \u003C--Channel A\u002FB--> Actuator ECU 2\n                        \u003C--Channel A\u002FB--> Sensor ECU\n```\n\n### Communication Matrix\n| Slot | Sender       | Data             | Cycle | Size |\n|------|--------------|------------------|-------|------|\n| 1    | Steering ECU | Steering Angle   | 5ms   | 16B  |\n| 2    | Sensor ECU   | Torque Sensor    | 5ms   | 8B   |\n| 3    | Actuator 1   | Position Status  | 5ms   | 12B  |\n| 4    | Actuator 2   | Position Status  | 5ms   | 12B  |\n| 50+  | All          | Diagnostics      | 20ms  | 32B  |\n\n### Safety Considerations\n- ASIL-D rated communication\n- Dual-channel redundancy with voting\n- Sequence counter for frame freshness\n- CRC calculation for data integrity\n- Timeout supervision on critical signals\n\n## Deliverables\n\n- FlexRay cluster specification (FIBEX XML)\n- Node configuration files (AUTOSAR)\n- Communication matrix documentation\n- Driver implementation (C\u002FC++)\n- Timing analysis report (WCET)\n- Integration test specifications\n- Safety documentation (ISO 26262)\n\n## Common Issues and Solutions\n\n### Startup Failures\n- Check coldstart node configuration\n- Verify sync frame offsets\n- Ensure clock tolerance within spec\n- Validate Bus Guardian timing\n\n### Communication Errors\n- Monitor slot boundary violations\n- Check CRC errors in frames\n- Verify payload length configuration\n- Analyze bus load in dynamic segment\n\n### Timing Violations\n- Reduce static segment load\n- Optimize dynamic slot allocation\n- Adjust action point offsets\n- Verify interrupt latencies\n\n## LIN Protocol\n\n## Core Competencies\n\nExpert in LIN protocol for cost-effective automotive sub-networks.\n\n### Physical Layer\n- Single-wire bidirectional bus\n- Baud rates: 1 kbps to 20 kbps (typical: 9.6\u002F19.2 kbps)\n- Master-slave architecture (1 master, up to 16 slaves)\n- Dominant (0V) and recessive (12V battery voltage)\n- Bus length up to 40 meters\n- No termination resistors required\n\n### Protocol Architecture\n- Master schedules all communication\n- Slaves respond only when addressed\n- Time-triggered schedule tables\n- Event-triggered frames for efficiency\n- Diagnostic services (ISO 14229 subset)\n\n### Frame Structure\n```\n|\u003C---------- LIN Frame ---------->|\n| Header (Master)  | Response      |\n| Break | Sync | ID| Data | CRC   |\n```\n\n- Break field: 13 dominant bits minimum\n- Sync byte: 0x55 for baud rate sync\n- Protected ID: 6-bit ID + 2 parity bits\n- Data: 1-8 bytes\n- Checksum: Classic or Enhanced\n\n### LIN Frame Types\n- Unconditional frames (standard data)\n- Event-triggered frames (slave polling)\n- Sporadic frames (conditional master transmission)\n- Diagnostic frames (node configuration)\n\n### Schedule Table Concept\n```c\n\u002F\u002F Schedule table defines communication pattern\nLIN_ScheduleTable_t SeatControlSchedule[] = {\n    {FRAME_SeatPosition,    10},  \u002F\u002F Every 10ms\n    {FRAME_SeatMemory,      50},  \u002F\u002F Every 50ms\n    {FRAME_EventTrigger,   100},  \u002F\u002F Slave event polling\n    {FRAME_DiagRequest,    200},  \u002F\u002F Diagnostic window\n};\n```\n\n## Design Approach\n\n1. Network Planning\n   - Define master and slave nodes\n   - Create signal database (LDF file)\n   - Design schedule tables\n   - Assign frame IDs (0x00-0x3F)\n\n2. Master Node Implementation\n   - Configure UART for LIN\n   - Implement schedule table execution\n   - Handle slave responses\n   - Provide diagnostic services\n\n3. Slave Node Implementation\n   - Configure frame filters (ID match)\n   - Implement response generation\n   - Handle sleep\u002Fwakeup commands\n   - Support node configuration\n\n4. Validation and Testing\n   - Bus timing verification\n   - Frame error injection\n   - Sleep\u002Fwakeup testing\n   - EMC compliance testing\n\n## Implementation Examples\n\n### Master Frame Transmission (AUTOSAR)\n```c\n\u002F\u002F LIN master sends unconditional frame\nvoid Lin_MasterSendFrame(uint8 channel, Lin_PduType* pdu) {\n    \u002F\u002F Send break field (13-26 dominant bits)\n    Lin_SendBreak(channel);\n\n    \u002F\u002F Send sync byte (0x55)\n    Lin_SendByte(channel, LIN_SYNC_BYTE);\n\n    \u002F\u002F Calculate protected ID (ID + parity)\n    uint8 protectedId = Lin_CalculateProtectedId(pdu->Id);\n    Lin_SendByte(channel, protectedId);\n\n    \u002F\u002F Send data bytes\n    for (uint8 i = 0; i \u003C pdu->DataLength; i++) {\n        Lin_SendByte(channel, pdu->Data[i]);\n    }\n\n    \u002F\u002F Send checksum (enhanced)\n    uint8 checksum = Lin_CalculateChecksum(\n        protectedId,\n        pdu->Data,\n        pdu->DataLength,\n        LIN_ENHANCED_CRC\n    );\n    Lin_SendByte(channel, checksum);\n}\n```\n\n### Slave Response Handling\n```c\n\u002F\u002F LIN slave responds to master request\nvoid Lin_SlaveProcessFrame(uint8 id, uint8* data, uint8 len) {\n    Lin_FrameResponseType response;\n\n    \u002F\u002F Check if this frame is for us\n    if (Lin_GetFrameResponse(id, &response) == E_OK) {\n        switch (response.Type) {\n            case LIN_UNCONDITIONAL:\n                \u002F\u002F Provide response data\n                Lin_PrepareResponse(\n                    response.Data,\n                    response.Length\n                );\n                break;\n\n            case LIN_EVENT_TRIGGERED:\n                \u002F\u002F Check if we have data to send\n                if (Lin_HasEventData()) {\n                    Lin_PrepareResponse(\n                        eventData,\n                        eventLength\n                    );\n                }\n                break;\n\n            case LIN_DIAGNOSTIC:\n                \u002F\u002F Handle diagnostic request\n                Lin_ProcessDiagnostic(data, len);\n                break;\n        }\n    }\n}\n```\n\n### Schedule Table Execution\n```c\n\u002F\u002F Master executes schedule table\ntypedef struct {\n    uint8 frameId;\n    uint16 delayMs;\n} Lin_ScheduleEntry_t;\n\nconst Lin_ScheduleEntry_t seatSchedule[] = {\n    {0x10, 10},   \u002F\u002F Seat position every 10ms\n    {0x11, 20},   \u002F\u002F Seat tilt every 20ms\n    {0x12, 50},   \u002F\u002F Memory recall every 50ms\n    {0x3C, 100},  \u002F\u002F Event-triggered every 100ms\n    {0x3D, 200}   \u002F\u002F Diagnostic every 200ms\n};\n\nvoid Lin_ExecuteSchedule(uint8 channel) {\n    static uint8 scheduleIndex = 0;\n    static uint32 lastTime = 0;\n\n    uint32 currentTime = GetTickCount();\n    const Lin_ScheduleEntry_t* entry = &seatSchedule[scheduleIndex];\n\n    if (currentTime - lastTime >= entry->delayMs) {\n        Lin_SendFrame(channel, entry->frameId);\n\n        scheduleIndex = (scheduleIndex + 1) %\n                        ARRAY_SIZE(seatSchedule);\n        lastTime = currentTime;\n    }\n}\n```\n\n### Sleep\u002FWakeup Implementation\n```c\n\u002F\u002F Sleep command (diagnostic frame 0x3C)\nvoid Lin_GoToSleep(uint8 channel) {\n    uint8 sleepCmd[] = {0x00, 0xFF, 0xFF, 0xFF,\n                        0xFF, 0xFF, 0xFF, 0xFF};\n    Lin_SendDiagnosticFrame(channel, 0x3C, sleepCmd, 8);\n\n    \u002F\u002F Enter sleep mode after frame transmission\n    Lin_SetState(channel, LIN_STATE_SLEEP);\n}\n\n\u002F\u002F Wakeup pulse (dominant signal 250-5000us)\nvoid Lin_Wakeup(uint8 channel) {\n    \u002F\u002F Send dominant pulse (typically 500us)\n    Lin_SendWakeupPulse(channel, 500);\n\n    \u002F\u002F Wait for bus recovery\n    DelayUs(150);\n\n    \u002F\u002F Resume normal operation\n    Lin_SetState(channel, LIN_STATE_OPERATIONAL);\n}\n```\n\n### Node Configuration (LIN 2.x)\n```c\n\u002F\u002F Assign NAD (Node Address for Diagnostics)\nvoid Lin_AssignNAD(uint8 supplierId, uint16 functionId, uint8 newNAD) {\n    uint8 configData[] = {\n        0x06,                      \u002F\u002F Service: Assign NAD\n        (supplierId >> 8) & 0xFF,  \u002F\u002F Supplier ID MSB\n        supplierId & 0xFF,         \u002F\u002F Supplier ID LSB\n        (functionId >> 8) & 0xFF,  \u002F\u002F Function ID MSB\n        functionId & 0xFF,         \u002F\u002F Function ID LSB\n        newNAD,                    \u002F\u002F New NAD\n        0xFF, 0xFF\n    };\n\n    Lin_SendDiagnosticFrame(0, 0x3C, configData, 8);\n}\n```\n\n## Use Case: Power Seat Control\n\n### Network Architecture\n```\nMaster (Body Control Module)\n  |\n  +-- Slave 1: Seat Position Sensor (NAD 0x01)\n  +-- Slave 2: Lumbar Actuator (NAD 0x02)\n  +-- Slave 3: Recline Motor (NAD 0x03)\n  +-- Slave 4: Height Adjustment (NAD 0x04)\n```\n\n### Signal Database (LDF excerpt)\n```ldf\nSignals {\n    SeatPositionFB: 8, 0, RightSeatSensor, AllNodes;\n    LumbarPosition: 8, 0, LumbarActuator, AllNodes;\n    ReclineAngle: 16, 0, ReclineMotor, AllNodes;\n    SeatHeight: 8, 0, HeightActuator, AllNodes;\n    MemoryRecall: 2, 0, BodyControlModule, AllNodes;\n}\n\nFrames {\n    SeatStatus: 0x10, BodyControlModule, 4 {\n        SeatPositionFB, 0;\n        LumbarPosition, 8;\n        ReclineAngle, 16;\n    }\n\n    SeatCommand: 0x11, BodyControlModule, 2 {\n        MemoryRecall, 0;\n        TargetPosition, 8;\n    }\n}\n\nSchedule_tables {\n    NormalOperation {\n        SeatStatus delay 10 ms;\n        SeatCommand delay 20 ms;\n        EventTriggered delay 50 ms;\n    }\n}\n```\n\n### Timing Considerations\n- Frame time: ~10ms at 9.6 kbps for 8-byte frame\n- Schedule cycle: 100-200ms typical\n- Response timeout: 14ms maximum (LIN spec)\n- Sleep transition: within 4 seconds\n\n## Deliverables\n\n- LIN network description file (LDF)\n- Node capability files (NCF)\n- Master schedule tables\n- Slave driver implementation\n- Diagnostic database (ODX)\n- Integration test specifications\n- EMC test report\n\n## Common Issues and Solutions\n\n### Sync Byte Errors\n- Check baud rate tolerance (\u003C1.5%)\n- Verify UART clock source stability\n- Adjust slave sync detection\n\n### Checksum Failures\n- Verify classic vs. enhanced CRC mode\n- Check endianness of multi-byte signals\n- Validate checksum calculation algorithm\n\n### Sleep\u002FWakeup Problems\n- Check wakeup pulse duration (250-5000us)\n- Verify bus pullup resistor (1k typical)\n- Ensure all nodes support sleep mode\n\n### Bus Contention\n- Verify schedule table timing\n- Check for rogue slave transmissions\n- Monitor bus idle time between frames\n\n## LVDS Protocol\n\n## Core Competencies\n\nExpert in LVDS for high-speed differential signaling in automotive applications.\n\n### Physical Layer Characteristics\n- Differential voltage: 247-454 mV (nominal 350 mV)\n- Common-mode voltage: 1.2V typical\n- Data rates: 155 Mbps to 1.2 Gbps per lane\n- Low power consumption: ~3.5mW per driver\n- Excellent EMI performance (differential cancellation)\n- Point-to-point or multi-drop topologies\n\n### Signal Characteristics\n- Differential impedance: 100 ohms ±10%\n- Rise\u002Ffall time: \u003C500ps (typical 200ps)\n- Propagation delay: ~50ps\u002Finch on PCB\n- Maximum cable length: 10m (shielded twisted pair)\n- Skew tolerance: ±350ps between lanes\n\n### LVDS Applications in Automotive\n1. **Camera Interfaces**\n   - Raw Bayer sensor data (MIPI CSI-2)\n   - YUV422\u002FRGB888 video formats\n   - 1-4 data lanes + clock lane\n   - Typical: 720p@30fps = 1 lane, 1080p@60fps = 4 lanes\n\n2. **Display Interfaces**\n   - FPD-Link (Texas Instruments)\n   - OpenLDI for LCD panels\n   - Instrument cluster displays\n   - Head-up display (HUD) units\n\n3. **Sensor Data**\n   - Radar digital interface\n   - Lidar point cloud transmission\n   - High-speed ADC data\n\n## Design Approach\n\n1. Signal Integrity Design\n   - Differential pair routing (100 ohm impedance)\n   - Length matching between pairs (±5 mils)\n   - Controlled impedance PCB stackup\n   - Minimize vias and stubs\n\n2. Serializer\u002FDeserializer Selection\n   - Choose appropriate SerDes chipset\n   - Calculate required bandwidth\n   - Plan for FEC (Forward Error Correction)\n   - Consider diagnostic features\n\n3. EMC\u002FEMI Mitigation\n   - Common-mode choke on cable\n   - Proper grounding and shielding\n   - Spread spectrum clocking\n   - PCB layer stackup optimization\n\n4. Validation and Testing\n   - Eye diagram analysis\n   - Jitter and skew measurement\n   - BER (Bit Error Rate) testing\n   - EMI radiated emissions testing\n\n## Implementation Examples\n\n### LVDS Driver Configuration\n```c\n\u002F\u002F LVDS transmitter initialization\ntypedef struct {\n    uint8_t laneCount;         \u002F\u002F 1-4 lanes\n    uint32_t bitRate;          \u002F\u002F Mbps per lane\n    bool spreadSpectrum;       \u002F\u002F SSC for EMI reduction\n    uint8_t outputSwing;       \u002F\u002F 250mV, 300mV, 350mV, 400mV\n    bool termination;          \u002F\u002F 100 ohm termination\n} LVDS_TxConfig_t;\n\nvoid LVDS_InitTransmitter(const LVDS_TxConfig_t* config) {\n    \u002F\u002F Configure PLL for desired bit rate\n    uint32_t pllFreq = config->bitRate * config->laneCount;\n    LVDS_SetPLLFrequency(pllFreq);\n\n    \u002F\u002F Enable spread spectrum if requested\n    if (config->spreadSpectrum) {\n        LVDS_EnableSSC(SSC_CENTER_SPREAD, SSC_MODULATION_0_5_PERCENT);\n    }\n\n    \u002F\u002F Configure output swing\n    LVDS_SetOutputSwing(config->outputSwing);\n\n    \u002F\u002F Enable differential termination\n    if (config->termination) {\n        LVDS_EnableTermination(TERMINATION_100_OHM);\n    }\n\n    \u002F\u002F Configure lane mapping\n    for (uint8_t lane = 0; lane \u003C config->laneCount; lane++) {\n        LVDS_MapLane(lane, LANE_ENABLED);\n    }\n\n    \u002F\u002F Enable transmitter\n    LVDS_Enable(LVDS_TX);\n}\n```\n\n### MIPI CSI-2 over LVDS (Camera Interface)\n```c\n\u002F\u002F MIPI CSI-2 camera configuration\ntypedef struct {\n    uint8_t dataLanes;         \u002F\u002F 1-4 data lanes\n    uint32_t pixelClock;       \u002F\u002F MHz\n    uint16_t width;            \u002F\u002F Pixels\n    uint16_t height;           \u002F\u002F Lines\n    uint8_t bitsPerPixel;      \u002F\u002F 8, 10, 12, 16\n    uint8_t virtualChannel;    \u002F\u002F 0-3\n} CSI2_CameraConfig_t;\n\nvoid CSI2_ConfigureCamera(const CSI2_CameraConfig_t* config) {\n    \u002F\u002F Calculate required lane data rate\n    \u002F\u002F rate = (width * height * bpp * fps) \u002F lanes\n    uint32_t bytesPerFrame = config->width * config->height *\n                             config->bitsPerPixel \u002F 8;\n    uint32_t laneDataRate = (bytesPerFrame * 30) \u002F config->dataLanes;\n\n    \u002F\u002F Configure D-PHY (LVDS physical layer)\n    CSI2_ConfigureDPhy(config->dataLanes, laneDataRate);\n\n    \u002F\u002F Configure CSI-2 receiver\n    CSI2_SetVirtualChannel(config->virtualChannel);\n    CSI2_SetDataType(CSI2_DT_RAW10);  \u002F\u002F For 10-bit Bayer\n    CSI2_SetImageSize(config->width, config->height);\n\n    \u002F\u002F Enable lanes\n    for (uint8_t lane = 0; lane \u003C config->dataLanes; lane++) {\n        CSI2_EnableLane(lane);\n    }\n\n    \u002F\u002F Start receiving\n    CSI2_StartReceive();\n}\n\n\u002F\u002F CSI-2 packet reception handler\nvoid CSI2_ReceiveFrame(uint8_t* frameBuffer, uint32_t bufferSize) {\n    \u002F\u002F Wait for frame start (FS) packet\n    CSI2_Packet_t packet;\n    while (1) {\n        if (CSI2_ReceivePacket(&packet) == CSI2_OK) {\n            if (packet.dataType == CSI2_DT_FRAME_START) {\n                break;\n            }\n        }\n    }\n\n    \u002F\u002F Receive line packets\n    uint32_t offset = 0;\n    uint16_t linesReceived = 0;\n\n    while (linesReceived \u003C imageHeight) {\n        if (CSI2_ReceivePacket(&packet) == CSI2_OK) {\n            if (packet.dataType == CSI2_DT_RAW10) {\n                \u002F\u002F Copy pixel data\n                memcpy(&frameBuffer[offset],\n                       packet.payload,\n                       packet.wordCount);\n                offset += packet.wordCount;\n                linesReceived++;\n            } else if (packet.dataType == CSI2_DT_FRAME_END) {\n                break;\n            }\n        }\n    }\n\n    \u002F\u002F Signal frame complete\n    CSI2_FrameComplete(frameBuffer, offset);\n}\n```\n\n### FPD-Link Display Interface\n```c\n\u002F\u002F FPD-Link III serializer configuration\ntypedef struct {\n    uint16_t displayWidth;\n    uint16_t displayHeight;\n    uint8_t colorDepth;        \u002F\u002F 18 or 24 bits\n    uint32_t pixelClock;       \u002F\u002F MHz\n    bool backChannel;          \u002F\u002F Enable I2C\u002Fcontrol back channel\n} FPDLink_DisplayConfig_t;\n\nvoid FPDLink_ConfigureDisplay(const FPDLink_DisplayConfig_t* config) {\n    \u002F\u002F Calculate serialized data rate\n    uint32_t dataRate = config->pixelClock * config->colorDepth;\n\n    \u002F\u002F Configure serializer (DS90UB913A-Q1 or similar)\n    FPDLink_SerializerInit();\n\n    \u002F\u002F Set pixel format\n    if (config->colorDepth == 18) {\n        FPDLink_SetPixelFormat(FPDLINK_RGB666);\n    } else {\n        FPDLink_SetPixelFormat(FPDLINK_RGB888);\n    }\n\n    \u002F\u002F Configure timing\n    FPDLink_SetDisplayTiming(\n        config->displayWidth,\n        config->displayHeight,\n        config->pixelClock\n    );\n\n    \u002F\u002F Enable back channel for touchscreen\u002FI2C\n    if (config->backChannel) {\n        FPDLink_EnableBackChannel(BACK_CHANNEL_I2C);\n    }\n\n    \u002F\u002F Enable serializer output\n    FPDLink_EnableOutput();\n}\n\n\u002F\u002F FPD-Link deserializer (at display side)\nvoid FPDLink_DeserializerInit(void) {\n    \u002F\u002F Configure deserializer (DS90UB914A-Q1 or similar)\n    FPDLink_DeserInit();\n\n    \u002F\u002F Auto-detect incoming signal\n    FPDLink_AutoDetectFormat();\n\n    \u002F\u002F Configure LCD output interface\n    FPDLink_SetOutputInterface(OUTPUT_PARALLEL_RGB);\n\n    \u002F\u002F Enable pattern generation for testing\n    FPDLink_EnableTestPattern(PATTERN_COLORBAR);\n\n    \u002F\u002F Wait for lock\n    while (!FPDLink_IsLocked()) {\n        DelayMs(10);\n    }\n\n    \u002F\u002F Disable test pattern\n    FPDLink_DisableTestPattern();\n}\n```\n\n### LVDS Receiver with Error Detection\n```c\n\u002F\u002F LVDS receiver with link monitoring\ntypedef struct {\n    bool locked;\n    uint32_t bitErrors;\n    uint32_t frameErrors;\n    int8_t signalStrength;     \u002F\u002F dBm\n    uint32_t jitterPs;         \u002F\u002F Picoseconds\n} LVDS_RxStatus_t;\n\nLVDS_RxStatus_t LVDS_GetReceiverStatus(void) {\n    LVDS_RxStatus_t status = {0};\n\n    \u002F\u002F Check clock\u002Fdata lock\n    status.locked = LVDS_IsClockLocked() && LVDS_IsDataLocked();\n\n    \u002F\u002F Read error counters\n    status.bitErrors = LVDS_ReadRegister(REG_BIT_ERROR_COUNT);\n    status.frameErrors = LVDS_ReadRegister(REG_FRAME_ERROR_COUNT);\n\n    \u002F\u002F Measure signal strength\n    status.signalStrength = LVDS_MeasureSignalStrength();\n\n    \u002F\u002F Measure jitter\n    status.jitterPs = LVDS_MeasureJitter();\n\n    return status;\n}\n\n\u002F\u002F Automatic link recovery\nvoid LVDS_MonitorLink(void) {\n    static uint32_t lastErrorCount = 0;\n    LVDS_RxStatus_t status = LVDS_GetReceiverStatus();\n\n    if (!status.locked) {\n        LogError(\"LVDS link lost - attempting recovery\");\n        LVDS_ResetReceiver();\n        return;\n    }\n\n    \u002F\u002F Check for increasing error rate\n    if (status.bitErrors > lastErrorCount + 100) {\n        LogWarning(\"LVDS bit errors detected: %d\", status.bitErrors);\n\n        \u002F\u002F Attempt equalization adjustment\n        LVDS_AdjustEqualization();\n    }\n\n    lastErrorCount = status.bitErrors;\n}\n```\n\n### Signal Integrity Verification\n```c\n\u002F\u002F Built-in self-test (BIST) pattern generation\ntypedef enum {\n    BIST_PRBS7,      \u002F\u002F Pseudo-random 2^7-1\n    BIST_PRBS23,     \u002F\u002F Pseudo-random 2^23-1\n    BIST_PRBS31,     \u002F\u002F Pseudo-random 2^31-1\n    BIST_FIXED_0,    \u002F\u002F All zeros\n    BIST_FIXED_1,    \u002F\u002F All ones\n    BIST_ALTERNATE   \u002F\u002F 10101010...\n} LVDS_BIST_Pattern_t;\n\nvoid LVDS_RunBIST(LVDS_BIST_Pattern_t pattern, uint32_t durationMs) {\n    \u002F\u002F Enable BIST pattern generator\n    LVDS_EnableBIST(pattern);\n\n    \u002F\u002F Wait for test duration\n    DelayMs(durationMs);\n\n    \u002F\u002F Disable BIST\n    LVDS_DisableBIST();\n\n    \u002F\u002F Read results\n    uint32_t bitErrors = LVDS_GetBISTErrors();\n    uint32_t totalBits = LVDS_GetBISTBitCount();\n\n    float ber = (float)bitErrors \u002F (float)totalBits;\n\n    LogInfo(\"BIST complete: BER = %e (%d errors in %d bits)\",\n            ber, bitErrors, totalBits);\n\n    \u002F\u002F BER should be \u003C 1e-12 for reliable operation\n    if (ber > 1e-9) {\n        LogError(\"BIST failed: BER too high\");\n    }\n}\n```\n\n## Use Case: Surround View Camera System\n\n### System Architecture\n```\nCentral ECU (SoC with 4x CSI-2 inputs)\n  |\n  +-- Front Camera (LVDS 4-lane) - 1920x1080@30fps\n  +-- Rear Camera (LVDS 4-lane) - 1920x1080@30fps\n  +-- Left Camera (LVDS 2-lane) - 1280x720@30fps\n  +-- Right Camera (LVDS 2-lane) - 1280x720@30fps\n```\n\n### Camera Configuration\n- Front\u002FRear: 4 data lanes @ 800 Mbps\u002Flane\n- Left\u002FRight: 2 data lanes @ 800 Mbps\u002Flane\n- RAW10 Bayer format (10 bits\u002Fpixel)\n- Virtual channels 0-3 for each camera\n\n### PCB Design Considerations\n- Differential pair routing: 5 mil trace\u002F5 mil space\n- Length matching: ±5 mils within pair, ±50 mils between pairs\n- Reference plane: Solid ground plane under LVDS traces\n- Via minimization: Use layer transitions sparingly\n- Impedance control: 100 ohms differential ±10%\n\n### Cable Specifications\n- Micro-coaxial cable (e.g., I-PEX CABLINE)\n- Impedance: 100 ohms differential\n- Length: \u003C30cm typical\n- Shielding: Aluminum-mylar wrap + drain wire\n- Connectors: High-speed mating (>1 Gbps rated)\n\n## Deliverables\n\n- LVDS link design specification\n- PCB layout guidelines and stackup\n- SerDes configuration code\n- Signal integrity simulation results\n- Eye diagram test reports\n- EMI test results\n- Integration test specifications\n\n## Common Issues and Solutions\n\n### Poor Eye Diagram Quality\n- Check PCB trace impedance (should be 100Ω ±10%)\n- Verify length matching between differential pairs\n- Reduce via count and stubs\n- Check termination resistors (100Ω, 1%)\n\n### Clock\u002FData Lock Failures\n- Verify PLL lock at transmitter\n- Check for cable discontinuities\n- Ensure common-mode voltage within spec\n- Validate spread spectrum settings match\n\n### High Bit Error Rate\n- Improve cable shielding\u002Fgrounding\n- Adjust receiver equalization\n- Reduce crosstalk between lanes\n- Check for power supply noise\n\n### EMI Emissions Failures\n- Add common-mode choke on cable\n- Enable spread spectrum clocking\n- Improve PCB ground plane integrity\n- Use shielded cables with proper grounding\n\n## MOST Protocol\n\n## Core Competencies\n\nExpert in MOST protocol for high-bandwidth multimedia automotive networks.\n\n### Physical Layer Options\n- MOST150: 150 Mbps over optical fiber or UTP\n- MOST25\u002F50: Legacy 25\u002F50 Mbps variants\n- Ring topology with star topology support\n- Optical (POF) or electrical (UTP Cat5) media\n- Maximum 64 devices per ring\n\n### Protocol Stack Architecture\n```\nApplication Layer\n------------------\nFunction Blocks (MOST High Protocol)\n------------------\nTransport Layer (MHP\u002FMEP\u002FMAP)\n------------------\nNetwork Layer (Message Router)\n------------------\nData Link Layer (MOST Network Services)\n------------------\nPhysical Layer (MOST150 Transceiver)\n```\n\n### Channel Types\n- Synchronous: Streaming data (audio\u002Fvideo) - isochronous\n- Asynchronous: Packet data (control messages)\n- Control: Network management and addressing\n- Ethernet: IP packet encapsulation (MOST150 only)\n\n### Addressing Scheme\n- Physical Address: 16-bit node position on ring\n- Logical Address: Function-based addressing\n- Group Address: Multicast to multiple nodes\n- Broadcast Address: All nodes on network\n\n### Network Topology\n```\nHead Unit (Master) --> Amplifier --> Display\n      ^                                  |\n      |                                  v\n  USB Hub \u003C-- Rear Seat Controller \u003C-- Camera\n```\n\n## Design Approach\n\n1. Network Planning\n   - Define device roles (master, slave, source, sink)\n   - Calculate bandwidth allocation\n   - Plan ring topology and bypass options\n   - Design function catalog\n\n2. Synchronous Channel Allocation\n   - Audio streaming (stereo\u002Fmultichannel)\n   - Video channels (camera feeds)\n   - Clock synchronization\n   - Bandwidth reservation\n\n3. Function Block Implementation\n   - Define MOST Function Catalog (XML)\n   - Implement function interfaces\n   - Register with network master\n   - Handle events and properties\n\n4. Validation and Testing\n   - Ring integrity verification\n   - Bandwidth utilization analysis\n   - Timing and synchronization tests\n   - Fault recovery testing\n\n## Implementation Examples\n\n### Network Services Layer\n```c\n\u002F\u002F MOST network initialization\ntypedef struct {\n    uint16_t nodeAddress;\n    uint8_t  deviceRole;      \u002F\u002F Master\u002FSlave\n    uint16_t syncBandwidth;   \u002F\u002F Bytes per frame\n    uint16_t asyncBandwidth;  \u002F\u002F Bytes per frame\n} MOST_NetworkConfig_t;\n\nvoid MOST_Init(const MOST_NetworkConfig_t* config) {\n    \u002F\u002F Initialize INIC (Intelligent Network Interface Controller)\n    MOST_INIC_Init();\n\n    \u002F\u002F Configure network parameters\n    MOST_SetNodeAddress(config->nodeAddress);\n    MOST_SetDeviceRole(config->deviceRole);\n\n    \u002F\u002F Allocate bandwidth\n    MOST_AllocateSyncBandwidth(config->syncBandwidth);\n    MOST_AllocateAsyncBandwidth(config->asyncBandwidth);\n\n    \u002F\u002F Start network services\n    MOST_NetworkStartup();\n}\n```\n\n### Synchronous Audio Streaming\n```c\n\u002F\u002F Configure synchronous connection for audio\ntypedef struct {\n    uint16_t sourceAddress;\n    uint16_t sinkAddress;\n    uint16_t connectionLabel;\n    uint8_t  channelCount;    \u002F\u002F Stereo = 2, 5.1 = 6\n    uint16_t sampleRate;      \u002F\u002F 44.1kHz, 48kHz\n    uint8_t  bitDepth;        \u002F\u002F 16, 24 bits\n} MOST_SyncConnection_t;\n\nMOST_Status_t MOST_CreateAudioStream(\n    const MOST_SyncConnection_t* conn\n) {\n    \u002F\u002F Calculate required bandwidth\n    \u002F\u002F BW = channels * (sampleRate \u002F 48kHz) * (bitDepth \u002F 8)\n    uint16_t bandwidth = conn->channelCount *\n                        (conn->sampleRate \u002F 48000) *\n                        (conn->bitDepth \u002F 8);\n\n    \u002F\u002F Allocate synchronous channel\n    uint16_t channelId = MOST_AllocateSyncChannel(\n        conn->sourceAddress,\n        conn->sinkAddress,\n        bandwidth\n    );\n\n    \u002F\u002F Configure audio parameters\n    MOST_ConfigureAudioStream(\n        channelId,\n        conn->channelCount,\n        conn->sampleRate,\n        conn->bitDepth\n    );\n\n    \u002F\u002F Start streaming\n    return MOST_StartSyncConnection(channelId);\n}\n```\n\n### Function Block Interface\n```c\n\u002F\u002F MOST Function Block for audio amplifier\ntypedef struct {\n    uint8_t  volume;          \u002F\u002F 0-100\n    int8_t   balance;         \u002F\u002F -50 to +50\n    int8_t   fader;           \u002F\u002F -50 to +50\n    uint8_t  bass;            \u002F\u002F 0-100\n    uint8_t  treble;          \u002F\u002F 0-100\n    bool     mute;\n} AudioAmp_FBlock_t;\n\n\u002F\u002F Function IDs\n#define FBLOCK_AUDIO_AMP    0x22\n#define FUNC_SET_VOLUME     0x100\n#define FUNC_SET_BALANCE    0x101\n#define FUNC_SET_MUTE       0x102\n\n\u002F\u002F Handle function block message\nvoid AudioAmp_ProcessMessage(\n    uint16_t functionId,\n    uint8_t* data,\n    uint16_t length\n) {\n    switch (functionId) {\n        case FUNC_SET_VOLUME:\n            if (length >= 1) {\n                audioAmp.volume = data[0];\n                DSP_SetVolume(audioAmp.volume);\n                AudioAmp_SendStatus(FUNC_SET_VOLUME, STATUS_OK);\n            }\n            break;\n\n        case FUNC_SET_BALANCE:\n            if (length >= 1) {\n                audioAmp.balance = (int8_t)data[0];\n                DSP_SetBalance(audioAmp.balance);\n                AudioAmp_SendStatus(FUNC_SET_BALANCE, STATUS_OK);\n            }\n            break;\n\n        case FUNC_SET_MUTE:\n            if (length >= 1) {\n                audioAmp.mute = data[0];\n                DSP_SetMute(audioAmp.mute);\n                AudioAmp_SendStatus(FUNC_SET_MUTE, STATUS_OK);\n            }\n            break;\n    }\n}\n```\n\n### Asynchronous Message Handling\n```c\n\u002F\u002F Send control message\ntypedef struct {\n    uint16_t targetAddress;\n    uint16_t functionBlockId;\n    uint16_t functionId;\n    uint8_t  opType;          \u002F\u002F Set\u002FGet\u002FStatus\u002FError\n    uint8_t  data[MAX_PAYLOAD];\n    uint16_t dataLength;\n} MOST_ControlMessage_t;\n\nMOST_Status_t MOST_SendControlMessage(\n    const MOST_ControlMessage_t* msg\n) {\n    \u002F\u002F Build MOST control message\n    uint8_t msgBuffer[256];\n    uint16_t idx = 0;\n\n    \u002F\u002F Addressing\n    msgBuffer[idx++] = (msg->targetAddress >> 8) & 0xFF;\n    msgBuffer[idx++] = msg->targetAddress & 0xFF;\n\n    \u002F\u002F Function Block and Instance\n    msgBuffer[idx++] = (msg->functionBlockId >> 8) & 0xFF;\n    msgBuffer[idx++] = msg->functionBlockId & 0xFF;\n\n    \u002F\u002F Function ID\n    msgBuffer[idx++] = (msg->functionId >> 8) & 0xFF;\n    msgBuffer[idx++] = (msg->functionId >> 4) & 0xFF;\n    msgBuffer[idx++] = (msg->functionId & 0x0F) | (msg->opType \u003C\u003C 4);\n\n    \u002F\u002F Payload\n    memcpy(&msgBuffer[idx], msg->data, msg->dataLength);\n    idx += msg->dataLength;\n\n    \u002F\u002F Send via asynchronous channel\n    return MOST_TransmitAsync(msgBuffer, idx);\n}\n```\n\n### Network Management\n```c\n\u002F\u002F MOST network master responsibilities\nvoid MOST_MasterTasks(void) {\n    static uint32_t lastCheck = 0;\n    uint32_t currentTime = GetTickCount();\n\n    \u002F\u002F Periodic tasks (every 100ms)\n    if (currentTime - lastCheck >= 100) {\n        \u002F\u002F Check ring stability\n        if (!MOST_IsRingLocked()) {\n            MOST_ReconfigureRing();\n        }\n\n        \u002F\u002F Monitor bandwidth utilization\n        uint16_t syncUsage = MOST_GetSyncBandwidthUsage();\n        uint16_t asyncUsage = MOST_GetAsyncBandwidthUsage();\n\n        if (syncUsage > 90) {\n            LogWarning(\"Sync bandwidth near capacity\");\n        }\n\n        \u002F\u002F Update network topology\n        MOST_UpdateNodeList();\n\n        lastCheck = currentTime;\n    }\n}\n```\n\n## Use Case: Premium Infotainment System\n\n### Network Components\n```\n[Head Unit - Master]\n  |\n  +-- [Amplifier] (8-channel audio sink)\n  +-- [Front Display] (video + control)\n  +-- [Rear Display 1] (video + control)\n  +-- [Rear Display 2] (video + control)\n  +-- [Surround View Camera Hub] (4x video sources)\n  +-- [Navigation ECU] (data + control)\n  +-- [USB Media Hub]\n```\n\n### Bandwidth Allocation (MOST150)\n- Synchronous (Audio):\n  - 8ch x 48kHz x 24-bit = 1.152 Mbps\n- Synchronous (Video):\n  - 4x cameras 720p30 H.264 = ~16 Mbps\n  - 2x rear displays 1080p60 = ~20 Mbps\n- Asynchronous (Control): ~5 Mbps\n- Ethernet (Navigation): ~10 Mbps\n- **Total**: ~52 Mbps (34% utilization)\n\n### Function Catalog Example\n```xml\n\u003CFunctionCatalog>\n  \u003CDevice Name=\"Amplifier\" Address=\"0x0101\">\n    \u003CFunctionBlock ID=\"0x22\" Name=\"AudioAmplifier\">\n      \u003CFunction ID=\"0x100\" Name=\"SetVolume\">\n        \u003CParameter Name=\"Volume\" Type=\"uint8\" Range=\"0-100\"\u002F>\n      \u003C\u002FFunction>\n      \u003CFunction ID=\"0x101\" Name=\"SetBalance\">\n        \u003CParameter Name=\"Balance\" Type=\"int8\" Range=\"-50,50\"\u002F>\n      \u003C\u002FFunction>\n      \u003CProperty ID=\"0x200\" Name=\"CurrentVolume\" Type=\"uint8\"\u002F>\n      \u003CProperty ID=\"0x201\" Name=\"ChannelStatus\" Type=\"bitfield\"\u002F>\n    \u003C\u002FFunctionBlock>\n  \u003C\u002FDevice>\n\u003C\u002FFunctionCatalog>\n```\n\n## Deliverables\n\n- MOST network design document\n- Function catalog (XML)\n- Bandwidth allocation spreadsheet\n- Node configuration files\n- Driver\u002Fmiddleware implementation\n- Streaming protocol handlers\n- Test specifications\n- Timing analysis report\n\n## Common Issues and Solutions\n\n### Ring Instability\n- Check optical fiber quality and connectors\n- Verify bypass activation in case of node failure\n- Monitor light power levels\n- Ensure proper grounding for electrical MOST\n\n### Synchronous Streaming Glitches\n- Verify clock synchronization\n- Check bandwidth oversubscription\n- Monitor buffer underruns\u002Foverruns\n- Validate sample rate conversion\n\n### Control Message Timeouts\n- Check asynchronous channel congestion\n- Verify message routing tables\n- Monitor retry mechanisms\n- Validate function block registration\n\n### Audio Quality Issues\n- Check for clock drift between source\u002Fsink\n- Verify bit depth and sample rate matching\n- Monitor jitter on synchronous channel\n- Validate DSP configuration\n\n## PSI5 Protocol\n\n## Core Competencies\n\nExpert in PSI5 protocol for safety-critical sensor communication in automotive applications.\n\n### Protocol Characteristics\n- Bidirectional communication over 2-wire interface\n- Current-mode signaling (more robust than voltage)\n- Sensor powered via same 2-wire interface\n- Synchronous data transmission (time-slot based)\n- Built-in sensor diagnostics and monitoring\n- Designed for ASIL-D safety applications\n\n### Physical Layer\n- 2-wire interface: Power\u002FData+ and Ground\u002FData-\n- Voltage: 8-18V (nominal 12V)\n- Current mode: 5-13 mA for logic levels\n- Data rate: 125 kbps or 189 kbps\n- Up to 3 sensors per bus\n- Cable length: Up to 10 meters\n\n### Communication Modes\n- **Mode 1**: Asynchronous sensor data (continuous streaming)\n- **Mode 2**: Synchronous time-slot based (typical for airbag)\n- **Mode 3**: Bidirectional with ECU command capability\n\n### PSI5 Frame Structure (Mode 2)\n```\nSync Pulse (from ECU) triggers sensor transmission\n  |\n  v\n|\u003C-------- Time Slot 1 ------->|\u003C-------- Time Slot 2 ------->|\n| Sensor 1 Data | Sensor 2 Data | Sensor 3 Data | ...         |\n| Start | Payload | CRC | Stop  | Start | Payload | CRC | Stop |\n```\n\n### Data Encoding\n- Manchester encoding for clock recovery\n- 10-bit or 16-bit data frames\n- 2-bit or 3-bit CRC\n- Start and stop bits for frame synchronization\n\n## Design Approach\n\n1. Network Planning\n   - Define sensor types and count\n   - Select PSI5 mode (1, 2, or 3)\n   - Calculate time slots and bandwidth\n   - Plan power budget\n\n2. ECU Interface Implementation\n   - Configure PSI5 transceiver\n   - Generate sync pulses\n   - Implement time-slot management\n   - Decode Manchester-encoded data\n\n3. Safety Mechanisms\n   - CRC verification on every frame\n   - Timeout monitoring per sensor\n   - Plausibility checks on sensor data\n   - Diagnostic counter management\n\n4. Validation and Testing\n   - Frame timing verification\n   - Fault injection testing\n   - Power supply variation testing\n   - EMC immunity testing\n\n## Implementation Examples\n\n### PSI5 ECU Interface Initialization\n```c\n\u002F\u002F PSI5 configuration\ntypedef struct {\n    uint8_t mode;              \u002F\u002F PSI5 mode (1, 2, or 3)\n    uint32_t dataRate;         \u002F\u002F 125000 or 189000 bps\n    uint8_t sensorCount;       \u002F\u002F Number of sensors (1-3)\n    uint16_t syncPeriodUs;     \u002F\u002F Sync pulse period (μs)\n    uint16_t timeSlotUs;       \u002F\u002F Time slot duration (μs)\n    bool diagnosticEnable;     \u002F\u002F Enable sensor diagnostics\n} PSI5_Config_t;\n\nvoid PSI5_Init(const PSI5_Config_t* config) {\n    \u002F\u002F Initialize PSI5 transceiver\n    PSI5_TransceiverInit();\n\n    \u002F\u002F Configure operating mode\n    PSI5_SetMode(config->mode);\n\n    \u002F\u002F Set data rate\n    PSI5_SetDataRate(config->dataRate);\n\n    \u002F\u002F Configure sync pulse generation\n    PSI5_ConfigureSyncPulse(config->syncPeriodUs);\n\n    \u002F\u002F Configure time slots for Mode 2\n    if (config->mode == PSI5_MODE2) {\n        for (uint8_t i = 0; i \u003C config->sensorCount; i++) {\n            PSI5_ConfigureTimeSlot(\n                i,\n                i * config->timeSlotUs,\n                config->timeSlotUs\n            );\n        }\n    }\n\n    \u002F\u002F Enable receiver\n    PSI5_EnableReceiver();\n\n    \u002F\u002F Start sync pulse generation\n    PSI5_StartSyncPulse();\n}\n```\n\n### Sync Pulse Generation (Mode 2)\n```c\n\u002F\u002F Generate sync pulse to trigger sensor transmissions\nvoid PSI5_GenerateSyncPulse(void) {\n    \u002F\u002F Sync pulse characteristics:\n    \u002F\u002F - Current drop from 7mA to 2mA\n    \u002F\u002F - Duration: ~10 μs\n    \u002F\u002F - Triggers all sensors to transmit\n\n    \u002F\u002F Set low current (sync pulse start)\n    PSI5_SetBusCurrent(PSI5_CURRENT_SYNC_LOW);\n\n    \u002F\u002F Sync pulse duration (10 μs typical)\n    DelayUs(10);\n\n    \u002F\u002F Return to normal current\n    PSI5_SetBusCurrent(PSI5_CURRENT_NORMAL);\n\n    \u002F\u002F Sensors will now transmit in their time slots\n    PSI5_StartReception();\n}\n```\n\n### Manchester Decoder\n```c\n\u002F\u002F Manchester decoder for PSI5 data\ntypedef struct {\n    uint8_t state;             \u002F\u002F Decoder state\n    uint32_t bitStream;        \u002F\u002F Accumulated bits\n    uint8_t bitCount;          \u002F\u002F Bits decoded\n    uint32_t lastEdgeTime;     \u002F\u002F Timestamp of last edge\n} Manchester_Decoder_t;\n\nstatic Manchester_Decoder_t decoder = {0};\n\nvoid PSI5_ProcessEdge(bool rising) {\n    uint32_t currentTime = GetMicroseconds();\n    uint32_t edgeDelta = currentTime - decoder.lastEdgeTime;\n\n    \u002F\u002F Bit period = 1 \u002F dataRate\n    \u002F\u002F For 125 kbps: 8 μs per bit\n    uint32_t bitPeriod = 1000000 \u002F psi5Config.dataRate;\n    uint32_t halfBit = bitPeriod \u002F 2;\n\n    \u002F\u002F Manchester decoding:\n    \u002F\u002F Rising edge in middle of bit period = '1'\n    \u002F\u002F Falling edge in middle of bit period = '0'\n\n    if (edgeDelta > halfBit - 1 && edgeDelta \u003C halfBit + 1) {\n        \u002F\u002F Edge at half-bit time (mid-bit transition)\n        decoder.bitStream \u003C\u003C= 1;\n\n        if (rising) {\n            decoder.bitStream |= 1;  \u002F\u002F Rising = logic '1'\n        }\n        \u002F\u002F Falling = logic '0' (already shifted in 0)\n\n        decoder.bitCount++;\n\n        \u002F\u002F Complete frame? (10 or 16 bits + start\u002Fstop)\n        if (decoder.bitCount >= 12) {\n            PSI5_ProcessFrame(decoder.bitStream, decoder.bitCount);\n            decoder.bitCount = 0;\n            decoder.bitStream = 0;\n        }\n    }\n\n    decoder.lastEdgeTime = currentTime;\n}\n```\n\n### Frame Decoding and CRC Verification\n```c\n\u002F\u002F PSI5 data frame structure\ntypedef struct {\n    bool valid;\n    uint8_t sensorId;          \u002F\u002F Which sensor (0-2)\n    uint16_t data;             \u002F\u002F 10 or 16 bits\n    uint8_t crc;               \u002F\u002F 2 or 3 bits\n    bool crcValid;\n    uint8_t errorCode;         \u002F\u002F Sensor diagnostic code\n} PSI5_Frame_t;\n\nvoid PSI5_ProcessFrame(uint32_t rawFrame, uint8_t bitCount) {\n    PSI5_Frame_t frame = {0};\n\n    \u002F\u002F Extract start bit\n    if (!(rawFrame & (1 \u003C\u003C (bitCount - 1)))) {\n        LogError(\"PSI5 missing start bit\");\n        return;\n    }\n\n    \u002F\u002F Extract data (10 or 16 bits)\n    uint8_t dataLen = (bitCount == 12) ? 10 : 16;\n    frame.data = (rawFrame >> 3) & ((1 \u003C\u003C dataLen) - 1);\n\n    \u002F\u002F Extract CRC (2 or 3 bits)\n    uint8_t crcLen = (bitCount == 12) ? 2 : 3;\n    frame.crc = (rawFrame >> 1) & ((1 \u003C\u003C crcLen) - 1);\n\n    \u002F\u002F Extract stop bit\n    if (rawFrame & 0x01) {\n        LogError(\"PSI5 missing stop bit\");\n        return;\n    }\n\n    \u002F\u002F Verify CRC\n    frame.crcValid = PSI5_VerifyCRC(frame.data, dataLen, frame.crc);\n\n    if (frame.crcValid) {\n        frame.valid = true;\n\n        \u002F\u002F Determine which sensor sent this frame (by time slot)\n        frame.sensorId = PSI5_IdentifySensor();\n\n        \u002F\u002F Process sensor data\n        PSI5_ProcessSensorData(&frame);\n    } else {\n        LogWarning(\"PSI5 CRC error\");\n        PSI5_IncrementErrorCounter(frame.sensorId);\n    }\n}\n\n\u002F\u002F PSI5 CRC calculation (2-bit or 3-bit)\nbool PSI5_VerifyCRC(uint16_t data, uint8_t dataLen, uint8_t receivedCRC) {\n    uint8_t calculatedCRC;\n\n    if (dataLen == 10) {\n        \u002F\u002F 2-bit CRC: XOR of bit pairs\n        calculatedCRC = 0;\n        for (uint8_t i = 0; i \u003C 10; i += 2) {\n            calculatedCRC ^= ((data >> i) & 0x03);\n        }\n        calculatedCRC &= 0x03;\n    } else {\n        \u002F\u002F 3-bit CRC polynomial: x^3 + x + 1\n        calculatedCRC = 0;\n        for (int8_t i = dataLen - 1; i >= 0; i--) {\n            uint8_t bit = (data >> i) & 0x01;\n            uint8_t msb = (calculatedCRC >> 2) & 0x01;\n\n            calculatedCRC = ((calculatedCRC \u003C\u003C 1) | bit) & 0x07;\n\n            if (msb) {\n                calculatedCRC ^= 0x03;  \u002F\u002F Polynomial x + 1\n            }\n        }\n    }\n\n    return (calculatedCRC == receivedCRC);\n}\n```\n\n### Airbag Sensor Data Processing\n```c\n\u002F\u002F Airbag sensor specific processing\ntypedef struct {\n    int16_t acceleration_mg;   \u002F\u002F Acceleration in milli-g\n    uint8_t temperature;       \u002F\u002F Temperature in °C\n    uint8_t statusFlags;       \u002F\u002F Diagnostic status\n    bool sensorOK;\n} Airbag_SensorData_t;\n\nvoid PSI5_ProcessAirbagSensor(const PSI5_Frame_t* frame) {\n    Airbag_SensorData_t sensorData = {0};\n\n    \u002F\u002F 16-bit data format for airbag sensor:\n    \u002F\u002F [15:14] - Status flags (2 bits)\n    \u002F\u002F [13:2]  - Acceleration data (12 bits, signed)\n    \u002F\u002F [1:0]   - Temperature (2 MSBs)\n\n    \u002F\u002F Extract status flags\n    sensorData.statusFlags = (frame->data >> 14) & 0x03;\n\n    \u002F\u002F Extract acceleration (12-bit signed)\n    int16_t rawAccel = (frame->data >> 2) & 0xFFF;\n\n    \u002F\u002F Convert to signed (two's complement)\n    if (rawAccel & 0x800) {\n        rawAccel |= 0xF000;  \u002F\u002F Sign extend\n    }\n\n    \u002F\u002F Convert to milli-g (range: -100g to +100g)\n    sensorData.acceleration_mg = (rawAccel * 200000) \u002F 4096;\n\n    \u002F\u002F Extract temperature (full value via slow channel)\n    sensorData.temperature = (frame->data & 0x03) \u003C\u003C 6;\n\n    \u002F\u002F Check sensor health\n    sensorData.sensorOK = (sensorData.statusFlags == 0);\n\n    \u002F\u002F Trigger airbag algorithm\n    if (!sensorData.sensorOK) {\n        LogError(\"Airbag sensor %d fault: 0x%02X\",\n                 frame->sensorId, sensorData.statusFlags);\n    }\n\n    Airbag_ProcessAcceleration(\n        frame->sensorId,\n        sensorData.acceleration_mg\n    );\n}\n```\n\n### Sensor Power Management\n```c\n\u002F\u002F PSI5 provides power to sensors via same 2-wire interface\ntypedef struct {\n    uint16_t voltageSupply_mV; \u002F\u002F 8000-18000 mV\n    uint16_t currentDraw_mA;   \u002F\u002F Per sensor\n    uint8_t sensorCount;\n    uint16_t totalPower_mW;\n} PSI5_PowerBudget_t;\n\nbool PSI5_CheckPowerBudget(PSI5_PowerBudget_t* budget) {\n    \u002F\u002F Calculate total current\n    uint16_t totalCurrent = budget->currentDraw_mA * budget->sensorCount;\n\n    \u002F\u002F Add overhead for communication\n    totalCurrent += 5;  \u002F\u002F 5mA overhead\n\n    \u002F\u002F Calculate total power\n    budget->totalPower_mW =\n        (budget->voltageSupply_mV * totalCurrent) \u002F 1000;\n\n    \u002F\u002F Check against ECU capability (typically 200mW per channel)\n    if (budget->totalPower_mW > 200) {\n        LogError(\"PSI5 power budget exceeded: %d mW\",\n                 budget->totalPower_mW);\n        return false;\n    }\n\n    return true;\n}\n```\n\n### Diagnostics and Error Handling\n```c\n\u002F\u002F PSI5 sensor diagnostics\ntypedef struct {\n    uint32_t frameCount;       \u002F\u002F Total frames received\n    uint32_t crcErrors;        \u002F\u002F CRC failures\n    uint32_t timeoutErrors;    \u002F\u002F Missing frames\n    uint32_t plausibilityErrors;\n    float errorRate;\n    bool sensorConnected;\n} PSI5_SensorDiag_t;\n\nstatic PSI5_SensorDiag_t sensorDiag[3] = {0};\n\nvoid PSI5_MonitorSensor(uint8_t sensorId) {\n    PSI5_SensorDiag_t* diag = &sensorDiag[sensorId];\n\n    \u002F\u002F Check for timeout (no frame in last 10ms)\n    uint32_t timeSinceFrame = GetMicroseconds() - lastFrameTime[sensorId];\n\n    if (timeSinceFrame > 10000) {\n        diag->timeoutErrors++;\n        diag->sensorConnected = false;\n        LogError(\"PSI5 sensor %d timeout\", sensorId);\n    } else {\n        diag->sensorConnected = true;\n    }\n\n    \u002F\u002F Calculate error rate\n    if (diag->frameCount > 0) {\n        diag->errorRate =\n            (float)(diag->crcErrors + diag->plausibilityErrors) \u002F\n            (float)diag->frameCount;\n    }\n\n    \u002F\u002F Report diagnostics to safety monitor\n    if (diag->errorRate > 0.01) {  \u002F\u002F 1% threshold\n        Airbag_ReportSensorFault(\n            sensorId,\n            AIRBAG_FAULT_HIGH_ERROR_RATE\n        );\n    }\n\n    if (!diag->sensorConnected) {\n        Airbag_ReportSensorFault(\n            sensorId,\n            AIRBAG_FAULT_SENSOR_DISCONNECTED\n        );\n    }\n}\n```\n\n## Use Case: Multi-Sensor Airbag System\n\n### System Architecture\n```\nAirbag ECU (PSI5 Master)\n  |\n  +-- Front Left Sensor (Acceleration + Pressure)\n  +-- Front Right Sensor (Acceleration + Pressure)\n  +-- Side Impact Sensor (Acceleration)\n```\n\n### Configuration\n- Mode: PSI5 Mode 2 (synchronous time slots)\n- Data rate: 189 kbps\n- Sync period: 1 ms (1000 Hz update rate)\n- Time slot: 250 μs per sensor\n- Frame format: 16-bit data + 3-bit CRC\n\n### Time Slot Allocation\n| Time (μs) | Sensor       | Data Content                    |\n|-----------|--------------|----------------------------------|\n| 0-10      | Sync Pulse   | Triggers all sensors            |\n| 10-260    | Sensor 1     | Front left acceleration\u002Fpressure|\n| 260-510   | Sensor 2     | Front right accel\u002Fpressure      |\n| 510-760   | Sensor 3     | Side impact acceleration        |\n| 760-1000  | Idle         | Processing time                 |\n\n### Safety Requirements (ASIL-D)\n- CRC verification on every frame\n- Timeout detection (\u003C2ms)\n- Dual-sensor voting for critical decisions\n- Continuous self-test of communication\n- Diagnostic counters reported to safety manager\n\n## Deliverables\n\n- PSI5 network design specification\n- ECU interface implementation (C code)\n- Sensor calibration data\n- Safety analysis (FMEA)\n- Integration test specifications\n- Timing verification report\n- EMC test results\n\n## Common Issues and Solutions\n\n### Frame Synchronization Loss\n- Verify sync pulse timing and amplitude\n- Check current mode signaling levels\n- Ensure proper Manchester encoding\n- Validate time slot configuration\n\n### CRC Errors\n- Check for EMI on sensor wiring\n- Verify power supply stability\n- Improve cable shielding\u002Frouting\n- Validate CRC algorithm implementation\n\n### Sensor Timeout\n- Check sensor power supply voltage\n- Verify 2-wire connection integrity\n- Monitor current consumption\n- Test sensor at temperature extremes\n\n### Data Plausibility Issues\n- Validate sensor calibration\n- Check for mechanical mounting issues\n- Verify sign bit interpretation\n- Compare with other sensors (voting)\n\n## SENT Protocol\n\n## Core Competencies\n\nExpert in SENT protocol for cost-effective digital sensor communication.\n\n### Protocol Characteristics\n- Single-wire unidirectional communication (sensor to ECU)\n- No clock signal required (self-clocking)\n- Built-in CRC for error detection\n- Support for slow channel (configuration\u002Fdiagnostics)\n- Low electromagnetic emissions\n- Typical tick time: 3 μs (333 kHz)\n\n### Physical Layer\n- Voltage levels: 0V (low) \u002F 5V (high)\n- Current mode: 0-20 mA or voltage mode\n- Single wire + ground reference\n- Operating temperature: -40°C to +150°C\n- Low power consumption: \u003C10 mW typical\n\n### Frame Structure\n```\n|\u003C----------- SENT Frame ------------>|\n| Sync | Status | Data1-6 | CRC | Pause |\n| 56T  | 4b+4b  | 6x12b   | 4b  | ≥12T  |\n```\n\n- Sync pulse: 56 nominal tick periods (±25%)\n- Status nibble: 4 bits (sensor status\u002Fdiagnostic)\n- Data nibbles: Up to 6 nibbles (12-24 bits total data)\n- CRC: 4-bit checksum\n- Pause period: Variable (min 12 ticks)\n\n### SENT Frame Types\n- **Fast Channel**: Main sensor data (every frame)\n- **Slow Channel**: Configuration\u002Fdiagnostic data (transmitted over multiple frames)\n- **Short Serial Message (SSM)**: Enhanced diagnostic data\n\n### Tick Encoding\n- Each nibble encoded as pulse width (12-27 ticks)\n- Nibble value 0: 12 ticks\n- Nibble value 1: 13 ticks\n- ...\n- Nibble value 15: 27 ticks\n\n## Design Approach\n\n1. Sensor Integration\n   - Select appropriate SENT-capable sensor\n   - Configure tick frequency\n   - Define data format (12\u002F16\u002F24 bit)\n   - Plan slow channel usage\n\n2. ECU Receiver Implementation\n   - Configure input capture timer\n   - Implement edge detection\n   - Decode nibbles from pulse widths\n   - Verify CRC and status\n\n3. Data Processing\n   - Apply sensor calibration\n   - Handle error conditions\n   - Monitor diagnostic data\n   - Implement plausibility checks\n\n4. Validation and Testing\n   - Verify tick timing accuracy\n   - Inject bit errors for CRC validation\n   - Test temperature extremes\n   - Validate EMC immunity\n\n## Implementation Examples\n\n### SENT Receiver Initialization\n```c\n\u002F\u002F SENT receiver configuration\ntypedef struct {\n    uint32_t tickTimeNs;       \u002F\u002F Nominal tick time (ns)\n    uint8_t tickTolerance;     \u002F\u002F Tolerance percentage (±25%)\n    uint8_t dataNibbles;       \u002F\u002F Number of data nibbles (1-6)\n    bool slowChannelEnable;    \u002F\u002F Enable slow channel decode\n    bool pauseValidation;      \u002F\u002F Validate pause pulse\n} SENT_Config_t;\n\nvoid SENT_Init(const SENT_Config_t* config) {\n    \u002F\u002F Configure input capture timer\n    \u002F\u002F Timer resolution should be \u003C100ns for accurate tick measurement\n    TIM_SetPrescaler(config->tickTimeNs \u002F 100);  \u002F\u002F 100ns resolution\n\n    \u002F\u002F Configure edge detection (falling edge)\n    TIM_SetCaptureEdge(TIM_CAPTURE_FALLING);\n\n    \u002F\u002F Enable input capture interrupt\n    TIM_EnableCaptureInterrupt();\n\n    \u002F\u002F Store configuration\n    sentConfig = *config;\n\n    \u002F\u002F Reset decoder state\n    SENT_ResetDecoder();\n}\n```\n\n### SENT Frame Decoding\n```c\n\u002F\u002F SENT frame structure\ntypedef struct {\n    bool valid;\n    uint8_t status;            \u002F\u002F Status nibble\n    uint32_t data;             \u002F\u002F Combined data nibbles\n    uint8_t crc;\n    bool crcValid;\n    uint16_t errorCount;\n} SENT_Frame_t;\n\n\u002F\u002F State machine for SENT decoding\ntypedef enum {\n    SENT_STATE_WAIT_SYNC,\n    SENT_STATE_STATUS,\n    SENT_STATE_DATA,\n    SENT_STATE_CRC,\n    SENT_STATE_PAUSE\n} SENT_State_t;\n\nstatic SENT_State_t sentState = SENT_STATE_WAIT_SYNC;\nstatic uint32_t lastEdgeTime = 0;\nstatic uint8_t nibbleIndex = 0;\nstatic SENT_Frame_t currentFrame;\n\n\u002F\u002F Input capture interrupt handler\nvoid TIM_CaptureInterrupt(void) {\n    uint32_t currentTime = TIM_GetCaptureValue();\n    uint32_t pulseTicks = (currentTime - lastEdgeTime) \u002F sentConfig.tickTimeNs;\n    lastEdgeTime = currentTime;\n\n    switch (sentState) {\n        case SENT_STATE_WAIT_SYNC:\n            \u002F\u002F Sync pulse is 56 ticks ±25%\n            if (pulseTicks >= 42 && pulseTicks \u003C= 70) {\n                \u002F\u002F Sync detected, calibrate tick time\n                uint32_t measuredTickTime =\n                    (currentTime - lastEdgeTime) \u002F 56;\n                SENT_UpdateTickTime(measuredTickTime);\n\n                sentState = SENT_STATE_STATUS;\n                nibbleIndex = 0;\n                currentFrame.valid = false;\n                currentFrame.errorCount = 0;\n            }\n            break;\n\n        case SENT_STATE_STATUS:\n            \u002F\u002F Decode status nibble\n            currentFrame.status = SENT_DecodeNibble(pulseTicks);\n            sentState = SENT_STATE_DATA;\n            nibbleIndex = 0;\n            break;\n\n        case SENT_STATE_DATA:\n            \u002F\u002F Decode data nibbles\n            uint8_t nibble = SENT_DecodeNibble(pulseTicks);\n\n            if (nibble == 0xFF) {  \u002F\u002F Invalid nibble\n                currentFrame.errorCount++;\n                sentState = SENT_STATE_WAIT_SYNC;\n                break;\n            }\n\n            \u002F\u002F Accumulate data nibbles\n            currentFrame.data |= ((uint32_t)nibble \u003C\u003C (nibbleIndex * 4));\n            nibbleIndex++;\n\n            \u002F\u002F All data nibbles received?\n            if (nibbleIndex >= sentConfig.dataNibbles) {\n                sentState = SENT_STATE_CRC;\n            }\n            break;\n\n        case SENT_STATE_CRC:\n            \u002F\u002F Decode and verify CRC\n            currentFrame.crc = SENT_DecodeNibble(pulseTicks);\n            currentFrame.crcValid = SENT_VerifyCRC(&currentFrame);\n\n            if (currentFrame.crcValid) {\n                currentFrame.valid = true;\n                SENT_ProcessFrame(&currentFrame);\n            } else {\n                currentFrame.errorCount++;\n            }\n\n            sentState = SENT_STATE_PAUSE;\n            break;\n\n        case SENT_STATE_PAUSE:\n            \u002F\u002F Wait for pause period (≥12 ticks)\n            if (pulseTicks >= 12) {\n                sentState = SENT_STATE_WAIT_SYNC;\n            }\n            break;\n    }\n}\n\n\u002F\u002F Decode nibble from pulse width\nuint8_t SENT_DecodeNibble(uint32_t pulseTicks) {\n    \u002F\u002F Nibble value = pulseTicks - 12\n    if (pulseTicks >= 12 && pulseTicks \u003C= 27) {\n        return pulseTicks - 12;\n    }\n    return 0xFF;  \u002F\u002F Invalid\n}\n```\n\n### CRC Calculation (SAE J2716)\n```c\n\u002F\u002F SENT CRC-4 calculation (recommended checksum)\nuint8_t SENT_CalculateCRC(const SENT_Frame_t* frame) {\n    uint8_t nibbles[8];\n    nibbles[0] = frame->status & 0x0F;\n\n    \u002F\u002F Extract data nibbles\n    for (uint8_t i = 0; i \u003C sentConfig.dataNibbles; i++) {\n        nibbles[i + 1] = (frame->data >> (i * 4)) & 0x0F;\n    }\n\n    \u002F\u002F CRC-4 with seed value 5\n    uint8_t crc = 5;\n\n    for (uint8_t i = 0; i \u003C sentConfig.dataNibbles + 1; i++) {\n        crc ^= nibbles[i];\n\n        for (uint8_t bit = 0; bit \u003C 4; bit++) {\n            if (crc & 0x08) {\n                crc = ((crc \u003C\u003C 1) ^ 0x13) & 0x0F;\n            } else {\n                crc = (crc \u003C\u003C 1) & 0x0F;\n            }\n        }\n    }\n\n    return crc;\n}\n\nbool SENT_VerifyCRC(const SENT_Frame_t* frame) {\n    uint8_t calculatedCRC = SENT_CalculateCRC(frame);\n    return (calculatedCRC == frame->crc);\n}\n```\n\n### Slow Channel Decoding\n```c\n\u002F\u002F Slow channel transmitted over multiple frames\ntypedef struct {\n    uint8_t messageId;         \u002F\u002F 8-bit message identifier\n    uint16_t data;             \u002F\u002F 12-bit data value\n    bool valid;\n} SENT_SlowChannel_t;\n\nstatic uint8_t slowChannelNibbles[6];\nstatic uint8_t slowChannelIndex = 0;\n\nvoid SENT_DecodeSlowChannel(uint8_t statusNibble) {\n    \u002F\u002F Slow channel data is in status nibble bits\n    uint8_t slowNibble = (statusNibble >> 2) & 0x03;  \u002F\u002F 2 bits per frame\n\n    slowChannelNibbles[slowChannelIndex++] = slowNibble;\n\n    \u002F\u002F Complete slow channel message after 16 frames\n    if (slowChannelIndex >= 16) {\n        SENT_SlowChannel_t slowMsg;\n\n        \u002F\u002F Reconstruct 8-bit message ID\n        slowMsg.messageId = 0;\n        for (uint8_t i = 0; i \u003C 4; i++) {\n            slowMsg.messageId |= (slowChannelNibbles[i] \u003C\u003C (i * 2));\n        }\n\n        \u002F\u002F Reconstruct 12-bit data\n        slowMsg.data = 0;\n        for (uint8_t i = 0; i \u003C 6; i++) {\n            slowMsg.data |= (slowChannelNibbles[i + 4] \u003C\u003C (i * 2));\n        }\n\n        \u002F\u002F Validate slow channel CRC\n        slowMsg.valid = SENT_VerifySlowChannelCRC(&slowMsg);\n\n        if (slowMsg.valid) {\n            SENT_ProcessSlowChannel(&slowMsg);\n        }\n\n        slowChannelIndex = 0;\n    }\n}\n```\n\n### Sensor Data Conversion\n```c\n\u002F\u002F Convert raw SENT data to physical value\ntypedef struct {\n    float gain;                \u002F\u002F Scaling factor\n    float offset;              \u002F\u002F Offset value\n    uint8_t resolution;        \u002F\u002F Bits (12, 16, 24)\n    const char* unit;          \u002F\u002F Unit string\n} SENT_Calibration_t;\n\nfloat SENT_ConvertToPhysical(\n    uint32_t rawData,\n    const SENT_Calibration_t* cal\n) {\n    \u002F\u002F Calculate maximum raw value based on resolution\n    uint32_t maxRaw = (1 \u003C\u003C cal->resolution) - 1;\n\n    \u002F\u002F Linear conversion: Physical = (Raw \u002F MaxRaw) * Gain + Offset\n    float normalized = (float)rawData \u002F (float)maxRaw;\n    float physical = (normalized * cal->gain) + cal->offset;\n\n    return physical;\n}\n\n\u002F\u002F Example: Temperature sensor\nvoid SENT_ProcessTemperatureSensor(const SENT_Frame_t* frame) {\n    static const SENT_Calibration_t tempCal = {\n        .gain = 200.0,         \u002F\u002F -40°C to +160°C range\n        .offset = -40.0,\n        .resolution = 12,\n        .unit = \"°C\"\n    };\n\n    \u002F\u002F Extract 12-bit data (first 3 nibbles)\n    uint32_t rawTemp = frame->data & 0xFFF;\n\n    \u002F\u002F Convert to physical value\n    float temperature = SENT_ConvertToPhysical(rawTemp, &tempCal);\n\n    \u002F\u002F Check status nibble for sensor faults\n    if (frame->status & 0x08) {\n        LogWarning(\"Temperature sensor fault detected\");\n    }\n\n    LogInfo(\"Temperature: %.1f %s\", temperature, tempCal.unit);\n}\n```\n\n### Error Detection and Handling\n```c\n\u002F\u002F SENT error statistics\ntypedef struct {\n    uint32_t totalFrames;\n    uint32_t crcErrors;\n    uint32_t timingErrors;\n    uint32_t statusWarnings;\n    float errorRate;\n} SENT_Statistics_t;\n\nstatic SENT_Statistics_t sentStats = {0};\n\nvoid SENT_ProcessFrame(const SENT_Frame_t* frame) {\n    sentStats.totalFrames++;\n\n    \u002F\u002F Check CRC\n    if (!frame->crcValid) {\n        sentStats.crcErrors++;\n        LogWarning(\"SENT CRC error\");\n        return;\n    }\n\n    \u002F\u002F Check status nibble for sensor warnings\n    if (frame->status & 0x08) {\n        sentStats.statusWarnings++;\n        \u002F\u002F Handle specific error codes\n        switch (frame->status & 0x07) {\n            case 0x1: LogWarning(\"Sensor temperature out of range\"); break;\n            case 0x2: LogWarning(\"Sensor calibration error\"); break;\n            case 0x3: LogWarning(\"Sensor hardware fault\"); break;\n            default:  LogWarning(\"Unknown sensor status\"); break;\n        }\n    }\n\n    \u002F\u002F Calculate error rate\n    sentStats.errorRate = (float)(sentStats.crcErrors + sentStats.timingErrors) \u002F\n                         (float)sentStats.totalFrames;\n\n    \u002F\u002F Trigger diagnostic if error rate too high\n    if (sentStats.errorRate > 0.01) {  \u002F\u002F 1% threshold\n        LogError(\"SENT error rate too high: %.2f%%\", sentStats.errorRate * 100);\n    }\n}\n```\n\n## Use Case: Throttle Position Sensor\n\n### Sensor Configuration\n- Tick frequency: 333 kHz (3 μs tick time)\n- Data format: 12-bit position (0-4095)\n- Range: 0° to 90° throttle angle\n- Update rate: 1 kHz (1000 frames\u002Fsec)\n- Slow channel: Temperature and diagnostics\n\n### Data Frame Format\n```\nStatus nibble: [Error | Reserved | SlowBit1 | SlowBit0]\nData nibbles:  [Position[11:8] | Position[7:4] | Position[3:0]]\n```\n\n### Safety Features\n- CRC-4 checksum on every frame\n- Status nibble indicates sensor health\n- Plausibility check against expected range\n- Timeout detection (missing frames)\n- Slow channel for temperature monitoring\n\n### Example Application Code\n```c\n\u002F\u002F Throttle position sensor handler\nvoid Application_ProcessThrottle(const SENT_Frame_t* frame) {\n    if (!frame->valid) return;\n\n    \u002F\u002F Extract 12-bit position\n    uint16_t rawPosition = frame->data & 0xFFF;\n\n    \u002F\u002F Convert to angle (0-90°)\n    float angle = (float)rawPosition \u002F 4095.0 * 90.0;\n\n    \u002F\u002F Plausibility check\n    if (angle > 95.0) {\n        LogError(\"Throttle position implausible: %.1f°\", angle);\n        return;\n    }\n\n    \u002F\u002F Update throttle position\n    SetThrottlePosition(angle);\n\n    \u002F\u002F Process slow channel (every 16 frames)\n    SENT_DecodeSlowChannel(frame->status);\n}\n```\n\n## Deliverables\n\n- SENT sensor selection guide\n- Receiver implementation (C code)\n- Calibration data format\n- Error handling strategy\n- Integration test specifications\n- Signal timing verification\n- EMC test results\n\n## Common Issues and Solutions\n\n### Tick Time Drift\n- Monitor sync pulse for tick calibration\n- Compensate for temperature effects\n- Verify sensor clock stability\n- Use adaptive tick time measurement\n\n### CRC Failures\n- Check for EMI\u002Fnoise on signal line\n- Verify ground connection quality\n- Add low-pass filter on input\n- Shield sensor cable if necessary\n\n### Missing Frames\n- Check sensor power supply stability\n- Verify interrupt priority and latency\n- Monitor for software blocking\n- Validate pause period handling\n\n### Incorrect Data Values\n- Verify nibble decoding algorithm\n- Check data byte order\u002Fendianness\n- Validate calibration parameters\n- Test with known sensor inputs","# Automotive Protocols\n\n8 skill files covering automotive-protocols domain.\n\n## Applicable Standards\n\n- AEC-Q100 (Automotive component qualification)\n- ANSI\u002FTIA\u002FEIA-644-A (LVDS Standard)\n- ASPICE Level 3\n- AUTOSAR 4.4\n- AUTOSAR LIN Driver\n- Automotive EMC compliance\n- BroadR-Reach specification\n- FPD-Link (Flat Panel Display Link)\n- IEEE 1722 AVTP (Audio Video Transport Protocol)\n- IEEE 802.1 AVB (Audio Video Bridging)\n- IEEE 802.1 TSN (Time-Sensitive Networking)\n- IEEE 802.3bw (100BASE-T1)\n- ISO 14230 (KWP2000 over MOST)\n- ISO 17458 (FlexRay Communications System)\n- ISO 17987 (LIN Specification)\n- ISO 26262 (Functional Safety)\n- ISO 26262 ASIL-D (Functional Safety)\n- LIN 2.2A specification\n- MIPI CSI-2 (Camera Serial Interface)\n- MOST Cooperation standard\n- MOST Specification Rev. 3.0\n- MOST150 (150 Mbps)\n- OPEN Alliance TC1 specification\n- OPEN Alliance TC8 specification\n- OpenLDI (Open LVDS Display Interface)\n- PSI5 Specification v2.3\n- SAE J2602\n- SAE J2716 (SENT Specification)\n- SOME\u002FIP (Scalable service-Oriented MiddlewarE)\n\n## Instructions\n\n## BroadR-Reach Protocol\n\n## Core Competencies\n\nExpert in BroadR-Reach physical layer for automotive Ethernet over single twisted pair.\n\n### Physical Layer Characteristics\n- Single unshielded twisted pair (UTP)\n- 100 Mbps full-duplex bidirectional\n- Cable length up to 15 meters (50 feet)\n- Voltage range: -2V to +2V differential\n- PAM3 (3-level Pulse Amplitude Modulation) encoding\n- Frequency: 33.33 MHz fundamental\n\n### Cable Requirements\n- Unshielded twisted pair (UTP)\n- AWG 24-26 gauge typical\n- Impedance: 100 ohms ±15%\n- Capacitance: \u003C60 pF\u002Fm\n- Low crosstalk for bundled cables\n- Automotive temperature range (-40°C to +125°C)\n\n### PHY Features\n- Auto-negotiation (ANEG)\n- Link partner detection\n- Cable diagnostics (TDR - Time Domain Reflectometry)\n- Sleep\u002Fwake functionality\n- EMI\u002FEMC compliance for automotive\n- Power over Data Line (PoDL) support\n\n### Connector Types\n- FAKRA coaxial connector (legacy)\n- USCAR connector\n- Rosenberger HFM connector\n- Amphenol Mini50 connector\n- Automotive-grade shielding\n\n## Design Approach\n\n1. Physical Layer Design\n   - Select appropriate cable type\n   - Plan cable routing (avoid EMI sources)\n   - Calculate maximum cable length\n   - Choose connectors and terminations\n\n2. PHY Configuration\n   - Configure auto-negotiation\n   - Set master\u002Fslave mode\n   - Enable cable diagnostics\n   - Configure sleep\u002Fwake behavior\n\n3. EMC\u002FEMI Mitigation\n   - Proper grounding strategy\n   - Common-mode choke selection\n   - Cable shielding and routing\n   - Ferrite bead placement\n\n4. Validation and Testing\n   - Eye diagram analysis\n   - TDR cable verification\n   - EMC compliance testing\n   - Temperature stress testing\n\n## Implementation Examples\n\n### PHY Initialization\n```c\n\u002F\u002F BroadR-Reach PHY configuration\ntypedef struct {\n    uint8_t phyAddress;        \u002F\u002F MDIO address (0-31)\n    bool masterMode;           \u002F\u002F Master\u002Fslave mode\n    bool autoNegEnable;        \u002F\u002F Auto-negotiation\n    bool sleepEnable;          \u002F\u002F Sleep mode support\n    uint8_t ledMode;           \u002F\u002F LED indicator config\n} BRR_PhyConfig_t;\n\nvoid BRR_InitPhy(const BRR_PhyConfig_t* config) {\n    \u002F\u002F Software reset\n    BRR_MdioWrite(config->phyAddress, PHY_BASIC_CONTROL, PHY_RESET);\n\n    \u002F\u002F Wait for reset complete\n    while (BRR_MdioRead(config->phyAddress, PHY_BASIC_CONTROL) & PHY_RESET);\n\n    \u002F\u002F Configure basic control register\n    uint16_t bcr = 0;\n    if (config->autoNegEnable) {\n        bcr |= PHY_AUTONEG_ENABLE | PHY_RESTART_AUTONEG;\n    }\n    bcr |= PHY_FULL_DUPLEX | PHY_SPEED_100M;\n\n    BRR_MdioWrite(config->phyAddress, PHY_BASIC_CONTROL, bcr);\n\n    \u002F\u002F Configure master\u002Fslave mode\n    uint16_t msCfg = BRR_MdioRead(\n        config->phyAddress,\n        PHY_MASTER_SLAVE_CONTROL\n    );\n\n    if (config->masterMode) {\n        msCfg |= PHY_MASTER_MODE;\n    } else {\n        msCfg &= ~PHY_MASTER_MODE;\n    }\n\n    BRR_MdioWrite(config->phyAddress, PHY_MASTER_SLAVE_CONTROL, msCfg);\n\n    \u002F\u002F Configure sleep mode\n    if (config->sleepEnable) {\n        uint16_t sleepReg = BRR_MdioRead(\n            config->phyAddress,\n            PHY_SLEEP_CONTROL\n        );\n        sleepReg |= PHY_SLEEP_ENABLE;\n        BRR_MdioWrite(config->phyAddress, PHY_SLEEP_CONTROL, sleepReg);\n    }\n\n    \u002F\u002F Configure LED indicators\n    BRR_MdioWrite(config->phyAddress, PHY_LED_CONTROL, config->ledMode);\n}\n```\n\n### Link Status Monitoring\n```c\n\u002F\u002F Monitor link status and cable health\ntypedef struct {\n    bool linkUp;\n    bool masterMode;\n    uint16_t linkSpeed;        \u002F\u002F Mbps\n    bool fullDuplex;\n    uint16_t cableLength;      \u002F\u002F Estimated meters\n    bool cableFault;\n} BRR_LinkStatus_t;\n\nBRR_LinkStatus_t BRR_GetLinkStatus(uint8_t phyAddress) {\n    BRR_LinkStatus_t status = {0};\n\n    \u002F\u002F Read basic status register\n    uint16_t bsr = BRR_MdioRead(phyAddress, PHY_BASIC_STATUS);\n\n    status.linkUp = (bsr & PHY_LINK_STATUS) != 0;\n\n    if (status.linkUp) {\n        \u002F\u002F Read master\u002Fslave status\n        uint16_t msStatus = BRR_MdioRead(\n            phyAddress,\n            PHY_MASTER_SLAVE_STATUS\n        );\n        status.masterMode = (msStatus & PHY_MASTER_STATUS) != 0;\n\n        \u002F\u002F Link speed is always 100 Mbps for BroadR-Reach\n        status.linkSpeed = 100;\n        status.fullDuplex = true;\n\n        \u002F\u002F Estimate cable length via TDR\n        status.cableLength = BRR_EstimateCableLength(phyAddress);\n\n        \u002F\u002F Check for cable faults\n        status.cableFault = BRR_CheckCableFault(phyAddress);\n    }\n\n    return status;\n}\n```\n\n### Cable Diagnostics (TDR)\n```c\n\u002F\u002F Time Domain Reflectometry for cable diagnostics\ntypedef enum {\n    CABLE_OK,\n    CABLE_OPEN,\n    CABLE_SHORT,\n    CABLE_CROSSTALK,\n    CABLE_IMPEDANCE_MISMATCH\n} BRR_CableFault_t;\n\nBRR_CableFault_t BRR_RunCableDiagnostics(uint8_t phyAddress) {\n    \u002F\u002F Trigger TDR test\n    uint16_t tdrCtrl = BRR_MdioRead(phyAddress, PHY_TDR_CONTROL);\n    tdrCtrl |= PHY_TDR_START;\n    BRR_MdioWrite(phyAddress, PHY_TDR_CONTROL, tdrCtrl);\n\n    \u002F\u002F Wait for completion (typically \u003C1ms)\n    uint32_t timeout = 1000;  \u002F\u002F 1ms timeout\n    while (timeout--) {\n        tdrCtrl = BRR_MdioRead(phyAddress, PHY_TDR_CONTROL);\n        if (!(tdrCtrl & PHY_TDR_START)) {\n            break;\n        }\n        DelayUs(1);\n    }\n\n    \u002F\u002F Read TDR result\n    uint16_t tdrResult = BRR_MdioRead(phyAddress, PHY_TDR_RESULT);\n\n    \u002F\u002F Parse fault type\n    uint8_t faultType = (tdrResult >> 12) & 0x0F;\n\n    switch (faultType) {\n        case 0x0: return CABLE_OK;\n        case 0x1: return CABLE_OPEN;\n        case 0x2: return CABLE_SHORT;\n        case 0x3: return CABLE_CROSSTALK;\n        case 0x4: return CABLE_IMPEDANCE_MISMATCH;\n        default:  return CABLE_OK;\n    }\n}\n\nuint16_t BRR_EstimateCableLength(uint8_t phyAddress) {\n    \u002F\u002F Read TDR distance measurement\n    uint16_t tdrDistance = BRR_MdioRead(phyAddress, PHY_TDR_DISTANCE);\n\n    \u002F\u002F Convert to meters (formula vendor-specific)\n    \u002F\u002F Typical: distance_m = (tdr_value * 0.1)\n    uint16_t lengthMeters = (tdrDistance * 10) \u002F 100;\n\n    return lengthMeters;\n}\n```\n\n### Sleep\u002FWake Functionality\n```c\n\u002F\u002F Enter sleep mode for power saving\nvoid BRR_EnterSleepMode(uint8_t phyAddress) {\n    \u002F\u002F Send sleep request\n    uint16_t sleepCtrl = BRR_MdioRead(phyAddress, PHY_SLEEP_CONTROL);\n    sleepCtrl |= PHY_SLEEP_REQUEST;\n    BRR_MdioWrite(phyAddress, PHY_SLEEP_CONTROL, sleepCtrl);\n\n    \u002F\u002F Wait for sleep acknowledge\n    uint32_t timeout = 10000;  \u002F\u002F 10ms\n    while (timeout--) {\n        sleepCtrl = BRR_MdioRead(phyAddress, PHY_SLEEP_CONTROL);\n        if (sleepCtrl & PHY_SLEEP_ACK) {\n            break;\n        }\n        DelayUs(1);\n    }\n\n    LogInfo(\"PHY entered sleep mode\");\n}\n\n\u002F\u002F Wake from sleep mode\nvoid BRR_WakeFromSleep(uint8_t phyAddress) {\n    \u002F\u002F Method 1: Send wake pulse on MDC line\n    BRR_SendWakePulse();\n\n    \u002F\u002F Method 2: Toggle PHY_WAKE pin (if available)\n    \u002F\u002F GPIO_SetPin(PHY_WAKE_PIN, HIGH);\n    \u002F\u002F DelayUs(100);\n    \u002F\u002F GPIO_SetPin(PHY_WAKE_PIN, LOW);\n\n    \u002F\u002F Wait for link to re-establish\n    uint32_t timeout = 100000;  \u002F\u002F 100ms\n    while (timeout--) {\n        uint16_t bsr = BRR_MdioRead(phyAddress, PHY_BASIC_STATUS);\n        if (bsr & PHY_LINK_STATUS) {\n            break;\n        }\n        DelayUs(1);\n    }\n\n    LogInfo(\"PHY woke from sleep mode\");\n}\n```\n\n### EMC\u002FEMI Configuration\n```c\n\u002F\u002F Configure EMI reduction features\nvoid BRR_ConfigureEMI(uint8_t phyAddress) {\n    \u002F\u002F Enable spread spectrum clocking for EMI reduction\n    uint16_t emiCtrl = BRR_MdioRead(phyAddress, PHY_EMI_CONTROL);\n\n    emiCtrl |= PHY_SSC_ENABLE;           \u002F\u002F Spread spectrum enable\n    emiCtrl |= PHY_SLEW_RATE_LIMIT;      \u002F\u002F Limit slew rate\n    emiCtrl |= PHY_COMMON_MODE_FILTER;   \u002F\u002F Enable CM filter\n\n    BRR_MdioWrite(phyAddress, PHY_EMI_CONTROL, emiCtrl);\n\n    \u002F\u002F Configure output driver strength (reduce overshoot)\n    uint16_t driverCfg = BRR_MdioRead(phyAddress, PHY_DRIVER_CONTROL);\n    driverCfg &= ~PHY_DRIVER_STRENGTH_MASK;\n    driverCfg |= PHY_DRIVER_STRENGTH_MEDIUM;  \u002F\u002F Medium strength\n    BRR_MdioWrite(phyAddress, PHY_DRIVER_CONTROL, driverCfg);\n}\n```\n\n### Power over Data Line (PoDL) Configuration\n```c\n\u002F\u002F Configure PoDL for powered devices (e.g., cameras)\ntypedef struct {\n    bool enable;\n    uint8_t powerClass;        \u002F\u002F 0-8 (IEEE 802.3bu)\n    uint16_t maxPowerMw;       \u002F\u002F Maximum power in mW\n} BRR_PoDL_Config_t;\n\nvoid BRR_ConfigurePoDL(uint8_t phyAddress, const BRR_PoDL_Config_t* cfg) {\n    if (!cfg->enable) {\n        \u002F\u002F Disable PoDL\n        BRR_MdioWrite(phyAddress, PHY_PODL_CONTROL, 0);\n        return;\n    }\n\n    \u002F\u002F Configure PoDL PSE (Power Sourcing Equipment)\n    uint16_t podlCtrl = 0;\n    podlCtrl |= PHY_PODL_ENABLE;\n    podlCtrl |= (cfg->powerClass \u003C\u003C 8) & PHY_PODL_CLASS_MASK;\n\n    BRR_MdioWrite(phyAddress, PHY_PODL_CONTROL, podlCtrl);\n\n    \u002F\u002F Set power limit\n    BRR_MdioWrite(phyAddress, PHY_PODL_POWER_LIMIT, cfg->maxPowerMw);\n\n    LogInfo(\"PoDL configured: Class %d, Max %d mW\",\n            cfg->powerClass, cfg->maxPowerMw);\n}\n```\n\n## Use Case: Surround View Camera System\n\n### Network Architecture\n```\nCentral Camera ECU (Master)\n  |\n  +-- Front Camera (PD, Slave) - 5m cable\n  +-- Rear Camera (PD, Slave) - 8m cable\n  +-- Left Camera (PD, Slave) - 12m cable\n  +-- Right Camera (PD, Slave) - 12m cable\n```\n\n### Cable Installation Guidelines\n- Route away from high-power lines (>50cm separation)\n- Avoid sharp bends (\u003C50mm radius)\n- Use cable ties every 15cm\n- Ground shielding at one point only\n- Install common-mode chokes near PHY\n\n### PHY Configuration for Cameras\n- Master mode at ECU\n- Slave mode at cameras\n- PoDL Class 3 (1-3.6W per camera)\n- Auto-negotiation enabled\n- Sleep mode for power saving when idle\n\n## Deliverables\n\n- PHY selection and configuration guide\n- Cable routing diagram\n- EMC test plan and results\n- TDR cable verification reports\n- Driver implementation (MDIO\u002FPHY)\n- Power budget analysis (PoDL)\n- Integration test specifications\n\n## Common Issues and Solutions\n\n### Link Instability\n- Check cable quality and length (\u003C15m)\n- Verify impedance matching (100 ohms)\n- Test with TDR for cable faults\n- Ensure proper master\u002Fslave configuration\n\n### EMI Emissions Failures\n- Enable spread spectrum clocking\n- Add\u002Frelocate common-mode chokes\n- Improve cable shielding and grounding\n- Reduce driver output strength\n\n### Auto-Negotiation Failures\n- Verify both PHYs support ANEG\n- Check for forced speed\u002Fduplex settings\n- Monitor MDIO communication errors\n- Validate PHY firmware version\n\n### PoDL Power Issues\n- Check cable resistance (\u003C2 ohms for AWG24)\n- Verify power class compatibility\n- Monitor voltage drop along cable\n- Ensure adequate PSE power budget\n\n## Ethernet AVB\u002FTSN Protocol\n\n## Core Competencies\n\nExpert in Automotive Ethernet with AVB\u002FTSN for deterministic, low-latency networking.\n\n### Physical Layer (100BASE-T1 \u002F 1000BASE-T1)\n- Single twisted pair (BroadR-Reach PHY)\n- 100 Mbps or 1 Gbps data rate\n- Cable length up to 15m (100BASE-T1) or 40m (1000BASE-T1)\n- Point-to-point topology (switched network)\n- PoE support for camera power\n\n### TSN Technology Stack\n- IEEE 802.1AS (Time Synchronization - gPTP)\n- IEEE 802.1Qbv (Time-Aware Shaper - TAS)\n- IEEE 802.1Qav (Credit-Based Shaper - CBS)\n- IEEE 802.1Qcc (Stream Reservation Protocol - SRP)\n- IEEE 802.1CB (Frame Replication and Elimination)\n\n### Protocol Layers\n```\nApplication (SOME\u002FIP, DoIP, AVTP)\n         |\nTransport (UDP\u002FTCP)\n         |\nNetwork (IPv4\u002FIPv6)\n         |\nData Link (AVB\u002FTSN + VLAN)\n         |\nPhysical (100BASE-T1 \u002F 1000BASE-T1)\n```\n\n### Time-Sensitive Traffic Classes\n- **Class A (CDT)**: Critical Data Traffic (e.g., ADAS sensor data)\n  - Max latency: 2ms\n  - Priority: Highest (PCP 6-7)\n- **Class B**: Audio\u002FVideo streaming\n  - Max latency: 50ms\n  - Priority: High (PCP 4-5)\n- **Best Effort**: Non-critical data\n  - No latency guarantee\n  - Priority: Normal (PCP 0-3)\n\n## Design Approach\n\n1. Network Architecture Design\n   - Define topology (star, daisy-chain, hybrid)\n   - Calculate bandwidth requirements\n   - Plan VLAN and QoS strategy\n   - Design fault tolerance (redundancy)\n\n2. TSN Configuration\n   - Configure gPTP domains\n   - Design Time-Aware Shaper schedules\n   - Allocate bandwidth per traffic class\n   - Configure stream reservation\n\n3. SOME\u002FIP Service Design\n   - Define service interfaces (FIDL)\n   - Implement service discovery\n   - Design event\u002Fmethod communication\n   - Configure serialization\n\n4. Validation and Testing\n   - Timing verification (end-to-end latency)\n   - Bandwidth utilization monitoring\n   - Fault injection testing\n   - TSN schedule validation\n\n## Implementation Examples\n\n### gPTP Time Synchronization (IEEE 802.1AS)\n```c\n\u002F\u002F Initialize gPTP for time synchronization\ntypedef struct {\n    uint8_t domainNumber;      \u002F\u002F gPTP domain (0-127)\n    uint8_t priority1;         \u002F\u002F Grandmaster priority\n    uint8_t priority2;\n    uint8_t logSyncInterval;   \u002F\u002F Sync message interval (log2)\n    uint8_t logAnnounceInterval;\n} gPTP_Config_t;\n\nvoid gPTP_Init(const gPTP_Config_t* config) {\n    \u002F\u002F Configure as grandmaster or slave\n    gPTP_SetDomain(config->domainNumber);\n    gPTP_SetPriority(config->priority1, config->priority2);\n\n    \u002F\u002F Set sync interval (e.g., -3 = 125us, 0 = 1s)\n    gPTP_SetSyncInterval(config->logSyncInterval);\n\n    \u002F\u002F Enable time synchronization\n    gPTP_Enable();\n}\n\n\u002F\u002F Get synchronized network time\nuint64_t gPTP_GetNetworkTime(void) {\n    uint64_t seconds;\n    uint32_t nanoseconds;\n\n    gPTP_GetTime(&seconds, &nanoseconds);\n\n    return (seconds * 1000000000ULL) + nanoseconds;\n}\n```\n\n### Time-Aware Shaper Configuration (IEEE 802.1Qbv)\n```c\n\u002F\u002F TAS gate control list for deterministic scheduling\ntypedef struct {\n    uint8_t gateStates;        \u002F\u002F Bitmap of open gates (per TC)\n    uint32_t timeIntervalNs;   \u002F\u002F Interval duration\n} TAS_GateEntry_t;\n\ntypedef struct {\n    uint64_t basetime;         \u002F\u002F Schedule start time (gPTP)\n    uint32_t cycleTime;        \u002F\u002F Total cycle duration\n    TAS_GateEntry_t entries[8];\n    uint8_t entryCount;\n} TAS_Schedule_t;\n\n\u002F\u002F Example: 1ms cycle with dedicated slots for each traffic class\nconst TAS_Schedule_t adasSchedule = {\n    .basetime = 0,             \u002F\u002F Align to gPTP epoch\n    .cycleTime = 1000000,      \u002F\u002F 1ms cycle\n    .entryCount = 4,\n    .entries = {\n        \u002F\u002F Time slot 1: Critical ADAS data (300us)\n        {.gateStates = 0b11000000, .timeIntervalNs = 300000},\n\n        \u002F\u002F Time slot 2: Audio\u002FVideo (400us)\n        {.gateStates = 0b00110000, .timeIntervalNs = 400000},\n\n        \u002F\u002F Time slot 3: Best effort (200us)\n        {.gateStates = 0b00001111, .timeIntervalNs = 200000},\n\n        \u002F\u002F Time slot 4: Guard band (100us)\n        {.gateStates = 0b00000000, .timeIntervalNs = 100000}\n    }\n};\n\nvoid TAS_ConfigureSchedule(uint8_t port, const TAS_Schedule_t* schedule) {\n    \u002F\u002F Program TAS registers on switch\u002Fendpoint\n    TAS_SetBaseTime(port, schedule->basetime);\n    TAS_SetCycleTime(port, schedule->cycleTime);\n\n    for (uint8_t i = 0; i \u003C schedule->entryCount; i++) {\n        TAS_SetGateEntry(\n            port,\n            i,\n            schedule->entries[i].gateStates,\n            schedule->entries[i].timeIntervalNs\n        );\n    }\n\n    \u002F\u002F Enable TAS\n    TAS_Enable(port);\n}\n```\n\n### AVTP Camera Streaming (IEEE 1722)\n```c\n\u002F\u002F AVTP stream for camera video\ntypedef struct {\n    uint64_t streamId;         \u002F\u002F Unique stream identifier\n    uint8_t  destMac[6];       \u002F\u002F Multicast MAC address\n    uint16_t vlanId;\n    uint8_t  priority;         \u002F\u002F PCP value\n    uint32_t maxFrameSize;     \u002F\u002F Maximum video frame size\n    uint16_t maxIntervalFrames;\u002F\u002F Frames per interval\n} AVTP_StreamConfig_t;\n\n\u002F\u002F Configure AVTP stream\nvoid AVTP_ConfigureStream(const AVTP_StreamConfig_t* config) {\n    \u002F\u002F Register stream with SRP\n    SRP_RegisterStream(\n        config->streamId,\n        config->destMac,\n        config->vlanId,\n        config->priority,\n        config->maxFrameSize,\n        config->maxIntervalFrames\n    );\n\n    \u002F\u002F Configure talker\n    AVTP_SetStreamId(config->streamId);\n    AVTP_SetFormat(AVTP_FORMAT_H264);\n}\n\n\u002F\u002F Send video frame via AVTP\nvoid AVTP_SendVideoFrame(\n    uint64_t streamId,\n    uint8_t* frameData,\n    uint32_t frameSize,\n    uint64_t timestamp\n) {\n    \u002F\u002F Build AVTP header\n    AVTP_Header_t header;\n    header.subtype = AVTP_SUBTYPE_CVF;  \u002F\u002F Compressed Video Format\n    header.streamId = streamId;\n    header.timestamp = timestamp;       \u002F\u002F gPTP timestamp\n    header.streamDataLength = frameSize;\n    header.sequenceNum = avtpSeqNum++;\n\n    \u002F\u002F Transmit with high priority\n    ETH_SendPacket(\n        &header,\n        sizeof(header),\n        frameData,\n        frameSize,\n        PRIORITY_HIGH\n    );\n}\n```\n\n### SOME\u002FIP Service Implementation\n```cpp\n\u002F\u002F SOME\u002FIP service definition (Franca IDL)\n\u002F*\ninterface SensorFusion {\n    version { major 1 minor 0 }\n\n    method GetObjectList {\n        out {\n            ObjectList objects\n        }\n    }\n\n    broadcast ObjectDetected {\n        out {\n            Object detectedObject\n        }\n    }\n}\n*\u002F\n\n\u002F\u002F Service implementation\nclass SensorFusionService : public SomeIpService {\npublic:\n    SensorFusionService() : SomeIpService(SERVICE_ID, INSTANCE_ID) {\n        \u002F\u002F Register methods\n        RegisterMethod(METHOD_GET_OBJECT_LIST,\n                      &SensorFusionService::HandleGetObjectList);\n\n        \u002F\u002F Offer service\n        OfferService();\n    }\n\n    void HandleGetObjectList(const Message& request, Message& response) {\n        \u002F\u002F Gather object list from sensors\n        ObjectList objects = GetTrackedObjects();\n\n        \u002F\u002F Serialize response\n        Serializer serializer;\n        serializer \u003C\u003C objects;\n\n        \u002F\u002F Send response\n        response.SetPayload(serializer.GetData());\n        SendResponse(response);\n    }\n\n    void NotifyObjectDetected(const Object& obj) {\n        \u002F\u002F Broadcast event\n        Message event(SERVICE_ID, INSTANCE_ID, EVENT_OBJECT_DETECTED);\n\n        Serializer serializer;\n        serializer \u003C\u003C obj;\n\n        event.SetPayload(serializer.GetData());\n        BroadcastEvent(event);\n    }\n\nprivate:\n    static const uint16_t SERVICE_ID = 0x1234;\n    static const uint16_t INSTANCE_ID = 0x0001;\n    static const uint16_t METHOD_GET_OBJECT_LIST = 0x0100;\n    static const uint16_t EVENT_OBJECT_DETECTED = 0x8000;\n};\n```\n\n### Stream Reservation Protocol (SRP)\n```c\n\u002F\u002F Reserve bandwidth for AVB\u002FTSN stream\ntypedef struct {\n    uint64_t streamId;\n    uint8_t  destMac[6];\n    uint16_t vlanId;\n    uint8_t  priority;\n    uint32_t maxFrameSize;\n    uint16_t maxIntervalFrames;\n    uint32_t accumulatedLatency;  \u002F\u002F Max end-to-end latency\n} SRP_TalkerAdvertise_t;\n\nSRP_Status_t SRP_AdvertiseStream(const SRP_TalkerAdvertise_t* talker) {\n    \u002F\u002F Calculate required bandwidth\n    uint32_t bandwidth = (talker->maxFrameSize * 8 *\n                         talker->maxIntervalFrames) \u002F 125000;  \u002F\u002F Mbps\n\n    \u002F\u002F Send MSRP Talker Advertise\n    MSRP_SendTalkerAdvertise(\n        talker->streamId,\n        talker->destMac,\n        talker->vlanId,\n        talker->priority,\n        talker->maxFrameSize,\n        talker->maxIntervalFrames,\n        talker->accumulatedLatency\n    );\n\n    \u002F\u002F Wait for listener ready\n    return SRP_WaitForListenerReady(talker->streamId, 1000);\n}\n```\n\n## Use Case: ADAS Sensor Fusion System\n\n### Network Architecture\n```\nCentral ADAS ECU (Switch + Compute)\n  |\n  +-- Front Camera (1920x1080@30fps, H.264)\n  +-- Rear Camera (1920x1080@30fps, H.264)\n  +-- Left Camera (1280x720@30fps, H.264)\n  +-- Right Camera (1280x720@30fps, H.264)\n  +-- Front Radar (Object list @ 50Hz)\n  +-- Lidar (Point cloud @ 10Hz)\n  +-- Gateway ECU (CAN\u002FFlexRay bridge)\n```\n\n### Bandwidth Requirements (1000BASE-T1)\n- Front Camera: ~8 Mbps (H.264)\n- Rear Camera: ~8 Mbps\n- Left Camera: ~4 Mbps\n- Right Camera: ~4 Mbps\n- Radar: ~1 Mbps\n- Lidar: ~20 Mbps\n- Control\u002Fdiagnostics: ~5 Mbps\n- **Total**: ~50 Mbps (5% of 1 Gbps)\n\n### TSN Configuration\n- gPTP domain 0 for time sync (125us sync interval)\n- TAS cycle: 1ms\n- Critical traffic (radar, control): 300us window\n- Video traffic: 600us window\n- Best effort: 100us window\n\n## Deliverables\n\n- Network topology diagram\n- TSN schedule configuration\n- SOME\u002FIP service definitions (FIDL)\n- Bandwidth allocation spreadsheet\n- gPTP configuration\n- Driver\u002Fmiddleware implementation\n- Integration test specifications\n- Timing analysis report\n\n## Common Issues and Solutions\n\n### Time Sync Failures\n- Verify gPTP domain configuration\n- Check grandmaster selection algorithm\n- Monitor path delay measurements\n- Validate switch support for gPTP\n\n### Packet Loss in Critical Traffic\n- Check TAS gate schedule alignment\n- Verify bandwidth reservation via SRP\n- Monitor queue depths and drops\n- Validate switch buffer configuration\n\n### High Latency\n- Optimize TAS schedule (reduce guard bands)\n- Check for best-effort traffic starvation\n- Verify priority tag configuration\n- Analyze per-hop latency in switches\n\n### SOME\u002FIP Discovery Issues\n- Check multicast routing configuration\n- Verify service offer\u002Ffind timing\n- Monitor UDP port conflicts\n- Validate firewall\u002FVLAN settings\n\n## FlexRay Protocol\n\n## Core Competencies\n\nExpert in FlexRay protocol for deterministic, fault-tolerant automotive communication.\n\n### Physical Layer\n- Dual-channel redundant communication (Channel A\u002FB)\n- Differential signaling at 10 Mbps\n- Bus Guardian for fault isolation\n- Star, bus, or hybrid topologies\n- Cable length up to 24m per segment\n\n### Data Link Layer\n- Static and dynamic segments\n- Time Division Multiple Access (TDMA)\n- Cycle time: 1-16 ms (configurable)\n- Frame size: 0-254 bytes payload\n- CRC and frame checksums\n\n### Communication Cycle Structure\n```\n|\u003C------- Communication Cycle ------->|\n| Static | Dynamic | Symbol | NIT     |\n| Segment| Segment | Window | (Idle)  |\n```\n\n- Static Segment: Guaranteed deterministic slots\n- Dynamic Segment: Flexible priority-based transmission\n- Symbol Window: Network management\n- Network Idle Time (NIT): Clock synchronization\n\n### Timing and Synchronization\n- Global time synchronization across all nodes\n- Offset and rate correction\n- Maximum drift tolerance: 1500 ppm\n- Startup and wakeup procedures\n- Coldstart vs. non-coldstart nodes\n\n### Configuration Parameters\n- Slot assignment (static\u002Fdynamic)\n- Payload length per slot\n- Base cycle multiplier\n- Action point offsets\n- Bus Guardian parameters\n\n## Design Approach\n\n1. Network Planning\n   - Define communication matrix\n   - Calculate bandwidth requirements\n   - Assign static\u002Fdynamic slots\n   - Configure redundancy strategy\n\n2. Cluster Configuration\n   - Set global cycle parameters\n   - Configure clock synchronization\n   - Define startup sequence\n   - Set Bus Guardian parameters\n\n3. Node Implementation\n   - Configure Communication Controller (CC)\n   - Implement AUTOSAR FlexRay Driver\n   - Define frame triggering\n   - Implement error handling\n\n4. Validation and Testing\n   - Timing verification (WCET analysis)\n   - Fault injection testing\n   - Startup sequence validation\n   - Load and stress testing\n\n## Implementation Examples\n\n### Static Slot Configuration (AUTOSAR)\n```c\n\u002F\u002F FlexRay static slot transmission\nconst Fr_LPduType staticPdu = {\n    .FrameId = 10,              \u002F\u002F Static slot ID\n    .Channel = FR_CHANNEL_AB,   \u002F\u002F Both channels\n    .CycleRepetition = 1,       \u002F\u002F Every cycle\n    .CycleOffset = 0,\n    .Payload = 16,              \u002F\u002F 16 bytes (8 words)\n    .HeaderCRC = 0x1A3          \u002F\u002F Calculated CRC\n};\n\n\u002F\u002F Transmit in static slot\nStd_ReturnType result = Fr_TransmitTxLPdu(\n    0,                          \u002F\u002F Controller ID\n    10,                         \u002F\u002F Frame ID\n    txData,                     \u002F\u002F Payload pointer\n    16                          \u002F\u002F Length\n);\n```\n\n### Dynamic Slot Usage\n```c\n\u002F\u002F Dynamic segment configuration\nconst Fr_DynamicSlotConfig_t dynConfig = {\n    .SlotId = 50,               \u002F\u002F Dynamic slot start\n    .PayloadLength = 32,\n    .MinislotCount = 20,        \u002F\u002F Number of minislots\n    .Priority = 5               \u002F\u002F Transmission priority\n};\n\n\u002F\u002F Conditional transmission in dynamic segment\nif (Fr_CheckTxLPduStatus(0, 50) == FR_TRANSMITTED) {\n    Fr_TransmitTxLPdu(0, 50, dynamicData, 32);\n}\n```\n\n### Startup Sequence\n```c\n\u002F\u002F FlexRay startup procedure\nvoid FlexRay_Startup(void) {\n    \u002F\u002F Initialize Communication Controller\n    Fr_Init(&Fr_Config);\n\n    \u002F\u002F Configure cluster parameters\n    Fr_ControllerInit(0);\n\n    \u002F\u002F Start communication (coldstart node)\n    Fr_StartCommunication(0);\n\n    \u002F\u002F Wait for normal active state\n    Fr_PocStateType pocState;\n    do {\n        Fr_GetPOCStatus(0, &pocState);\n    } while (pocState != FR_POCSTATE_NORMAL_ACTIVE);\n}\n```\n\n### Bus Guardian Configuration\n```c\n\u002F\u002F Bus Guardian prevents babbling idiot\nconst Fr_BusGuardianConfig_t bgConfig = {\n    .GuardianEnable = TRUE,\n    .ActionPointOffset = 5,     \u002F\u002F Macroticks before slot start\n    .MaxTxDuration = 50,        \u002F\u002F Maximum transmission time\n    .MinislotDuration = 2       \u002F\u002F Minislot size (macroticks)\n};\n```\n\n## Use Case: Steer-by-Wire System\n\n### Network Architecture\n```\nSteering ECU (Coldstart) \u003C--Channel A\u002FB--> Actuator ECU 1\n                        \u003C--Channel A\u002FB--> Actuator ECU 2\n                        \u003C--Channel A\u002FB--> Sensor ECU\n```\n\n### Communication Matrix\n| Slot | Sender       | Data             | Cycle | Size |\n|------|--------------|------------------|-------|------|\n| 1    | Steering ECU | Steering Angle   | 5ms   | 16B  |\n| 2    | Sensor ECU   | Torque Sensor    | 5ms   | 8B   |\n| 3    | Actuator 1   | Position Status  | 5ms   | 12B  |\n| 4    | Actuator 2   | Position Status  | 5ms   | 12B  |\n| 50+  | All          | Diagnostics      | 20ms  | 32B  |\n\n### Safety Considerations\n- ASIL-D rated communication\n- Dual-channel redundancy with voting\n- Sequence counter for frame freshness\n- CRC calculation for data integrity\n- Timeout supervision on critical signals\n\n## Deliverables\n\n- FlexRay cluster specification (FIBEX XML)\n- Node configuration files (AUTOSAR)\n- Communication matrix documentation\n- Driver implementation (C\u002FC++)\n- Timing analysis report (WCET)\n- Integration test specifications\n- Safety documentation (ISO 26262)\n\n## Common Issues and Solutions\n\n### Startup Failures\n- Check coldstart node configuration\n- Verify sync frame offsets\n- Ensure clock tolerance within spec\n- Validate Bus Guardian timing\n\n### Communication Errors\n- Monitor slot boundary violations\n- Check CRC errors in frames\n- Verify payload length configuration\n- Analyze bus load in dynamic segment\n\n### Timing Violations\n- Reduce static segment load\n- Optimize dynamic slot allocation\n- Adjust action point offsets\n- Verify interrupt latencies\n\n## LIN Protocol\n\n## Core Competencies\n\nExpert in LIN protocol for cost-effective automotive sub-networks.\n\n### Physical Layer\n- Single-wire bidirectional bus\n- Baud rates: 1 kbps to 20 kbps (typical: 9.6\u002F19.2 kbps)\n- Master-slave architecture (1 master, up to 16 slaves)\n- Dominant (0V) and recessive (12V battery voltage)\n- Bus length up to 40 meters\n- No termination resistors required\n\n### Protocol Architecture\n- Master schedules all communication\n- Slaves respond only when addressed\n- Time-triggered schedule tables\n- Event-triggered frames for efficiency\n- Diagnostic services (ISO 14229 subset)\n\n### Frame Structure\n```\n|\u003C---------- LIN Frame ---------->|\n| Header (Master)  | Response      |\n| Break | Sync | ID| Data | CRC   |\n```\n\n- Break field: 13 dominant bits minimum\n- Sync byte: 0x55 for baud rate sync\n- Protected ID: 6-bit ID + 2 parity bits\n- Data: 1-8 bytes\n- Checksum: Classic or Enhanced\n\n### LIN Frame Types\n- Unconditional frames (standard data)\n- Event-triggered frames (slave polling)\n- Sporadic frames (conditional master transmission)\n- Diagnostic frames (node configuration)\n\n### Schedule Table Concept\n```c\n\u002F\u002F Schedule table defines communication pattern\nLIN_ScheduleTable_t SeatControlSchedule[] = {\n    {FRAME_SeatPosition,    10},  \u002F\u002F Every 10ms\n    {FRAME_SeatMemory,      50},  \u002F\u002F Every 50ms\n    {FRAME_EventTrigger,   100},  \u002F\u002F Slave event polling\n    {FRAME_DiagRequest,    200},  \u002F\u002F Diagnostic window\n};\n```\n\n## Design Approach\n\n1. Network Planning\n   - Define master and slave nodes\n   - Create signal database (LDF file)\n   - Design schedule tables\n   - Assign frame IDs (0x00-0x3F)\n\n2. Master Node Implementation\n   - Configure UART for LIN\n   - Implement schedule table execution\n   - Handle slave responses\n   - Provide diagnostic services\n\n3. Slave Node Implementation\n   - Configure frame filters (ID match)\n   - Implement response generation\n   - Handle sleep\u002Fwakeup commands\n   - Support node configuration\n\n4. Validation and Testing\n   - Bus timing verification\n   - Frame error injection\n   - Sleep\u002Fwakeup testing\n   - EMC compliance testing\n\n## Implementation Examples\n\n### Master Frame Transmission (AUTOSAR)\n```c\n\u002F\u002F LIN master sends unconditional frame\nvoid Lin_MasterSendFrame(uint8 channel, Lin_PduType* pdu) {\n    \u002F\u002F Send break field (13-26 dominant bits)\n    Lin_SendBreak(channel);\n\n    \u002F\u002F Send sync byte (0x55)\n    Lin_SendByte(channel, LIN_SYNC_BYTE);\n\n    \u002F\u002F Calculate protected ID (ID + parity)\n    uint8 protectedId = Lin_CalculateProtectedId(pdu->Id);\n    Lin_SendByte(channel, protectedId);\n\n    \u002F\u002F Send data bytes\n    for (uint8 i = 0; i \u003C pdu->DataLength; i++) {\n        Lin_SendByte(channel, pdu->Data[i]);\n    }\n\n    \u002F\u002F Send checksum (enhanced)\n    uint8 checksum = Lin_CalculateChecksum(\n        protectedId,\n        pdu->Data,\n        pdu->DataLength,\n        LIN_ENHANCED_CRC\n    );\n    Lin_SendByte(channel, checksum);\n}\n```\n\n### Slave Response Handling\n```c\n\u002F\u002F LIN slave responds to master request\nvoid Lin_SlaveProcessFrame(uint8 id, uint8* data, uint8 len) {\n    Lin_FrameResponseType response;\n\n    \u002F\u002F Check if this frame is for us\n    if (Lin_GetFrameResponse(id, &response) == E_OK) {\n        switch (response.Type) {\n            case LIN_UNCONDITIONAL:\n                \u002F\u002F Provide response data\n                Lin_PrepareResponse(\n                    response.Data,\n                    response.Length\n                );\n                break;\n\n            case LIN_EVENT_TRIGGERED:\n                \u002F\u002F Check if we have data to send\n                if (Lin_HasEventData()) {\n                    Lin_PrepareResponse(\n                        eventData,\n                        eventLength\n                    );\n                }\n                break;\n\n            case LIN_DIAGNOSTIC:\n                \u002F\u002F Handle diagnostic request\n                Lin_ProcessDiagnostic(data, len);\n                break;\n        }\n    }\n}\n```\n\n### Schedule Table Execution\n```c\n\u002F\u002F Master executes schedule table\ntypedef struct {\n    uint8 frameId;\n    uint16 delayMs;\n} Lin_ScheduleEntry_t;\n\nconst Lin_ScheduleEntry_t seatSchedule[] = {\n    {0x10, 10},   \u002F\u002F Seat position every 10ms\n    {0x11, 20},   \u002F\u002F Seat tilt every 20ms\n    {0x12, 50},   \u002F\u002F Memory recall every 50ms\n    {0x3C, 100},  \u002F\u002F Event-triggered every 100ms\n    {0x3D, 200}   \u002F\u002F Diagnostic every 200ms\n};\n\nvoid Lin_ExecuteSchedule(uint8 channel) {\n    static uint8 scheduleIndex = 0;\n    static uint32 lastTime = 0;\n\n    uint32 currentTime = GetTickCount();\n    const Lin_ScheduleEntry_t* entry = &seatSchedule[scheduleIndex];\n\n    if (currentTime - lastTime >= entry->delayMs) {\n        Lin_SendFrame(channel, entry->frameId);\n\n        scheduleIndex = (scheduleIndex + 1) %\n                        ARRAY_SIZE(seatSchedule);\n        lastTime = currentTime;\n    }\n}\n```\n\n### Sleep\u002FWakeup Implementation\n```c\n\u002F\u002F Sleep command (diagnostic frame 0x3C)\nvoid Lin_GoToSleep(uint8 channel) {\n    uint8 sleepCmd[] = {0x00, 0xFF, 0xFF, 0xFF,\n                        0xFF, 0xFF, 0xFF, 0xFF};\n    Lin_SendDiagnosticFrame(channel, 0x3C, sleepCmd, 8);\n\n    \u002F\u002F Enter sleep mode after frame transmission\n    Lin_SetState(channel, LIN_STATE_SLEEP);\n}\n\n\u002F\u002F Wakeup pulse (dominant signal 250-5000us)\nvoid Lin_Wakeup(uint8 channel) {\n    \u002F\u002F Send dominant pulse (typically 500us)\n    Lin_SendWakeupPulse(channel, 500);\n\n    \u002F\u002F Wait for bus recovery\n    DelayUs(150);\n\n    \u002F\u002F Resume normal operation\n    Lin_SetState(channel, LIN_STATE_OPERATIONAL);\n}\n```\n\n### Node Configuration (LIN 2.x)\n```c\n\u002F\u002F Assign NAD (Node Address for Diagnostics)\nvoid Lin_AssignNAD(uint8 supplierId, uint16 functionId, uint8 newNAD) {\n    uint8 configData[] = {\n        0x06,                      \u002F\u002F Service: Assign NAD\n        (supplierId >> 8) & 0xFF,  \u002F\u002F Supplier ID MSB\n        supplierId & 0xFF,         \u002F\u002F Supplier ID LSB\n        (functionId >> 8) & 0xFF,  \u002F\u002F Function ID MSB\n        functionId & 0xFF,         \u002F\u002F Function ID LSB\n        newNAD,                    \u002F\u002F New NAD\n        0xFF, 0xFF\n    };\n\n    Lin_SendDiagnosticFrame(0, 0x3C, configData, 8);\n}\n```\n\n## Use Case: Power Seat Control\n\n### Network Architecture\n```\nMaster (Body Control Module)\n  |\n  +-- Slave 1: Seat Position Sensor (NAD 0x01)\n  +-- Slave 2: Lumbar Actuator (NAD 0x02)\n  +-- Slave 3: Recline Motor (NAD 0x03)\n  +-- Slave 4: Height Adjustment (NAD 0x04)\n```\n\n### Signal Database (LDF excerpt)\n```ldf\nSignals {\n    SeatPositionFB: 8, 0, RightSeatSensor, AllNodes;\n    LumbarPosition: 8, 0, LumbarActuator, AllNodes;\n    ReclineAngle: 16, 0, ReclineMotor, AllNodes;\n    SeatHeight: 8, 0, HeightActuator, AllNodes;\n    MemoryRecall: 2, 0, BodyControlModule, AllNodes;\n}\n\nFrames {\n    SeatStatus: 0x10, BodyControlModule, 4 {\n        SeatPositionFB, 0;\n        LumbarPosition, 8;\n        ReclineAngle, 16;\n    }\n\n    SeatCommand: 0x11, BodyControlModule, 2 {\n        MemoryRecall, 0;\n        TargetPosition, 8;\n    }\n}\n\nSchedule_tables {\n    NormalOperation {\n        SeatStatus delay 10 ms;\n        SeatCommand delay 20 ms;\n        EventTriggered delay 50 ms;\n    }\n}\n```\n\n### Timing Considerations\n- Frame time: ~10ms at 9.6 kbps for 8-byte frame\n- Schedule cycle: 100-200ms typical\n- Response timeout: 14ms maximum (LIN spec)\n- Sleep transition: within 4 seconds\n\n## Deliverables\n\n- LIN network description file (LDF)\n- Node capability files (NCF)\n- Master schedule tables\n- Slave driver implementation\n- Diagnostic database (ODX)\n- Integration test specifications\n- EMC test report\n\n## Common Issues and Solutions\n\n### Sync Byte Errors\n- Check baud rate tolerance (\u003C1.5%)\n- Verify UART clock source stability\n- Adjust slave sync detection\n\n### Checksum Failures\n- Verify classic vs. enhanced CRC mode\n- Check endianness of multi-byte signals\n- Validate checksum calculation algorithm\n\n### Sleep\u002FWakeup Problems\n- Check wakeup pulse duration (250-5000us)\n- Verify bus pullup resistor (1k typical)\n- Ensure all nodes support sleep mode\n\n### Bus Contention\n- Verify schedule table timing\n- Check for rogue slave transmissions\n- Monitor bus idle time between frames\n\n## LVDS Protocol\n\n## Core Competencies\n\nExpert in LVDS for high-speed differential signaling in automotive applications.\n\n### Physical Layer Characteristics\n- Differential voltage: 247-454 mV (nominal 350 mV)\n- Common-mode voltage: 1.2V typical\n- Data rates: 155 Mbps to 1.2 Gbps per lane\n- Low power consumption: ~3.5mW per driver\n- Excellent EMI performance (differential cancellation)\n- Point-to-point or multi-drop topologies\n\n### Signal Characteristics\n- Differential impedance: 100 ohms ±10%\n- Rise\u002Ffall time: \u003C500ps (typical 200ps)\n- Propagation delay: ~50ps\u002Finch on PCB\n- Maximum cable length: 10m (shielded twisted pair)\n- Skew tolerance: ±350ps between lanes\n\n### LVDS Applications in Automotive\n1. **Camera Interfaces**\n   - Raw Bayer sensor data (MIPI CSI-2)\n   - YUV422\u002FRGB888 video formats\n   - 1-4 data lanes + clock lane\n   - Typical: 720p@30fps = 1 lane, 1080p@60fps = 4 lanes\n\n2. **Display Interfaces**\n   - FPD-Link (Texas Instruments)\n   - OpenLDI for LCD panels\n   - Instrument cluster displays\n   - Head-up display (HUD) units\n\n3. **Sensor Data**\n   - Radar digital interface\n   - Lidar point cloud transmission\n   - High-speed ADC data\n\n## Design Approach\n\n1. Signal Integrity Design\n   - Differential pair routing (100 ohm impedance)\n   - Length matching between pairs (±5 mils)\n   - Controlled impedance PCB stackup\n   - Minimize vias and stubs\n\n2. Serializer\u002FDeserializer Selection\n   - Choose appropriate SerDes chipset\n   - Calculate required bandwidth\n   - Plan for FEC (Forward Error Correction)\n   - Consider diagnostic features\n\n3. EMC\u002FEMI Mitigation\n   - Common-mode choke on cable\n   - Proper grounding and shielding\n   - Spread spectrum clocking\n   - PCB layer stackup optimization\n\n4. Validation and Testing\n   - Eye diagram analysis\n   - Jitter and skew measurement\n   - BER (Bit Error Rate) testing\n   - EMI radiated emissions testing\n\n## Implementation Examples\n\n### LVDS Driver Configuration\n```c\n\u002F\u002F LVDS transmitter initialization\ntypedef struct {\n    uint8_t laneCount;         \u002F\u002F 1-4 lanes\n    uint32_t bitRate;          \u002F\u002F Mbps per lane\n    bool spreadSpectrum;       \u002F\u002F SSC for EMI reduction\n    uint8_t outputSwing;       \u002F\u002F 250mV, 300mV, 350mV, 400mV\n    bool termination;          \u002F\u002F 100 ohm termination\n} LVDS_TxConfig_t;\n\nvoid LVDS_InitTransmitter(const LVDS_TxConfig_t* config) {\n    \u002F\u002F Configure PLL for desired bit rate\n    uint32_t pllFreq = config->bitRate * config->laneCount;\n    LVDS_SetPLLFrequency(pllFreq);\n\n    \u002F\u002F Enable spread spectrum if requested\n    if (config->spreadSpectrum) {\n        LVDS_EnableSSC(SSC_CENTER_SPREAD, SSC_MODULATION_0_5_PERCENT);\n    }\n\n    \u002F\u002F Configure output swing\n    LVDS_SetOutputSwing(config->outputSwing);\n\n    \u002F\u002F Enable differential termination\n    if (config->termination) {\n        LVDS_EnableTermination(TERMINATION_100_OHM);\n    }\n\n    \u002F\u002F Configure lane mapping\n    for (uint8_t lane = 0; lane \u003C config->laneCount; lane++) {\n        LVDS_MapLane(lane, LANE_ENABLED);\n    }\n\n    \u002F\u002F Enable transmitter\n    LVDS_Enable(LVDS_TX);\n}\n```\n\n### MIPI CSI-2 over LVDS (Camera Interface)\n```c\n\u002F\u002F MIPI CSI-2 camera configuration\ntypedef struct {\n    uint8_t dataLanes;         \u002F\u002F 1-4 data lanes\n    uint32_t pixelClock;       \u002F\u002F MHz\n    uint16_t width;            \u002F\u002F Pixels\n    uint16_t height;           \u002F\u002F Lines\n    uint8_t bitsPerPixel;      \u002F\u002F 8, 10, 12, 16\n    uint8_t virtualChannel;    \u002F\u002F 0-3\n} CSI2_CameraConfig_t;\n\nvoid CSI2_ConfigureCamera(const CSI2_CameraConfig_t* config) {\n    \u002F\u002F Calculate required lane data rate\n    \u002F\u002F rate = (width * height * bpp * fps) \u002F lanes\n    uint32_t bytesPerFrame = config->width * config->height *\n                             config->bitsPerPixel \u002F 8;\n    uint32_t laneDataRate = (bytesPerFrame * 30) \u002F config->dataLanes;\n\n    \u002F\u002F Configure D-PHY (LVDS physical layer)\n    CSI2_ConfigureDPhy(config->dataLanes, laneDataRate);\n\n    \u002F\u002F Configure CSI-2 receiver\n    CSI2_SetVirtualChannel(config->virtualChannel);\n    CSI2_SetDataType(CSI2_DT_RAW10);  \u002F\u002F For 10-bit Bayer\n    CSI2_SetImageSize(config->width, config->height);\n\n    \u002F\u002F Enable lanes\n    for (uint8_t lane = 0; lane \u003C config->dataLanes; lane++) {\n        CSI2_EnableLane(lane);\n    }\n\n    \u002F\u002F Start receiving\n    CSI2_StartReceive();\n}\n\n\u002F\u002F CSI-2 packet reception handler\nvoid CSI2_ReceiveFrame(uint8_t* frameBuffer, uint32_t bufferSize) {\n    \u002F\u002F Wait for frame start (FS) packet\n    CSI2_Packet_t packet;\n    while (1) {\n        if (CSI2_ReceivePacket(&packet) == CSI2_OK) {\n            if (packet.dataType == CSI2_DT_FRAME_START) {\n                break;\n            }\n        }\n    }\n\n    \u002F\u002F Receive line packets\n    uint32_t offset = 0;\n    uint16_t linesReceived = 0;\n\n    while (linesReceived \u003C imageHeight) {\n        if (CSI2_ReceivePacket(&packet) == CSI2_OK) {\n            if (packet.dataType == CSI2_DT_RAW10) {\n                \u002F\u002F Copy pixel data\n                memcpy(&frameBuffer[offset],\n                       packet.payload,\n                       packet.wordCount);\n                offset += packet.wordCount;\n                linesReceived++;\n            } else if (packet.dataType == CSI2_DT_FRAME_END) {\n                break;\n            }\n        }\n    }\n\n    \u002F\u002F Signal frame complete\n    CSI2_FrameComplete(frameBuffer, offset);\n}\n```\n\n### FPD-Link Display Interface\n```c\n\u002F\u002F FPD-Link III serializer configuration\ntypedef struct {\n    uint16_t displayWidth;\n    uint16_t displayHeight;\n    uint8_t colorDepth;        \u002F\u002F 18 or 24 bits\n    uint32_t pixelClock;       \u002F\u002F MHz\n    bool backChannel;          \u002F\u002F Enable I2C\u002Fcontrol back channel\n} FPDLink_DisplayConfig_t;\n\nvoid FPDLink_ConfigureDisplay(const FPDLink_DisplayConfig_t* config) {\n    \u002F\u002F Calculate serialized data rate\n    uint32_t dataRate = config->pixelClock * config->colorDepth;\n\n    \u002F\u002F Configure serializer (DS90UB913A-Q1 or similar)\n    FPDLink_SerializerInit();\n\n    \u002F\u002F Set pixel format\n    if (config->colorDepth == 18) {\n        FPDLink_SetPixelFormat(FPDLINK_RGB666);\n    } else {\n        FPDLink_SetPixelFormat(FPDLINK_RGB888);\n    }\n\n    \u002F\u002F Configure timing\n    FPDLink_SetDisplayTiming(\n        config->displayWidth,\n        config->displayHeight,\n        config->pixelClock\n    );\n\n    \u002F\u002F Enable back channel for touchscreen\u002FI2C\n    if (config->backChannel) {\n        FPDLink_EnableBackChannel(BACK_CHANNEL_I2C);\n    }\n\n    \u002F\u002F Enable serializer output\n    FPDLink_EnableOutput();\n}\n\n\u002F\u002F FPD-Link deserializer (at display side)\nvoid FPDLink_DeserializerInit(void) {\n    \u002F\u002F Configure deserializer (DS90UB914A-Q1 or similar)\n    FPDLink_DeserInit();\n\n    \u002F\u002F Auto-detect incoming signal\n    FPDLink_AutoDetectFormat();\n\n    \u002F\u002F Configure LCD output interface\n    FPDLink_SetOutputInterface(OUTPUT_PARALLEL_RGB);\n\n    \u002F\u002F Enable pattern generation for testing\n    FPDLink_EnableTestPattern(PATTERN_COLORBAR);\n\n    \u002F\u002F Wait for lock\n    while (!FPDLink_IsLocked()) {\n        DelayMs(10);\n    }\n\n    \u002F\u002F Disable test pattern\n    FPDLink_DisableTestPattern();\n}\n```\n\n### LVDS Receiver with Error Detection\n```c\n\u002F\u002F LVDS receiver with link monitoring\ntypedef struct {\n    bool locked;\n    uint32_t bitErrors;\n    uint32_t frameErrors;\n    int8_t signalStrength;     \u002F\u002F dBm\n    uint32_t jitterPs;         \u002F\u002F Picoseconds\n} LVDS_RxStatus_t;\n\nLVDS_RxStatus_t LVDS_GetReceiverStatus(void) {\n    LVDS_RxStatus_t status = {0};\n\n    \u002F\u002F Check clock\u002Fdata lock\n    status.locked = LVDS_IsClockLocked() && LVDS_IsDataLocked();\n\n    \u002F\u002F Read error counters\n    status.bitErrors = LVDS_ReadRegister(REG_BIT_ERROR_COUNT);\n    status.frameErrors = LVDS_ReadRegister(REG_FRAME_ERROR_COUNT);\n\n    \u002F\u002F Measure signal strength\n    status.signalStrength = LVDS_MeasureSignalStrength();\n\n    \u002F\u002F Measure jitter\n    status.jitterPs = LVDS_MeasureJitter();\n\n    return status;\n}\n\n\u002F\u002F Automatic link recovery\nvoid LVDS_MonitorLink(void) {\n    static uint32_t lastErrorCount = 0;\n    LVDS_RxStatus_t status = LVDS_GetReceiverStatus();\n\n    if (!status.locked) {\n        LogError(\"LVDS link lost - attempting recovery\");\n        LVDS_ResetReceiver();\n        return;\n    }\n\n    \u002F\u002F Check for increasing error rate\n    if (status.bitErrors > lastErrorCount + 100) {\n        LogWarning(\"LVDS bit errors detected: %d\", status.bitErrors);\n\n        \u002F\u002F Attempt equalization adjustment\n        LVDS_AdjustEqualization();\n    }\n\n    lastErrorCount = status.bitErrors;\n}\n```\n\n### Signal Integrity Verification\n```c\n\u002F\u002F Built-in self-test (BIST) pattern generation\ntypedef enum {\n    BIST_PRBS7,      \u002F\u002F Pseudo-random 2^7-1\n    BIST_PRBS23,     \u002F\u002F Pseudo-random 2^23-1\n    BIST_PRBS31,     \u002F\u002F Pseudo-random 2^31-1\n    BIST_FIXED_0,    \u002F\u002F All zeros\n    BIST_FIXED_1,    \u002F\u002F All ones\n    BIST_ALTERNATE   \u002F\u002F 10101010...\n} LVDS_BIST_Pattern_t;\n\nvoid LVDS_RunBIST(LVDS_BIST_Pattern_t pattern, uint32_t durationMs) {\n    \u002F\u002F Enable BIST pattern generator\n    LVDS_EnableBIST(pattern);\n\n    \u002F\u002F Wait for test duration\n    DelayMs(durationMs);\n\n    \u002F\u002F Disable BIST\n    LVDS_DisableBIST();\n\n    \u002F\u002F Read results\n    uint32_t bitErrors = LVDS_GetBISTErrors();\n    uint32_t totalBits = LVDS_GetBISTBitCount();\n\n    float ber = (float)bitErrors \u002F (float)totalBits;\n\n    LogInfo(\"BIST complete: BER = %e (%d errors in %d bits)\",\n            ber, bitErrors, totalBits);\n\n    \u002F\u002F BER should be \u003C 1e-12 for reliable operation\n    if (ber > 1e-9) {\n        LogError(\"BIST failed: BER too high\");\n    }\n}\n```\n\n## Use Case: Surround View Camera System\n\n### System Architecture\n```\nCentral ECU (SoC with 4x CSI-2 inputs)\n  |\n  +-- Front Camera (LVDS 4-lane) - 1920x1080@30fps\n  +-- Rear Camera (LVDS 4-lane) - 1920x1080@30fps\n  +-- Left Camera (LVDS 2-lane) - 1280x720@30fps\n  +-- Right Camera (LVDS 2-lane) - 1280x720@30fps\n```\n\n### Camera Configuration\n- Front\u002FRear: 4 data lanes @ 800 Mbps\u002Flane\n- Left\u002FRight: 2 data lanes @ 800 Mbps\u002Flane\n- RAW10 Bayer format (10 bits\u002Fpixel)\n- Virtual channels 0-3 for each camera\n\n### PCB Design Considerations\n- Differential pair routing: 5 mil trace\u002F5 mil space\n- Length matching: ±5 mils within pair, ±50 mils between pairs\n- Reference plane: Solid ground plane under LVDS traces\n- Via minimization: Use layer transitions sparingly\n- Impedance control: 100 ohms differential ±10%\n\n### Cable Specifications\n- Micro-coaxial cable (e.g., I-PEX CABLINE)\n- Impedance: 100 ohms differential\n- Length: \u003C30cm typical\n- Shielding: Aluminum-mylar wrap + drain wire\n- Connectors: High-speed mating (>1 Gbps rated)\n\n## Deliverables\n\n- LVDS link design specification\n- PCB layout guidelines and stackup\n- SerDes configuration code\n- Signal integrity simulation results\n- Eye diagram test reports\n- EMI test results\n- Integration test specifications\n\n## Common Issues and Solutions\n\n### Poor Eye Diagram Quality\n- Check PCB trace impedance (should be 100Ω ±10%)\n- Verify length matching between differential pairs\n- Reduce via count and stubs\n- Check termination resistors (100Ω, 1%)\n\n### Clock\u002FData Lock Failures\n- Verify PLL lock at transmitter\n- Check for cable discontinuities\n- Ensure common-mode voltage within spec\n- Validate spread spectrum settings match\n\n### High Bit Error Rate\n- Improve cable shielding\u002Fgrounding\n- Adjust receiver equalization\n- Reduce crosstalk between lanes\n- Check for power supply noise\n\n### EMI Emissions Failures\n- Add common-mode choke on cable\n- Enable spread spectrum clocking\n- Improve PCB ground plane integrity\n- Use shielded cables with proper grounding\n\n## MOST Protocol\n\n## Core Competencies\n\nExpert in MOST protocol for high-bandwidth multimedia automotive networks.\n\n### Physical Layer Options\n- MOST150: 150 Mbps over optical fiber or UTP\n- MOST25\u002F50: Legacy 25\u002F50 Mbps variants\n- Ring topology with star topology support\n- Optical (POF) or electrical (UTP Cat5) media\n- Maximum 64 devices per ring\n\n### Protocol Stack Architecture\n```\nApplication Layer\n------------------\nFunction Blocks (MOST High Protocol)\n------------------\nTransport Layer (MHP\u002FMEP\u002FMAP)\n------------------\nNetwork Layer (Message Router)\n------------------\nData Link Layer (MOST Network Services)\n------------------\nPhysical Layer (MOST150 Transceiver)\n```\n\n### Channel Types\n- Synchronous: Streaming data (audio\u002Fvideo) - isochronous\n- Asynchronous: Packet data (control messages)\n- Control: Network management and addressing\n- Ethernet: IP packet encapsulation (MOST150 only)\n\n### Addressing Scheme\n- Physical Address: 16-bit node position on ring\n- Logical Address: Function-based addressing\n- Group Address: Multicast to multiple nodes\n- Broadcast Address: All nodes on network\n\n### Network Topology\n```\nHead Unit (Master) --> Amplifier --> Display\n      ^                                  |\n      |                                  v\n  USB Hub \u003C-- Rear Seat Controller \u003C-- Camera\n```\n\n## Design Approach\n\n1. Network Planning\n   - Define device roles (master, slave, source, sink)\n   - Calculate bandwidth allocation\n   - Plan ring topology and bypass options\n   - Design function catalog\n\n2. Synchronous Channel Allocation\n   - Audio streaming (stereo\u002Fmultichannel)\n   - Video channels (camera feeds)\n   - Clock synchronization\n   - Bandwidth reservation\n\n3. Function Block Implementation\n   - Define MOST Function Catalog (XML)\n   - Implement function interfaces\n   - Register with network master\n   - Handle events and properties\n\n4. Validation and Testing\n   - Ring integrity verification\n   - Bandwidth utilization analysis\n   - Timing and synchronization tests\n   - Fault recovery testing\n\n## Implementation Examples\n\n### Network Services Layer\n```c\n\u002F\u002F MOST network initialization\ntypedef struct {\n    uint16_t nodeAddress;\n    uint8_t  deviceRole;      \u002F\u002F Master\u002FSlave\n    uint16_t syncBandwidth;   \u002F\u002F Bytes per frame\n    uint16_t asyncBandwidth;  \u002F\u002F Bytes per frame\n} MOST_NetworkConfig_t;\n\nvoid MOST_Init(const MOST_NetworkConfig_t* config) {\n    \u002F\u002F Initialize INIC (Intelligent Network Interface Controller)\n    MOST_INIC_Init();\n\n    \u002F\u002F Configure network parameters\n    MOST_SetNodeAddress(config->nodeAddress);\n    MOST_SetDeviceRole(config->deviceRole);\n\n    \u002F\u002F Allocate bandwidth\n    MOST_AllocateSyncBandwidth(config->syncBandwidth);\n    MOST_AllocateAsyncBandwidth(config->asyncBandwidth);\n\n    \u002F\u002F Start network services\n    MOST_NetworkStartup();\n}\n```\n\n### Synchronous Audio Streaming\n```c\n\u002F\u002F Configure synchronous connection for audio\ntypedef struct {\n    uint16_t sourceAddress;\n    uint16_t sinkAddress;\n    uint16_t connectionLabel;\n    uint8_t  channelCount;    \u002F\u002F Stereo = 2, 5.1 = 6\n    uint16_t sampleRate;      \u002F\u002F 44.1kHz, 48kHz\n    uint8_t  bitDepth;        \u002F\u002F 16, 24 bits\n} MOST_SyncConnection_t;\n\nMOST_Status_t MOST_CreateAudioStream(\n    const MOST_SyncConnection_t* conn\n) {\n    \u002F\u002F Calculate required bandwidth\n    \u002F\u002F BW = channels * (sampleRate \u002F 48kHz) * (bitDepth \u002F 8)\n    uint16_t bandwidth = conn->channelCount *\n                        (conn->sampleRate \u002F 48000) *\n                        (conn->bitDepth \u002F 8);\n\n    \u002F\u002F Allocate synchronous channel\n    uint16_t channelId = MOST_AllocateSyncChannel(\n        conn->sourceAddress,\n        conn->sinkAddress,\n        bandwidth\n    );\n\n    \u002F\u002F Configure audio parameters\n    MOST_ConfigureAudioStream(\n        channelId,\n        conn->channelCount,\n        conn->sampleRate,\n        conn->bitDepth\n    );\n\n    \u002F\u002F Start streaming\n    return MOST_StartSyncConnection(channelId);\n}\n```\n\n### Function Block Interface\n```c\n\u002F\u002F MOST Function Block for audio amplifier\ntypedef struct {\n    uint8_t  volume;          \u002F\u002F 0-100\n    int8_t   balance;         \u002F\u002F -50 to +50\n    int8_t   fader;           \u002F\u002F -50 to +50\n    uint8_t  bass;            \u002F\u002F 0-100\n    uint8_t  treble;          \u002F\u002F 0-100\n    bool     mute;\n} AudioAmp_FBlock_t;\n\n\u002F\u002F Function IDs\n#define FBLOCK_AUDIO_AMP    0x22\n#define FUNC_SET_VOLUME     0x100\n#define FUNC_SET_BALANCE    0x101\n#define FUNC_SET_MUTE       0x102\n\n\u002F\u002F Handle function block message\nvoid AudioAmp_ProcessMessage(\n    uint16_t functionId,\n    uint8_t* data,\n    uint16_t length\n) {\n    switch (functionId) {\n        case FUNC_SET_VOLUME:\n            if (length >= 1) {\n                audioAmp.volume = data[0];\n                DSP_SetVolume(audioAmp.volume);\n                AudioAmp_SendStatus(FUNC_SET_VOLUME, STATUS_OK);\n            }\n            break;\n\n        case FUNC_SET_BALANCE:\n            if (length >= 1) {\n                audioAmp.balance = (int8_t)data[0];\n                DSP_SetBalance(audioAmp.balance);\n                AudioAmp_SendStatus(FUNC_SET_BALANCE, STATUS_OK);\n            }\n            break;\n\n        case FUNC_SET_MUTE:\n            if (length >= 1) {\n                audioAmp.mute = data[0];\n                DSP_SetMute(audioAmp.mute);\n                AudioAmp_SendStatus(FUNC_SET_MUTE, STATUS_OK);\n            }\n            break;\n    }\n}\n```\n\n### Asynchronous Message Handling\n```c\n\u002F\u002F Send control message\ntypedef struct {\n    uint16_t targetAddress;\n    uint16_t functionBlockId;\n    uint16_t functionId;\n    uint8_t  opType;          \u002F\u002F Set\u002FGet\u002FStatus\u002FError\n    uint8_t  data[MAX_PAYLOAD];\n    uint16_t dataLength;\n} MOST_ControlMessage_t;\n\nMOST_Status_t MOST_SendControlMessage(\n    const MOST_ControlMessage_t* msg\n) {\n    \u002F\u002F Build MOST control message\n    uint8_t msgBuffer[256];\n    uint16_t idx = 0;\n\n    \u002F\u002F Addressing\n    msgBuffer[idx++] = (msg->targetAddress >> 8) & 0xFF;\n    msgBuffer[idx++] = msg->targetAddress & 0xFF;\n\n    \u002F\u002F Function Block and Instance\n    msgBuffer[idx++] = (msg->functionBlockId >> 8) & 0xFF;\n    msgBuffer[idx++] = msg->functionBlockId & 0xFF;\n\n    \u002F\u002F Function ID\n    msgBuffer[idx++] = (msg->functionId >> 8) & 0xFF;\n    msgBuffer[idx++] = (msg->functionId >> 4) & 0xFF;\n    msgBuffer[idx++] = (msg->functionId & 0x0F) | (msg->opType \u003C\u003C 4);\n\n    \u002F\u002F Payload\n    memcpy(&msgBuffer[idx], msg->data, msg->dataLength);\n    idx += msg->dataLength;\n\n    \u002F\u002F Send via asynchronous channel\n    return MOST_TransmitAsync(msgBuffer, idx);\n}\n```\n\n### Network Management\n```c\n\u002F\u002F MOST network master responsibilities\nvoid MOST_MasterTasks(void) {\n    static uint32_t lastCheck = 0;\n    uint32_t currentTime = GetTickCount();\n\n    \u002F\u002F Periodic tasks (every 100ms)\n    if (currentTime - lastCheck >= 100) {\n        \u002F\u002F Check ring stability\n        if (!MOST_IsRingLocked()) {\n            MOST_ReconfigureRing();\n        }\n\n        \u002F\u002F Monitor bandwidth utilization\n        uint16_t syncUsage = MOST_GetSyncBandwidthUsage();\n        uint16_t asyncUsage = MOST_GetAsyncBandwidthUsage();\n\n        if (syncUsage > 90) {\n            LogWarning(\"Sync bandwidth near capacity\");\n        }\n\n        \u002F\u002F Update network topology\n        MOST_UpdateNodeList();\n\n        lastCheck = currentTime;\n    }\n}\n```\n\n## Use Case: Premium Infotainment System\n\n### Network Components\n```\n[Head Unit - Master]\n  |\n  +-- [Amplifier] (8-channel audio sink)\n  +-- [Front Display] (video + control)\n  +-- [Rear Display 1] (video + control)\n  +-- [Rear Display 2] (video + control)\n  +-- [Surround View Camera Hub] (4x video sources)\n  +-- [Navigation ECU] (data + control)\n  +-- [USB Media Hub]\n```\n\n### Bandwidth Allocation (MOST150)\n- Synchronous (Audio):\n  - 8ch x 48kHz x 24-bit = 1.152 Mbps\n- Synchronous (Video):\n  - 4x cameras 720p30 H.264 = ~16 Mbps\n  - 2x rear displays 1080p60 = ~20 Mbps\n- Asynchronous (Control): ~5 Mbps\n- Ethernet (Navigation): ~10 Mbps\n- **Total**: ~52 Mbps (34% utilization)\n\n### Function Catalog Example\n```xml\n\u003CFunctionCatalog>\n  \u003CDevice Name=\"Amplifier\" Address=\"0x0101\">\n    \u003CFunctionBlock ID=\"0x22\" Name=\"AudioAmplifier\">\n      \u003CFunction ID=\"0x100\" Name=\"SetVolume\">\n        \u003CParameter Name=\"Volume\" Type=\"uint8\" Range=\"0-100\"\u002F>\n      \u003C\u002FFunction>\n      \u003CFunction ID=\"0x101\" Name=\"SetBalance\">\n        \u003CParameter Name=\"Balance\" Type=\"int8\" Range=\"-50,50\"\u002F>\n      \u003C\u002FFunction>\n      \u003CProperty ID=\"0x200\" Name=\"CurrentVolume\" Type=\"uint8\"\u002F>\n      \u003CProperty ID=\"0x201\" Name=\"ChannelStatus\" Type=\"bitfield\"\u002F>\n    \u003C\u002FFunctionBlock>\n  \u003C\u002FDevice>\n\u003C\u002FFunctionCatalog>\n```\n\n## Deliverables\n\n- MOST network design document\n- Function catalog (XML)\n- Bandwidth allocation spreadsheet\n- Node configuration files\n- Driver\u002Fmiddleware implementation\n- Streaming protocol handlers\n- Test specifications\n- Timing analysis report\n\n## Common Issues and Solutions\n\n### Ring Instability\n- Check optical fiber quality and connectors\n- Verify bypass activation in case of node failure\n- Monitor light power levels\n- Ensure proper grounding for electrical MOST\n\n### Synchronous Streaming Glitches\n- Verify clock synchronization\n- Check bandwidth oversubscription\n- Monitor buffer underruns\u002Foverruns\n- Validate sample rate conversion\n\n### Control Message Timeouts\n- Check asynchronous channel congestion\n- Verify message routing tables\n- Monitor retry mechanisms\n- Validate function block registration\n\n### Audio Quality Issues\n- Check for clock drift between source\u002Fsink\n- Verify bit depth and sample rate matching\n- Monitor jitter on synchronous channel\n- Validate DSP configuration\n\n## PSI5 Protocol\n\n## Core Competencies\n\nExpert in PSI5 protocol for safety-critical sensor communication in automotive applications.\n\n### Protocol Characteristics\n- Bidirectional communication over 2-wire interface\n- Current-mode signaling (more robust than voltage)\n- Sensor powered via same 2-wire interface\n- Synchronous data transmission (time-slot based)\n- Built-in sensor diagnostics and monitoring\n- Designed for ASIL-D safety applications\n\n### Physical Layer\n- 2-wire interface: Power\u002FData+ and Ground\u002FData-\n- Voltage: 8-18V (nominal 12V)\n- Current mode: 5-13 mA for logic levels\n- Data rate: 125 kbps or 189 kbps\n- Up to 3 sensors per bus\n- Cable length: Up to 10 meters\n\n### Communication Modes\n- **Mode 1**: Asynchronous sensor data (continuous streaming)\n- **Mode 2**: Synchronous time-slot based (typical for airbag)\n- **Mode 3**: Bidirectional with ECU command capability\n\n### PSI5 Frame Structure (Mode 2)\n```\nSync Pulse (from ECU) triggers sensor transmission\n  |\n  v\n|\u003C-------- Time Slot 1 ------->|\u003C-------- Time Slot 2 ------->|\n| Sensor 1 Data | Sensor 2 Data | Sensor 3 Data | ...         |\n| Start | Payload | CRC | Stop  | Start | Payload | CRC | Stop |\n```\n\n### Data Encoding\n- Manchester encoding for clock recovery\n- 10-bit or 16-bit data frames\n- 2-bit or 3-bit CRC\n- Start and stop bits for frame synchronization\n\n## Design Approach\n\n1. Network Planning\n   - Define sensor types and count\n   - Select PSI5 mode (1, 2, or 3)\n   - Calculate time slots and bandwidth\n   - Plan power budget\n\n2. ECU Interface Implementation\n   - Configure PSI5 transceiver\n   - Generate sync pulses\n   - Implement time-slot management\n   - Decode Manchester-encoded data\n\n3. Safety Mechanisms\n   - CRC verification on every frame\n   - Timeout monitoring per sensor\n   - Plausibility checks on sensor data\n   - Diagnostic counter management\n\n4. Validation and Testing\n   - Frame timing verification\n   - Fault injection testing\n   - Power supply variation testing\n   - EMC immunity testing\n\n## Implementation Examples\n\n### PSI5 ECU Interface Initialization\n```c\n\u002F\u002F PSI5 configuration\ntypedef struct {\n    uint8_t mode;              \u002F\u002F PSI5 mode (1, 2, or 3)\n    uint32_t dataRate;         \u002F\u002F 125000 or 189000 bps\n    uint8_t sensorCount;       \u002F\u002F Number of sensors (1-3)\n    uint16_t syncPeriodUs;     \u002F\u002F Sync pulse period (μs)\n    uint16_t timeSlotUs;       \u002F\u002F Time slot duration (μs)\n    bool diagnosticEnable;     \u002F\u002F Enable sensor diagnostics\n} PSI5_Config_t;\n\nvoid PSI5_Init(const PSI5_Config_t* config) {\n    \u002F\u002F Initialize PSI5 transceiver\n    PSI5_TransceiverInit();\n\n    \u002F\u002F Configure operating mode\n    PSI5_SetMode(config->mode);\n\n    \u002F\u002F Set data rate\n    PSI5_SetDataRate(config->dataRate);\n\n    \u002F\u002F Configure sync pulse generation\n    PSI5_ConfigureSyncPulse(config->syncPeriodUs);\n\n    \u002F\u002F Configure time slots for Mode 2\n    if (config->mode == PSI5_MODE2) {\n        for (uint8_t i = 0; i \u003C config->sensorCount; i++) {\n            PSI5_ConfigureTimeSlot(\n                i,\n                i * config->timeSlotUs,\n                config->timeSlotUs\n            );\n        }\n    }\n\n    \u002F\u002F Enable receiver\n    PSI5_EnableReceiver();\n\n    \u002F\u002F Start sync pulse generation\n    PSI5_StartSyncPulse();\n}\n```\n\n### Sync Pulse Generation (Mode 2)\n```c\n\u002F\u002F Generate sync pulse to trigger sensor transmissions\nvoid PSI5_GenerateSyncPulse(void) {\n    \u002F\u002F Sync pulse characteristics:\n    \u002F\u002F - Current drop from 7mA to 2mA\n    \u002F\u002F - Duration: ~10 μs\n    \u002F\u002F - Triggers all sensors to transmit\n\n    \u002F\u002F Set low current (sync pulse start)\n    PSI5_SetBusCurrent(PSI5_CURRENT_SYNC_LOW);\n\n    \u002F\u002F Sync pulse duration (10 μs typical)\n    DelayUs(10);\n\n    \u002F\u002F Return to normal current\n    PSI5_SetBusCurrent(PSI5_CURRENT_NORMAL);\n\n    \u002F\u002F Sensors will now transmit in their time slots\n    PSI5_StartReception();\n}\n```\n\n### Manchester Decoder\n```c\n\u002F\u002F Manchester decoder for PSI5 data\ntypedef struct {\n    uint8_t state;             \u002F\u002F Decoder state\n    uint32_t bitStream;        \u002F\u002F Accumulated bits\n    uint8_t bitCount;          \u002F\u002F Bits decoded\n    uint32_t lastEdgeTime;     \u002F\u002F Timestamp of last edge\n} Manchester_Decoder_t;\n\nstatic Manchester_Decoder_t decoder = {0};\n\nvoid PSI5_ProcessEdge(bool rising) {\n    uint32_t currentTime = GetMicroseconds();\n    uint32_t edgeDelta = currentTime - decoder.lastEdgeTime;\n\n    \u002F\u002F Bit period = 1 \u002F dataRate\n    \u002F\u002F For 125 kbps: 8 μs per bit\n    uint32_t bitPeriod = 1000000 \u002F psi5Config.dataRate;\n    uint32_t halfBit = bitPeriod \u002F 2;\n\n    \u002F\u002F Manchester decoding:\n    \u002F\u002F Rising edge in middle of bit period = '1'\n    \u002F\u002F Falling edge in middle of bit period = '0'\n\n    if (edgeDelta > halfBit - 1 && edgeDelta \u003C halfBit + 1) {\n        \u002F\u002F Edge at half-bit time (mid-bit transition)\n        decoder.bitStream \u003C\u003C= 1;\n\n        if (rising) {\n            decoder.bitStream |= 1;  \u002F\u002F Rising = logic '1'\n        }\n        \u002F\u002F Falling = logic '0' (already shifted in 0)\n\n        decoder.bitCount++;\n\n        \u002F\u002F Complete frame? (10 or 16 bits + start\u002Fstop)\n        if (decoder.bitCount >= 12) {\n            PSI5_ProcessFrame(decoder.bitStream, decoder.bitCount);\n            decoder.bitCount = 0;\n            decoder.bitStream = 0;\n        }\n    }\n\n    decoder.lastEdgeTime = currentTime;\n}\n```\n\n### Frame Decoding and CRC Verification\n```c\n\u002F\u002F PSI5 data frame structure\ntypedef struct {\n    bool valid;\n    uint8_t sensorId;          \u002F\u002F Which sensor (0-2)\n    uint16_t data;             \u002F\u002F 10 or 16 bits\n    uint8_t crc;               \u002F\u002F 2 or 3 bits\n    bool crcValid;\n    uint8_t errorCode;         \u002F\u002F Sensor diagnostic code\n} PSI5_Frame_t;\n\nvoid PSI5_ProcessFrame(uint32_t rawFrame, uint8_t bitCount) {\n    PSI5_Frame_t frame = {0};\n\n    \u002F\u002F Extract start bit\n    if (!(rawFrame & (1 \u003C\u003C (bitCount - 1)))) {\n        LogError(\"PSI5 missing start bit\");\n        return;\n    }\n\n    \u002F\u002F Extract data (10 or 16 bits)\n    uint8_t dataLen = (bitCount == 12) ? 10 : 16;\n    frame.data = (rawFrame >> 3) & ((1 \u003C\u003C dataLen) - 1);\n\n    \u002F\u002F Extract CRC (2 or 3 bits)\n    uint8_t crcLen = (bitCount == 12) ? 2 : 3;\n    frame.crc = (rawFrame >> 1) & ((1 \u003C\u003C crcLen) - 1);\n\n    \u002F\u002F Extract stop bit\n    if (rawFrame & 0x01) {\n        LogError(\"PSI5 missing stop bit\");\n        return;\n    }\n\n    \u002F\u002F Verify CRC\n    frame.crcValid = PSI5_VerifyCRC(frame.data, dataLen, frame.crc);\n\n    if (frame.crcValid) {\n        frame.valid = true;\n\n        \u002F\u002F Determine which sensor sent this frame (by time slot)\n        frame.sensorId = PSI5_IdentifySensor();\n\n        \u002F\u002F Process sensor data\n        PSI5_ProcessSensorData(&frame);\n    } else {\n        LogWarning(\"PSI5 CRC error\");\n        PSI5_IncrementErrorCounter(frame.sensorId);\n    }\n}\n\n\u002F\u002F PSI5 CRC calculation (2-bit or 3-bit)\nbool PSI5_VerifyCRC(uint16_t data, uint8_t dataLen, uint8_t receivedCRC) {\n    uint8_t calculatedCRC;\n\n    if (dataLen == 10) {\n        \u002F\u002F 2-bit CRC: XOR of bit pairs\n        calculatedCRC = 0;\n        for (uint8_t i = 0; i \u003C 10; i += 2) {\n            calculatedCRC ^= ((data >> i) & 0x03);\n        }\n        calculatedCRC &= 0x03;\n    } else {\n        \u002F\u002F 3-bit CRC polynomial: x^3 + x + 1\n        calculatedCRC = 0;\n        for (int8_t i = dataLen - 1; i >= 0; i--) {\n            uint8_t bit = (data >> i) & 0x01;\n            uint8_t msb = (calculatedCRC >> 2) & 0x01;\n\n            calculatedCRC = ((calculatedCRC \u003C\u003C 1) | bit) & 0x07;\n\n            if (msb) {\n                calculatedCRC ^= 0x03;  \u002F\u002F Polynomial x + 1\n            }\n        }\n    }\n\n    return (calculatedCRC == receivedCRC);\n}\n```\n\n### Airbag Sensor Data Processing\n```c\n\u002F\u002F Airbag sensor specific processing\ntypedef struct {\n    int16_t acceleration_mg;   \u002F\u002F Acceleration in milli-g\n    uint8_t temperature;       \u002F\u002F Temperature in °C\n    uint8_t statusFlags;       \u002F\u002F Diagnostic status\n    bool sensorOK;\n} Airbag_SensorData_t;\n\nvoid PSI5_ProcessAirbagSensor(const PSI5_Frame_t* frame) {\n    Airbag_SensorData_t sensorData = {0};\n\n    \u002F\u002F 16-bit data format for airbag sensor:\n    \u002F\u002F [15:14] - Status flags (2 bits)\n    \u002F\u002F [13:2]  - Acceleration data (12 bits, signed)\n    \u002F\u002F [1:0]   - Temperature (2 MSBs)\n\n    \u002F\u002F Extract status flags\n    sensorData.statusFlags = (frame->data >> 14) & 0x03;\n\n    \u002F\u002F Extract acceleration (12-bit signed)\n    int16_t rawAccel = (frame->data >> 2) & 0xFFF;\n\n    \u002F\u002F Convert to signed (two's complement)\n    if (rawAccel & 0x800) {\n        rawAccel |= 0xF000;  \u002F\u002F Sign extend\n    }\n\n    \u002F\u002F Convert to milli-g (range: -100g to +100g)\n    sensorData.acceleration_mg = (rawAccel * 200000) \u002F 4096;\n\n    \u002F\u002F Extract temperature (full value via slow channel)\n    sensorData.temperature = (frame->data & 0x03) \u003C\u003C 6;\n\n    \u002F\u002F Check sensor health\n    sensorData.sensorOK = (sensorData.statusFlags == 0);\n\n    \u002F\u002F Trigger airbag algorithm\n    if (!sensorData.sensorOK) {\n        LogError(\"Airbag sensor %d fault: 0x%02X\",\n                 frame->sensorId, sensorData.statusFlags);\n    }\n\n    Airbag_ProcessAcceleration(\n        frame->sensorId,\n        sensorData.acceleration_mg\n    );\n}\n```\n\n### Sensor Power Management\n```c\n\u002F\u002F PSI5 provides power to sensors via same 2-wire interface\ntypedef struct {\n    uint16_t voltageSupply_mV; \u002F\u002F 8000-18000 mV\n    uint16_t currentDraw_mA;   \u002F\u002F Per sensor\n    uint8_t sensorCount;\n    uint16_t totalPower_mW;\n} PSI5_PowerBudget_t;\n\nbool PSI5_CheckPowerBudget(PSI5_PowerBudget_t* budget) {\n    \u002F\u002F Calculate total current\n    uint16_t totalCurrent = budget->currentDraw_mA * budget->sensorCount;\n\n    \u002F\u002F Add overhead for communication\n    totalCurrent += 5;  \u002F\u002F 5mA overhead\n\n    \u002F\u002F Calculate total power\n    budget->totalPower_mW =\n        (budget->voltageSupply_mV * totalCurrent) \u002F 1000;\n\n    \u002F\u002F Check against ECU capability (typically 200mW per channel)\n    if (budget->totalPower_mW > 200) {\n        LogError(\"PSI5 power budget exceeded: %d mW\",\n                 budget->totalPower_mW);\n        return false;\n    }\n\n    return true;\n}\n```\n\n### Diagnostics and Error Handling\n```c\n\u002F\u002F PSI5 sensor diagnostics\ntypedef struct {\n    uint32_t frameCount;       \u002F\u002F Total frames received\n    uint32_t crcErrors;        \u002F\u002F CRC failures\n    uint32_t timeoutErrors;    \u002F\u002F Missing frames\n    uint32_t plausibilityErrors;\n    float errorRate;\n    bool sensorConnected;\n} PSI5_SensorDiag_t;\n\nstatic PSI5_SensorDiag_t sensorDiag[3] = {0};\n\nvoid PSI5_MonitorSensor(uint8_t sensorId) {\n    PSI5_SensorDiag_t* diag = &sensorDiag[sensorId];\n\n    \u002F\u002F Check for timeout (no frame in last 10ms)\n    uint32_t timeSinceFrame = GetMicroseconds() - lastFrameTime[sensorId];\n\n    if (timeSinceFrame > 10000) {\n        diag->timeoutErrors++;\n        diag->sensorConnected = false;\n        LogError(\"PSI5 sensor %d timeout\", sensorId);\n    } else {\n        diag->sensorConnected = true;\n    }\n\n    \u002F\u002F Calculate error rate\n    if (diag->frameCount > 0) {\n        diag->errorRate =\n            (float)(diag->crcErrors + diag->plausibilityErrors) \u002F\n            (float)diag->frameCount;\n    }\n\n    \u002F\u002F Report diagnostics to safety monitor\n    if (diag->errorRate > 0.01) {  \u002F\u002F 1% threshold\n        Airbag_ReportSensorFault(\n            sensorId,\n            AIRBAG_FAULT_HIGH_ERROR_RATE\n        );\n    }\n\n    if (!diag->sensorConnected) {\n        Airbag_ReportSensorFault(\n            sensorId,\n            AIRBAG_FAULT_SENSOR_DISCONNECTED\n        );\n    }\n}\n```\n\n## Use Case: Multi-Sensor Airbag System\n\n### System Architecture\n```\nAirbag ECU (PSI5 Master)\n  |\n  +-- Front Left Sensor (Acceleration + Pressure)\n  +-- Front Right Sensor (Acceleration + Pressure)\n  +-- Side Impact Sensor (Acceleration)\n```\n\n### Configuration\n- Mode: PSI5 Mode 2 (synchronous time slots)\n- Data rate: 189 kbps\n- Sync period: 1 ms (1000 Hz update rate)\n- Time slot: 250 μs per sensor\n- Frame format: 16-bit data + 3-bit CRC\n\n### Time Slot Allocation\n| Time (μs) | Sensor       | Data Content                    |\n|-----------|--------------|----------------------------------|\n| 0-10      | Sync Pulse   | Triggers all sensors            |\n| 10-260    | Sensor 1     | Front left acceleration\u002Fpressure|\n| 260-510   | Sensor 2     | Front right accel\u002Fpressure      |\n| 510-760   | Sensor 3     | Side impact acceleration        |\n| 760-1000  | Idle         | Processing time                 |\n\n### Safety Requirements (ASIL-D)\n- CRC verification on every frame\n- Timeout detection (\u003C2ms)\n- Dual-sensor voting for critical decisions\n- Continuous self-test of communication\n- Diagnostic counters reported to safety manager\n\n## Deliverables\n\n- PSI5 network design specification\n- ECU interface implementation (C code)\n- Sensor calibration data\n- Safety analysis (FMEA)\n- Integration test specifications\n- Timing verification report\n- EMC test results\n\n## Common Issues and Solutions\n\n### Frame Synchronization Loss\n- Verify sync pulse timing and amplitude\n- Check current mode signaling levels\n- Ensure proper Manchester encoding\n- Validate time slot configuration\n\n### CRC Errors\n- Check for EMI on sensor wiring\n- Verify power supply stability\n- Improve cable shielding\u002Frouting\n- Validate CRC algorithm implementation\n\n### Sensor Timeout\n- Check sensor power supply voltage\n- Verify 2-wire connection integrity\n- Monitor current consumption\n- Test sensor at temperature extremes\n\n### Data Plausibility Issues\n- Validate sensor calibration\n- Check for mechanical mounting issues\n- Verify sign bit interpretation\n- Compare with other sensors (voting)\n\n## SENT Protocol\n\n## Core Competencies\n\nExpert in SENT protocol for cost-effective digital sensor communication.\n\n### Protocol Characteristics\n- Single-wire unidirectional communication (sensor to ECU)\n- No clock signal required (self-clocking)\n- Built-in CRC for error detection\n- Support for slow channel (configuration\u002Fdiagnostics)\n- Low electromagnetic emissions\n- Typical tick time: 3 μs (333 kHz)\n\n### Physical Layer\n- Voltage levels: 0V (low) \u002F 5V (high)\n- Current mode: 0-20 mA or voltage mode\n- Single wire + ground reference\n- Operating temperature: -40°C to +150°C\n- Low power consumption: \u003C10 mW typical\n\n### Frame Structure\n```\n|\u003C----------- SENT Frame ------------>|\n| Sync | Status | Data1-6 | CRC | Pause |\n| 56T  | 4b+4b  | 6x12b   | 4b  | ≥12T  |\n```\n\n- Sync pulse: 56 nominal tick periods (±25%)\n- Status nibble: 4 bits (sensor status\u002Fdiagnostic)\n- Data nibbles: Up to 6 nibbles (12-24 bits total data)\n- CRC: 4-bit checksum\n- Pause period: Variable (min 12 ticks)\n\n### SENT Frame Types\n- **Fast Channel**: Main sensor data (every frame)\n- **Slow Channel**: Configuration\u002Fdiagnostic data (transmitted over multiple frames)\n- **Short Serial Message (SSM)**: Enhanced diagnostic data\n\n### Tick Encoding\n- Each nibble encoded as pulse width (12-27 ticks)\n- Nibble value 0: 12 ticks\n- Nibble value 1: 13 ticks\n- ...\n- Nibble value 15: 27 ticks\n\n## Design Approach\n\n1. Sensor Integration\n   - Select appropriate SENT-capable sensor\n   - Configure tick frequency\n   - Define data format (12\u002F16\u002F24 bit)\n   - Plan slow channel usage\n\n2. ECU Receiver Implementation\n   - Configure input capture timer\n   - Implement edge detection\n   - Decode nibbles from pulse widths\n   - Verify CRC and status\n\n3. Data Processing\n   - Apply sensor calibration\n   - Handle error conditions\n   - Monitor diagnostic data\n   - Implement plausibility checks\n\n4. Validation and Testing\n   - Verify tick timing accuracy\n   - Inject bit errors for CRC validation\n   - Test temperature extremes\n   - Validate EMC immunity\n\n## Implementation Examples\n\n### SENT Receiver Initialization\n```c\n\u002F\u002F SENT receiver configuration\ntypedef struct {\n    uint32_t tickTimeNs;       \u002F\u002F Nominal tick time (ns)\n    uint8_t tickTolerance;     \u002F\u002F Tolerance percentage (±25%)\n    uint8_t dataNibbles;       \u002F\u002F Number of data nibbles (1-6)\n    bool slowChannelEnable;    \u002F\u002F Enable slow channel decode\n    bool pauseValidation;      \u002F\u002F Validate pause pulse\n} SENT_Config_t;\n\nvoid SENT_Init(const SENT_Config_t* config) {\n    \u002F\u002F Configure input capture timer\n    \u002F\u002F Timer resolution should be \u003C100ns for accurate tick measurement\n    TIM_SetPrescaler(config->tickTimeNs \u002F 100);  \u002F\u002F 100ns resolution\n\n    \u002F\u002F Configure edge detection (falling edge)\n    TIM_SetCaptureEdge(TIM_CAPTURE_FALLING);\n\n    \u002F\u002F Enable input capture interrupt\n    TIM_EnableCaptureInterrupt();\n\n    \u002F\u002F Store configuration\n    sentConfig = *config;\n\n    \u002F\u002F Reset decoder state\n    SENT_ResetDecoder();\n}\n```\n\n### SENT Frame Decoding\n```c\n\u002F\u002F SENT frame structure\ntypedef struct {\n    bool valid;\n    uint8_t status;            \u002F\u002F Status nibble\n    uint32_t data;             \u002F\u002F Combined data nibbles\n    uint8_t crc;\n    bool crcValid;\n    uint16_t errorCount;\n} SENT_Frame_t;\n\n\u002F\u002F State machine for SENT decoding\ntypedef enum {\n    SENT_STATE_WAIT_SYNC,\n    SENT_STATE_STATUS,\n    SENT_STATE_DATA,\n    SENT_STATE_CRC,\n    SENT_STATE_PAUSE\n} SENT_State_t;\n\nstatic SENT_State_t sentState = SENT_STATE_WAIT_SYNC;\nstatic uint32_t lastEdgeTime = 0;\nstatic uint8_t nibbleIndex = 0;\nstatic SENT_Frame_t currentFrame;\n\n\u002F\u002F Input capture interrupt handler\nvoid TIM_CaptureInterrupt(void) {\n    uint32_t currentTime = TIM_GetCaptureValue();\n    uint32_t pulseTicks = (currentTime - lastEdgeTime) \u002F sentConfig.tickTimeNs;\n    lastEdgeTime = currentTime;\n\n    switch (sentState) {\n        case SENT_STATE_WAIT_SYNC:\n            \u002F\u002F Sync pulse is 56 ticks ±25%\n            if (pulseTicks >= 42 && pulseTicks \u003C= 70) {\n                \u002F\u002F Sync detected, calibrate tick time\n                uint32_t measuredTickTime =\n                    (currentTime - lastEdgeTime) \u002F 56;\n                SENT_UpdateTickTime(measuredTickTime);\n\n                sentState = SENT_STATE_STATUS;\n                nibbleIndex = 0;\n                currentFrame.valid = false;\n                currentFrame.errorCount = 0;\n            }\n            break;\n\n        case SENT_STATE_STATUS:\n            \u002F\u002F Decode status nibble\n            currentFrame.status = SENT_DecodeNibble(pulseTicks);\n            sentState = SENT_STATE_DATA;\n            nibbleIndex = 0;\n            break;\n\n        case SENT_STATE_DATA:\n            \u002F\u002F Decode data nibbles\n            uint8_t nibble = SENT_DecodeNibble(pulseTicks);\n\n            if (nibble == 0xFF) {  \u002F\u002F Invalid nibble\n                currentFrame.errorCount++;\n                sentState = SENT_STATE_WAIT_SYNC;\n                break;\n            }\n\n            \u002F\u002F Accumulate data nibbles\n            currentFrame.data |= ((uint32_t)nibble \u003C\u003C (nibbleIndex * 4));\n            nibbleIndex++;\n\n            \u002F\u002F All data nibbles received?\n            if (nibbleIndex >= sentConfig.dataNibbles) {\n                sentState = SENT_STATE_CRC;\n            }\n            break;\n\n        case SENT_STATE_CRC:\n            \u002F\u002F Decode and verify CRC\n            currentFrame.crc = SENT_DecodeNibble(pulseTicks);\n            currentFrame.crcValid = SENT_VerifyCRC(&currentFrame);\n\n            if (currentFrame.crcValid) {\n                currentFrame.valid = true;\n                SENT_ProcessFrame(&currentFrame);\n            } else {\n                currentFrame.errorCount++;\n            }\n\n            sentState = SENT_STATE_PAUSE;\n            break;\n\n        case SENT_STATE_PAUSE:\n            \u002F\u002F Wait for pause period (≥12 ticks)\n            if (pulseTicks >= 12) {\n                sentState = SENT_STATE_WAIT_SYNC;\n            }\n            break;\n    }\n}\n\n\u002F\u002F Decode nibble from pulse width\nuint8_t SENT_DecodeNibble(uint32_t pulseTicks) {\n    \u002F\u002F Nibble value = pulseTicks - 12\n    if (pulseTicks >= 12 && pulseTicks \u003C= 27) {\n        return pulseTicks - 12;\n    }\n    return 0xFF;  \u002F\u002F Invalid\n}\n```\n\n### CRC Calculation (SAE J2716)\n```c\n\u002F\u002F SENT CRC-4 calculation (recommended checksum)\nuint8_t SENT_CalculateCRC(const SENT_Frame_t* frame) {\n    uint8_t nibbles[8];\n    nibbles[0] = frame->status & 0x0F;\n\n    \u002F\u002F Extract data nibbles\n    for (uint8_t i = 0; i \u003C sentConfig.dataNibbles; i++) {\n        nibbles[i + 1] = (frame->data >> (i * 4)) & 0x0F;\n    }\n\n    \u002F\u002F CRC-4 with seed value 5\n    uint8_t crc = 5;\n\n    for (uint8_t i = 0; i \u003C sentConfig.dataNibbles + 1; i++) {\n        crc ^= nibbles[i];\n\n        for (uint8_t bit = 0; bit \u003C 4; bit++) {\n            if (crc & 0x08) {\n                crc = ((crc \u003C\u003C 1) ^ 0x13) & 0x0F;\n            } else {\n                crc = (crc \u003C\u003C 1) & 0x0F;\n            }\n        }\n    }\n\n    return crc;\n}\n\nbool SENT_VerifyCRC(const SENT_Frame_t* frame) {\n    uint8_t calculatedCRC = SENT_CalculateCRC(frame);\n    return (calculatedCRC == frame->crc);\n}\n```\n\n### Slow Channel Decoding\n```c\n\u002F\u002F Slow channel transmitted over multiple frames\ntypedef struct {\n    uint8_t messageId;         \u002F\u002F 8-bit message identifier\n    uint16_t data;             \u002F\u002F 12-bit data value\n    bool valid;\n} SENT_SlowChannel_t;\n\nstatic uint8_t slowChannelNibbles[6];\nstatic uint8_t slowChannelIndex = 0;\n\nvoid SENT_DecodeSlowChannel(uint8_t statusNibble) {\n    \u002F\u002F Slow channel data is in status nibble bits\n    uint8_t slowNibble = (statusNibble >> 2) & 0x03;  \u002F\u002F 2 bits per frame\n\n    slowChannelNibbles[slowChannelIndex++] = slowNibble;\n\n    \u002F\u002F Complete slow channel message after 16 frames\n    if (slowChannelIndex >= 16) {\n        SENT_SlowChannel_t slowMsg;\n\n        \u002F\u002F Reconstruct 8-bit message ID\n        slowMsg.messageId = 0;\n        for (uint8_t i = 0; i \u003C 4; i++) {\n            slowMsg.messageId |= (slowChannelNibbles[i] \u003C\u003C (i * 2));\n        }\n\n        \u002F\u002F Reconstruct 12-bit data\n        slowMsg.data = 0;\n        for (uint8_t i = 0; i \u003C 6; i++) {\n            slowMsg.data |= (slowChannelNibbles[i + 4] \u003C\u003C (i * 2));\n        }\n\n        \u002F\u002F Validate slow channel CRC\n        slowMsg.valid = SENT_VerifySlowChannelCRC(&slowMsg);\n\n        if (slowMsg.valid) {\n            SENT_ProcessSlowChannel(&slowMsg);\n        }\n\n        slowChannelIndex = 0;\n    }\n}\n```\n\n### Sensor Data Conversion\n```c\n\u002F\u002F Convert raw SENT data to physical value\ntypedef struct {\n    float gain;                \u002F\u002F Scaling factor\n    float offset;              \u002F\u002F Offset value\n    uint8_t resolution;        \u002F\u002F Bits (12, 16, 24)\n    const char* unit;          \u002F\u002F Unit string\n} SENT_Calibration_t;\n\nfloat SENT_ConvertToPhysical(\n    uint32_t rawData,\n    const SENT_Calibration_t* cal\n) {\n    \u002F\u002F Calculate maximum raw value based on resolution\n    uint32_t maxRaw = (1 \u003C\u003C cal->resolution) - 1;\n\n    \u002F\u002F Linear conversion: Physical = (Raw \u002F MaxRaw) * Gain + Offset\n    float normalized = (float)rawData \u002F (float)maxRaw;\n    float physical = (normalized * cal->gain) + cal->offset;\n\n    return physical;\n}\n\n\u002F\u002F Example: Temperature sensor\nvoid SENT_ProcessTemperatureSensor(const SENT_Frame_t* frame) {\n    static const SENT_Calibration_t tempCal = {\n        .gain = 200.0,         \u002F\u002F -40°C to +160°C range\n        .offset = -40.0,\n        .resolution = 12,\n        .unit = \"°C\"\n    };\n\n    \u002F\u002F Extract 12-bit data (first 3 nibbles)\n    uint32_t rawTemp = frame->data & 0xFFF;\n\n    \u002F\u002F Convert to physical value\n    float temperature = SENT_ConvertToPhysical(rawTemp, &tempCal);\n\n    \u002F\u002F Check status nibble for sensor faults\n    if (frame->status & 0x08) {\n        LogWarning(\"Temperature sensor fault detected\");\n    }\n\n    LogInfo(\"Temperature: %.1f %s\", temperature, tempCal.unit);\n}\n```\n\n### Error Detection and Handling\n```c\n\u002F\u002F SENT error statistics\ntypedef struct {\n    uint32_t totalFrames;\n    uint32_t crcErrors;\n    uint32_t timingErrors;\n    uint32_t statusWarnings;\n    float errorRate;\n} SENT_Statistics_t;\n\nstatic SENT_Statistics_t sentStats = {0};\n\nvoid SENT_ProcessFrame(const SENT_Frame_t* frame) {\n    sentStats.totalFrames++;\n\n    \u002F\u002F Check CRC\n    if (!frame->crcValid) {\n        sentStats.crcErrors++;\n        LogWarning(\"SENT CRC error\");\n        return;\n    }\n\n    \u002F\u002F Check status nibble for sensor warnings\n    if (frame->status & 0x08) {\n        sentStats.statusWarnings++;\n        \u002F\u002F Handle specific error codes\n        switch (frame->status & 0x07) {\n            case 0x1: LogWarning(\"Sensor temperature out of range\"); break;\n            case 0x2: LogWarning(\"Sensor calibration error\"); break;\n            case 0x3: LogWarning(\"Sensor hardware fault\"); break;\n            default:  LogWarning(\"Unknown sensor status\"); break;\n        }\n    }\n\n    \u002F\u002F Calculate error rate\n    sentStats.errorRate = (float)(sentStats.crcErrors + sentStats.timingErrors) \u002F\n                         (float)sentStats.totalFrames;\n\n    \u002F\u002F Trigger diagnostic if error rate too high\n    if (sentStats.errorRate > 0.01) {  \u002F\u002F 1% threshold\n        LogError(\"SENT error rate too high: %.2f%%\", sentStats.errorRate * 100);\n    }\n}\n```\n\n## Use Case: Throttle Position Sensor\n\n### Sensor Configuration\n- Tick frequency: 333 kHz (3 μs tick time)\n- Data format: 12-bit position (0-4095)\n- Range: 0° to 90° throttle angle\n- Update rate: 1 kHz (1000 frames\u002Fsec)\n- Slow channel: Temperature and diagnostics\n\n### Data Frame Format\n```\nStatus nibble: [Error | Reserved | SlowBit1 | SlowBit0]\nData nibbles:  [Position[11:8] | Position[7:4] | Position[3:0]]\n```\n\n### Safety Features\n- CRC-4 checksum on every frame\n- Status nibble indicates sensor health\n- Plausibility check against expected range\n- Timeout detection (missing frames)\n- Slow channel for temperature monitoring\n\n### Example Application Code\n```c\n\u002F\u002F Throttle position sensor handler\nvoid Application_ProcessThrottle(const SENT_Frame_t* frame) {\n    if (!frame->valid) return;\n\n    \u002F\u002F Extract 12-bit position\n    uint16_t rawPosition = frame->data & 0xFFF;\n\n    \u002F\u002F Convert to angle (0-90°)\n    float angle = (float)rawPosition \u002F 4095.0 * 90.0;\n\n    \u002F\u002F Plausibility check\n    if (angle > 95.0) {\n        LogError(\"Throttle position implausible: %.1f°\", angle);\n        return;\n    }\n\n    \u002F\u002F Update throttle position\n    SetThrottlePosition(angle);\n\n    \u002F\u002F Process slow channel (every 16 frames)\n    SENT_DecodeSlowChannel(frame->status);\n}\n```\n\n## Deliverables\n\n- SENT sensor selection guide\n- Receiver implementation (C code)\n- Calibration data format\n- Error handling strategy\n- Integration test specifications\n- Signal timing verification\n- EMC test results\n\n## Common Issues and Solutions\n\n### Tick Time Drift\n- Monitor sync pulse for tick calibration\n- Compensate for temperature effects\n- Verify sensor clock stability\n- Use adaptive tick time measurement\n\n### CRC Failures\n- Check for EMI\u002Fnoise on signal line\n- Verify ground connection quality\n- Add low-pass filter on input\n- Shield sensor cable if necessary\n\n### Missing Frames\n- Check sensor power supply stability\n- Verify interrupt priority and latency\n- Monitor for software blocking\n- Validate pause period handling\n\n### Incorrect Data Values\n- Verify nibble decoding algorithm\n- Check data byte order\u002Fendianness\n- Validate calibration parameters\n- Test with known sensor inputs",{"name":5,"tags":24,"source":26,"license":15,"description":27,"imported_at":28,"source_path":29,"source_repository":30},[25,5],"automotive","https:\u002F\u002Fgithub.com\u002Fpangzhenying2025\u002Fhermes-automotive-skills","Expert skill in BroadR-Reach automotive Ethernet physical layer (100BASE-T1) for cost-effective high-speed networking over single twisted pair. Covers 8 topics across automotive-protocols domain.\n","2026-09-20","skills\u002Fautomotive-protocols\u002FSKILL.md","pangzhenying2025\u002Fhermes-automotive-skills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fautomotive\u002Fautomotive-protocols","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill automotive-protocols",{"tool":43,"command":44},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill automotive-protocols",{"tool":46,"command":47},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill automotive-protocols","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fautomotive\u002Fautomotive-protocols\u002FSKILL.md",true,[],[52,60,67,74,81,88],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":59},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":59},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":59},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":59},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":59},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":59},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]