FL-339: cli diagnostic interface for power subsystem. (#256)
* Core, API: add externs for c++ * Makefile: improve debug speed, flash with openocd, cleanup f2 config * Power: add cli diagnostic. * Local: fix api hal externs * Local: fix externs in main and flipper_hal * F2: power state dump stabs * Bootloader flashing with openocd * F3: move bq drivers to libs * temporary do not build drivers on local * temporary do not build drivers on f2 Co-authored-by: aanper <mail@s3f.ru>
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
ApiHalBootModeNormal,
|
||||
ApiHalBootModeDFU
|
||||
} ApiHalBootMode;
|
||||
|
||||
void api_hal_boot_set_mode(ApiHalBootMode mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,6 +1,14 @@
|
||||
#pragma once
|
||||
#include "main.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void delay(float milliseconds);
|
||||
void delay_us(float microseconds);
|
||||
void delay_us_init_DWT(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -2,6 +2,11 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <m-string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Initialize drivers */
|
||||
void api_hal_power_init();
|
||||
@@ -20,3 +25,16 @@ void api_hal_power_enable_otg();
|
||||
|
||||
/* OTG disable */
|
||||
void api_hal_power_disable_otg();
|
||||
|
||||
/* Get battery voltage in V */
|
||||
float api_hal_power_get_battery_voltage();
|
||||
|
||||
/* Get battery current in A */
|
||||
float api_hal_power_get_battery_current();
|
||||
|
||||
/* Get power system component state */
|
||||
void api_hal_power_dump_state(string_t buffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -3,8 +3,16 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Get platform UID size in bytes */
|
||||
size_t api_hal_uid_size();
|
||||
|
||||
/* Get const pointer to UID */
|
||||
const uint8_t* api_hal_uid();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -4,6 +4,10 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Init VCP HAL
|
||||
* Allocates ring buffer and initializes state
|
||||
*/
|
||||
@@ -22,3 +26,7 @@ size_t api_hal_vcp_rx(uint8_t* buffer, size_t size);
|
||||
* @param size - buffer size
|
||||
*/
|
||||
void api_hal_vcp_tx(uint8_t* buffer, size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <unsigned int N> struct STOP_EXTERNING_ME {};
|
||||
#endif
|
||||
|
||||
#include "api-hal-boot.h"
|
||||
#include "api-hal-gpio.h"
|
||||
#include "api-hal-delay.h"
|
||||
|
Reference in New Issue
Block a user