Spacelight
HW
OLED controller: SSD1309
Compile
Prerequisite Software
Compile Procedure
- create a generate dir(Z:\generated)
- run command prompt as administrator, and create a directory symbolic link under spacelight\cubemx:
mklink /d generated Z:\generated
- update the generate_dir(which stores all the files that cubemx generated) inside generate_code.cmd
- run generate_code.cmd, the script will
- generate the IAR project & code and include the STM32F4 CMSIS lib
- patch the generated code to call user written code
- open cubemx\generated\project\EWARM\Project.eww in IAR
- compile and run
Code Structure
- app: user written code for the project
- cubemx
- generate_code.cmd: script to generate the IAR project
- spacelight.ioc: cubemx config file
- .extSettings: additional IAR project setting
- lib
- u8g2: monochrome graphics library
GUI Block Diagram
requirementDiagram
requirement Flashlight {
id: 2
text: main GUI
risk: medium
verifymethod: test
}
interfaceRequirement EffectMode {
id: 2
text: menu "Effect Mode"
risk: medium
verifymethod: test
}
functionalRequirement LampCount {
id: 3
text: menu "Lamp Count"
risk: low
verifymethod: test
}
functionalRequirement DMXAddr {
id: 4
text: menu "Dmx Addr"
risk: low
verifymethod: test
}
interfaceRequirement DMXMode {
id: 5
text: menu "DMX Mode"
risk: medium
verifymethod: test
}
interfaceRequirement Wireless {
id: 6
text: menu "Wireless"
risk: medium
verifymethod: test
}
functionalRequirement CCT {
id: 2.1
text: menu "CCT"
risk: low
verifymethod: test
}
functionalRequirement Blink {
id: 2.2
text: menu "Blink"
risk: low
verifymethod: test
}
functionalRequirement Breather {
id: 2.3
text: menu "Breather"
risk: low
verifymethod: test
}
functionalRequirement Lightning {
id: 2.4
text: menu "Lightning"
risk: medium
verifymethod: test
}
functionalRequirement Drift {
id: 2.5
text: menu "CCT Drift"
risk: high
verifymethod: test
}
functionalRequirement Fire {
id: 2.6
text: menu "Fire"
risk: low
verifymethod: test
}
functionalRequirement LockTime {
id: 2
text: menu "Lock Time"
risk: medium
verifymethod: test
}
functionalRequirement Version {
id: 2
text: menu "Version"
risk: medium
verifymethod: test
}
EffectMode - contains -> CCT
EffectMode - contains -> Blink
EffectMode - contains -> Breather
EffectMode - contains -> Lightning
EffectMode - contains -> Drift
EffectMode - contains -> Fire
Flashlight - contains -> EffectMode
Flashlight - contains -> LampCount
Flashlight - contains -> DMXAddr
Flashlight - contains -> DMXMode
Flashlight - contains -> Wireless
Flashlight - contains -> LockTime
Flashlight - contains -> Version
Menu Item
- CCT Mode
- Effect Mode
- Lamp Count
- DMX Addr
- DMX Mode
- Wireless
- Lock Time
- Version
- Exit
Workload components
- CMSIS Lib
- RTOS: Azure RTOS(ThreadX)
- GUI: u8g2
- Font library embedding
- Icon embedding
- DMX512 protocol stack
- Algorithm
- Blink
- Breather
- Lightning
- CCT Drift
- Fire
Peripherals
The project use the following IOMUX & peripherals:
GPIO
GPIO Input
GPIO Output
TIM
Thread design
- GUI thread: draw main interface
- worker thread:
- controller thread: handle key input, and