# spaceteddy/cc1101 architecture

> Architecture diagram of the GitHub repository spaceteddy/cc1101, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spaceteddy/cc1101
- Repository: https://github.com/spaceteddy/cc1101

## Overview

##### Component Details

Hardware Layer:
- CC1101 RF Module at the bottom
- Physical pins (SI, SO, CS, SCLK, GDO2, GDO0, VDD, GND)

Driver Layer (Middle):
- Create two parallel implementations:
Left side: Arduino Implementation
- cc1100_arduino.h/cpp
- EEPROM Configuration Storage

Right side: Raspberry Pi Implementation
- cc1100_raspi.h/cpp
- WiringPi Dependency

Application Layer (Top):
- Demo Applications
Left side: Arduino Examples
- Tx_demo
- Rx_demo
- Rx_demo_WOR

Right side: Raspberry Pi Examples
- TX_Demo
- RX_Demo
- RX_Demo_WOR

##### Connection and Data Flow

- Physical connections between CC1101 and platforms (SPI bus)
- Data flow between layers
- Configuration flow
- RF communication paths

##### Special Elements

Create dedicated sections for:
- RF Packet Structure (show the byte layout)
- [pkt_len][rx_addr][tx_addr][payload data]
- Modulation modes
- ISM frequency bands
- Address settings

##### Additional Details

- Voltage levels (3.3V operation)
- Pin mapping tables for both platforms
- Supported modulation modes
- Frequency bands

##### Implementation Notes

Callouts for:
- EEPROM configuration requirement for Arduino
- WiringPi dependency for Raspberry Pi
- Maximum payload size limitations
- Address broadcasting capabilities

- The dual-platform nature of the library
- Hardware interfacing requirements
- Clear separation between hardware, driver, and application layers
- Configuration flows and options
- RF packet structure and communication patterns

Remember to:
- Keep the hardware interface section detailed but clear
- Both Arduino and Raspberry Pi paths clearly separated
- Common RF module interface
- Version information and support notes

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef hardware fill:#f9f,stroke:#333,stroke-width:2px
    classDef driver fill:#adf,stroke:#333,stroke-width:2px
    classDef app fill:#dfa,stroke:#333,stroke-width:2px
    classDef config fill:#fda,stroke:#333,stroke-width:2px
    classDef rf fill:#faf,stroke:#333,stroke-width:2px
    
    subgraph Application_Layer
        subgraph Arduino_Apps
            ATX["TX Demo"]:::app
            ARX["RX Demo"]:::app
            AWOR["RX WOR Demo"]:::app
        end
        
        subgraph RPi_Apps
            RTX["TX Demo"]:::app
            RRX["RX Demo"]:::app
            RWOR["RX WOR Demo"]:::app
        end
    end
    
    subgraph Driver_Layer
        subgraph Arduino_Driver
            AD["CC1100 Arduino Driver"]:::driver
            EEPROM["EEPROM Config"]:::config
        end
        
        subgraph RPi_Driver
            RD["CC1100 Raspberry Pi Driver"]:::driver
            WPi["WiringPi Library"]:::driver
        end
    end
    
    subgraph Hardware_Layer
        CC1101["CC1101 RF Module"]:::hardware
        
        subgraph Pins
            SI["SI Pin"]:::hardware
            SO["SO Pin"]:::hardware
            CS["CS Pin"]:::hardware
            SCLK["SCLK Pin"]:::hardware
            GDO2["GDO2 Pin"]:::hardware
            GDO0["GDO0 Pin"]:::hardware
            VDD["VDD"]:::hardware
            GND["GND"]:::hardware
        end
    end
    
    %% RF Packet Structure
    subgraph RF_Packet
        PKT["[pkt_len][rx_addr][tx_addr][payload]"]:::rf
    end
    
    %% Connections
    ATX --> AD
    ARX --> AD
    AWOR --> AD
    RTX --> RD
    RRX --> RD
    RWOR --> RD
    
    AD --> EEPROM
    RD --> WPi
    
    AD --> CC1101
    RD --> CC1101
    
    CC1101 --> SI
    CC1101 --> SO
    CC1101 --> CS
    CC1101 --> SCLK
    CC1101 --> GDO2
    CC1101 --> GDO0
    CC1101 --> VDD
    CC1101 --> GND
    
    %% Click events
    click ATX "https://github.com/SpaceTeddy/CC1101/blob/master/examples/Arduino/Tx_demo/Tx_demo.ino"
    click ARX "https://github.com/SpaceTeddy/CC1101/blob/master/examples/Arduino/Rx_demo/Rx_demo.ino"
    click AWOR "https://github.com/SpaceTeddy/CC1101/blob/master/examples/Arduino/Rx_demo_WOR/Rx_demo_WOR.ino"
    click RTX "https://github.com/SpaceTeddy/CC1101/blob/master/examples/raspi/TX_Demo.cpp"
    click RRX "https://github.com/SpaceTeddy/CC1101/blob/master/examples/raspi/RX_Demo.cpp"
    click RWOR "https://github.com/SpaceTeddy/CC1101/blob/master/examples/raspi/RX_Demo_WOR.cpp"
    click AD "https://github.com/SpaceTeddy/CC1101/blob/master/cc1100_arduino.h"
    click RD "https://github.com/SpaceTeddy/CC1101/blob/master/cc1100_raspi.h"
    click EEPROM "https://github.com/SpaceTeddy/CC1101/blob/master/Tools/eeprom_create.py"
```
