Welcome on your path to creating Flipper Zero Application!
Here are the few stuff to get started!
- Open application.fam.
- head to
appid="demo_app"
and change it to your own. - Open ./src/scenes/about/main.c.
- Update
#include <demo_app_icons.h>
into#include <{app_id}_icons.h>
.
If there is intelliSense error for missing variable, try rebuilding application. - For easier debugging, change
APP_NAME
in ./src/main.h to your own.
Here are the resources for developing applications for Flipper Zero:
- Flipper Zero Firmware Docs
- Flipper Zero code examples
- Lopaka, Graphics Editor for Embedded Devices
Note that Flipper Zero has screen dimension of128x64
.
f0-template
consists of following directories
.github
- Reserved for GitHub Actionsicons
- For generatingIcon
(Sprites) for use in GUI elementsscreenshots
- When uploaded to store, these are the Screenshots available from store pagesrc
- Where the C source is locatedsrc/main.c
- Where the main entrypoint is available.src/scenes
- Scene definitions for Scene Manager - Refer to Using SceneManager
application.fam
- Flipper Zero's application manifest file - Refer to this docsCHANGELOG.md
- When uploaded to store, these are the changelog available from store pageicon.png
- The Application Icon which is shown next to application name in Apps menu.
Warning
alpha channel of PNG is NOT supported. Make sure that background is white!
This directory is for generating Icon
struct which can be used for drawing sprites in flipper zero Canvas
.
It can be used as following:
- Put your
PNG
files into icons. - Build (
ufbt build
or anything triggers build job) at least once before use. - Import
{app_id}_icons.h
. - On
draw_callback
, draw Icon by callingcanvas_draw_icon(canvas, loc_x, loc_y, &I_{png_filename});
- Done!
This template implements SceneManager
, A "Scene" based framework for programming flipper zero GUIs.
The Scenes are defined via using macro: SCENE_ACTION
. By default, the f0-template
provides two example scenes
- Goto
./src/scenes/list.h
. - Add your own scene by using macro:
SCENE_ACTION
. (e.g. If you want to make new scene calledStore
, You should typeSCENE_ACTION(Store)
) - Implement
_on_enter
,_on_event
,_on_exit
,_get_view
,_alloc
,_free
accordingly. Refer to./src/scenes/home/main.c
for more info.
(F0 doesn't make sure the precendence of_on_exit
and_free
. Please make sure those two are independent by checking each other's free'd state) - Add headers to export those functions.
- Include your header in
./src/scenes/import.h
.