mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-13 13:09:49 +04:00
Merge branch 'ofw_dev' into dev p1
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
# Apps Assets folder Example
|
||||
# Apps Assets folder Example {#example_app_assets}
|
||||
|
||||
This example shows how to use the Apps Assets folder to store data that is not part of the application itself, but is required for its operation, and that data is provided with the application.
|
||||
|
||||
## Source code
|
||||
|
||||
Source code for this example can be found [here](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/examples/example_apps_assets).
|
||||
|
||||
## What is the Apps Assets Folder?
|
||||
|
||||
The **Apps Assets** folder is a folder where external applications unpack their assets.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @file example_apps_assets.c
|
||||
* @brief Application assets example.
|
||||
*/
|
||||
#include <furi.h>
|
||||
#include <storage/storage.h>
|
||||
#include <toolbox/stream/stream.h>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
# Apps Data folder Example
|
||||
# Apps Data folder Example {#example_app_data}
|
||||
|
||||
This example demonstrates how to utilize the Apps Data folder to store data that is not part of the app itself, such as user data, configuration files, and so forth.
|
||||
|
||||
## Source code
|
||||
|
||||
Source code for this example can be found [here](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/examples/example_apps_data).
|
||||
|
||||
## What is the Apps Data Folder?
|
||||
|
||||
The **Apps Data** folder is a folder used to store data for external apps that are not part of the main firmware.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @file example_apps_data.c
|
||||
* @brief Application data example.
|
||||
*/
|
||||
#include <furi.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @file ble_beacon_app.h
|
||||
* @brief BLE beacon example.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "extra_beacon.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @file example_custom_font.c
|
||||
* @brief Custom font example.
|
||||
*/
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
# Application icons
|
||||
# Application icons {#example_app_images}
|
||||
|
||||
## Source code
|
||||
|
||||
Source code for this example can be found [here](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/examples/example_images).
|
||||
|
||||
## General principle
|
||||
|
||||
To use icons, do the following:
|
||||
* add a line to the application manifest: `fap_icon_assets="folder"`, where `folder` points to the folder where your icons are located
|
||||
* add `#include "application_id_icons.h"` to the application code, where `application_id` is the appid from the manifest
|
||||
* every icon in the folder will be available as a `I_icon_name` variable, where `icon_name` is the name of the icon file without the extension
|
||||
|
||||
* Add a line to the application manifest: `fap_icon_assets="folder"`, where `folder` points to the folder where your icons are located
|
||||
* Add `#include "application_id_icons.h"` to the application code, where `application_id` is the appid from the manifest
|
||||
* Every icon in the folder will be available as a `I_icon_name` variable, where `icon_name` is the name of the icon file without the extension
|
||||
|
||||
## Example
|
||||
|
||||
We have an application with the following manifest:
|
||||
|
||||
```
|
||||
App(
|
||||
appid="example_images",
|
||||
@@ -17,6 +27,7 @@ App(
|
||||
So the icons are in the `images` folder and will be available in the generated `example_images_icons.h` file.
|
||||
|
||||
The example code is located in `example_images_main.c` and contains the following line:
|
||||
|
||||
```
|
||||
#include "example_images_icons.h"
|
||||
```
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* @file example_images.c
|
||||
* @brief Custom images example.
|
||||
*/
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/*
|
||||
* An example of a plugin host application.
|
||||
/**
|
||||
* @file example_plugins.c
|
||||
* @brief Plugin host application example.
|
||||
*
|
||||
* Loads a single plugin and calls its methods.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/*
|
||||
* An example of an advanced plugin host application.
|
||||
/**
|
||||
* @file example_plugins_multi.c
|
||||
* @brief Advanced plugin host application example.
|
||||
*
|
||||
* It uses PluginManager to load all plugins from a directory
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
/* A simple plugin implementing example_plugins application's plugin interface */
|
||||
/**
|
||||
* @file plugin1.c
|
||||
* @brief Plugin example 1.
|
||||
*
|
||||
* A simple plugin implementing example_plugins application's plugin interface
|
||||
*/
|
||||
|
||||
#include "plugin_interface.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
/* Second plugin implementing example_plugins application's plugin interface */
|
||||
/**
|
||||
* @file plugin2.c
|
||||
* @brief Plugin example 2.
|
||||
*
|
||||
* Second plugin implementing example_plugins application's plugin interface
|
||||
*/
|
||||
|
||||
#include "plugin_interface.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
/**
|
||||
* @file plugin_interface.h
|
||||
* @brief Example plugin interface.
|
||||
*
|
||||
* Common interface between a plugin and host application
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/* Common interface between a plugin and host application */
|
||||
|
||||
#define PLUGIN_APP_ID "example_plugins"
|
||||
#define PLUGIN_API_VERSION 1
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file app_api.h
|
||||
* @brief Application API example.
|
||||
*
|
||||
* This file contains an API that is internally implemented by the application
|
||||
* It is also exposed to plugins to allow them to use the application's API.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
/*
|
||||
/**
|
||||
* @file plugin1.c
|
||||
* @brief Plugin example 1.
|
||||
*
|
||||
* This plugin uses both firmware's API interface and private application headers.
|
||||
* It can be loaded by a plugin manager that uses CompoundApiInterface,
|
||||
* which combines both interfaces.
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
/*
|
||||
/**
|
||||
* @file plugin2.c
|
||||
* @brief Plugin example 2.
|
||||
*
|
||||
* This plugin uses both firmware's API interface and private application headers.
|
||||
* It can be loaded by a plugin manager that uses CompoundApiInterface,
|
||||
* which combines both interfaces.
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
/**
|
||||
* @file plugin_interface.h
|
||||
* @brief Example plugin interface.
|
||||
*
|
||||
* Common interface between a plugin and host application
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/* Common interface between a plugin and host application */
|
||||
|
||||
#define PLUGIN_APP_ID "example_plugins_advanced"
|
||||
#define PLUGIN_API_VERSION 1
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
# 1-Wire Thermometer
|
||||
# 1-Wire Thermometer {#example_thermo}
|
||||
|
||||
This example application demonstrates the use of the 1-Wire library with a DS18B20 thermometer.
|
||||
It also covers basic GUI, input handling, threads and localisation.
|
||||
|
||||
## Source code
|
||||
|
||||
Source code for this example can be found [here](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/examples/example_thermo).
|
||||
|
||||
## Electrical connections
|
||||
|
||||
Before launching the application, connect the sensor to Flipper's external GPIO according to the table below:
|
||||
| DS18B20 | Flipper |
|
||||
| :-----: | :-----: |
|
||||
@@ -15,12 +21,14 @@ Before launching the application, connect the sensor to Flipper's external GPIO
|
||||
*NOTE 2*: For any other pin than 17, connect an external 4.7k pull-up resistor to pin 9.
|
||||
|
||||
## Launching the application
|
||||
|
||||
In order to launch this demo, follow the steps below:
|
||||
1. Make sure your Flipper has an SD card installed.
|
||||
2. Connect your Flipper to the computer via a USB cable.
|
||||
3. Run `./fbt launch APPSRC=example_thermo` in your terminal emulator of choice.
|
||||
|
||||
## Changing the data pin
|
||||
|
||||
It is possible to use other GPIO pin as a 1-Wire data pin. In order to change it, set the `THERMO_GPIO_PIN` macro to any of the options listed below:
|
||||
|
||||
```c
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
/*
|
||||
/**
|
||||
* @file example_thermo.c
|
||||
* @brief 1-Wire thermometer example.
|
||||
*
|
||||
* This file contains an example application that reads and displays
|
||||
* the temperature from a DS18B20 1-wire thermometer.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user