# kayws426/freertos_c28x architecture

> Architecture diagram of the GitHub repository kayws426/freertos_c28x, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kayws426/freertos_c28x
- Repository: https://github.com/kayws426/freertos_c28x

## Overview

##### Main Components

a. Hardware Layer:
- Supported models (F28377S, F28034, F28069)
- Hardware interrupt controllers (PIE - Peripheral Interrupt Expander)

b. FreeRTOS Core Layer:
- Core components from the FreeRTOS directory:
- Task Management (tasks.c)
- Queue Management (queue.c)
- Timer Services (timers.c)
- Event Groups (event_groups.c)
- Management (list.c)

c. Port-Specific Layer:
- C28x port implementation (FreeRTOS/portable/CCS/c28x)
- Both C (port.c) and Assembly (porASM.asm) components

d. Driver Layer:
- Peripheral drivers (PWM, UART, SPI)
- SD Card and FAT filesystem support

e. Application Layer:
- Example applications (blinky, PWM, UART, SD card examples)

##### Relationships and Data Flow

- Interrupt flows (both kernel-aware and kernel-unaware)
- Task scheduling paths
- Hardware peripheral interactions
- Driver API calls

##### Architectural Notes

Callouts highlighting:
- Stack sharing between tasks and interrupts
- Critical section handling using IER
- Interrupt priority levels (INT1-INT5)
- Context switching boundaries

##### Implementation Details

Configuration parameters:
- portCRITICAL_INTERRUPT_MASK usage
- Stack configuration
- Interrupt priority assignments

Remember to include version information:
- FreeRTOS v9.0.0
- Compatible TI MCU families
- CCS v6.1.2 compatibility

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef hardware fill:#e6e6e6,stroke:#333
    classDef freertos fill:#b3d9ff,stroke:#333
    classDef port fill:#b3ffb3,stroke:#333
    classDef driver fill:#ffe6b3,stroke:#333
    classDef app fill:#ffff99,stroke:#333
    classDef interrupt fill:#ffb3b3,stroke:#333

    %% Hardware Layer
    subgraph Hardware
        MCU["TMS320 MCU Family"]
        PIE["Peripheral Interrupt Expander (PIE)"]
        F28377["F28377S"]
        F28034["F28034"]
        F28069["F28069"]
        
        MCU --> PIE
        MCU --> F28377
        MCU --> F28034
        MCU --> F28069
    end
    
    %% FreeRTOS Core Layer
    subgraph FreeRTOSCore
        Tasks["Task Management"]
        Queue["Queue Management"]
        Timers["Timer Services"]
        EventGroups["Event Groups"]
        List["List Management"]
    end

    %% Port-Specific Layer
    subgraph PortLayer
        PortC["Port.c Implementation"]
        PortASM["PortASM Assembly"]
        PortMacros["Port Macros"]
    end

    %% Driver Layer
    subgraph Drivers
        PWM["PWM Driver"]
        UART["UART Driver"]
        SPI["SPI Driver"]
        SDCard["SD Card Driver"]
        FAT["FAT Filesystem"]
    end

    %% Application Layer
    subgraph Applications
        Blinky["Blinky Examples"]
        PWMApp["PWM Example"]
        UARTApp["UART Example"]
        SDApp["SD Card Example"]
        FPUApp["FPU Example"]
    end

    %% Relationships
    PIE --> PortC
    PortC --> Tasks
    PortASM --> Tasks
    Tasks --> Queue
    Tasks --> Timers
    Tasks --> EventGroups
    Tasks --> List
    
    PWM --> PortC
    UART --> PortC
    SPI --> PortC
    SDCard --> SPI
    SDCard --> FAT
    
    Blinky --> Tasks
    PWMApp --> PWM
    UARTApp --> UART
    SDApp --> SDCard
    FPUApp --> PortC

    %% Click Events
    click Tasks "https://github.com/kayws426/freertos_c28x/blob/main/FreeRTOS/tasks.c"
    click Queue "https://github.com/kayws426/freertos_c28x/blob/main/FreeRTOS/queue.c"
    click Timers "https://github.com/kayws426/freertos_c28x/blob/main/FreeRTOS/timers.c"
    click EventGroups "https://github.com/kayws426/freertos_c28x/blob/main/FreeRTOS/event_groups.c"
    click List "https://github.com/kayws426/freertos_c28x/blob/main/FreeRTOS/list.c"
    click PortC "https://github.com/kayws426/freertos_c28x/blob/main/FreeRTOS/portable/CCS/c28x/port.c"
    click PortASM "https://github.com/kayws426/freertos_c28x/blob/main/FreeRTOS/portable/CCS/c28x/porASM.asm"
    click PortMacros "https://github.com/kayws426/freertos_c28x/blob/main/FreeRTOS/portable/CCS/c28x/portmacro.h"
    click PWM "https://github.com/kayws426/freertos_c28x/blob/main/examples/drivers/pwm.c"
    click UART "https://github.com/kayws426/freertos_c28x/blob/main/examples/drivers/uart.c"
    click SPI "https://github.com/kayws426/freertos_c28x/blob/main/examples/drivers/spi.c"
    click FAT "https://github.com/kayws426/freertos_c28x/tree/main/examples/libs/fatfs"
    click SDCard "https://github.com/kayws426/freertos_c28x/tree/main/examples/libs/sdcard_spi"
    click Blinky "https://github.com/kayws426/freertos_c28x/tree/main/examples/blinky_tms320f28377s"
    click PWMApp "https://github.com/kayws426/freertos_c28x/tree/main/examples/pwm_tms320f28377s"
    click UARTApp "https://github.com/kayws426/freertos_c28x/tree/main/examples/uart_f28377s"
    click SDApp "https://github.com/kayws426/freertos_c28x/tree/main/examples/sdcard_f28377s"
    click FPUApp "https://github.com/kayws426/freertos_c28x/tree/main/examples/fpu_f28377s"

    %% Style Applications
    class MCU,PIE,F28377,F28034,F28069 hardware
    class Tasks,Queue,Timers,EventGroups,List freertos
    class PortC,PortASM,PortMacros port
    class PWM,UART,SPI,SDCard,FAT driver
    class Blinky,PWMApp,UARTApp,SDApp,FPUApp app
```
