전원 + BLE + 배터리

This commit is contained in:
jhChun
2026-04-10 17:57:09 +09:00
parent 750f2d139e
commit 8dcf4adf31
22 changed files with 1791 additions and 175 deletions
+77
View File
@@ -0,0 +1,77 @@
/*******************************************************************************
* @file main.h
* @brief VesiScan BASIC - Zephyr port main header
******************************************************************************/
#ifndef MAIN_H__
#define MAIN_H__
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdarg.h>
#include <stdbool.h>
/*==============================================================================
* Firmware identification
*============================================================================*/
#define FIRMWARE_VERSION "VBTFW0102"
#define HARDWARE_VERSION "VB0HW0000"
#define SERIAL_NUMBER "VB026030000"
#define DEFAULT_PASSKEY "123456"
/*==============================================================================
* Data length constants
*============================================================================*/
#define SERIAL_NO_LENGTH 12
#define HW_NO_LENGTH 12
#define PASSKEY_LENGTH 6
/*==============================================================================
* Enumerations
*============================================================================*/
typedef enum
{
OFF = 0,
ON = 1
} on_off_cont_t;
typedef enum
{
CMD_BLE = 0,
CMD_UART = 1
} which_cmd_t;
typedef enum
{
BLE_DISCONNECTED_ST = 0,
BLE_CONNECTED_ST = 1
} ble_status_t;
/*==============================================================================
* Timing constants
*============================================================================*/
#define POWER_ON_DELAY 5 /* Power button poll interval (ms) */
#define POWER_OFF_DELAY 3000 /* LED display before power off (ms) */
/*==============================================================================
* Function declarations
*============================================================================*/
void sleep_mode_enter(void);
void device_power_off(void);
/*==============================================================================
* Global variables (extern)
*============================================================================*/
extern volatile bool ble_connection_st;
extern volatile bool processing;
extern char SERIAL_NO[SERIAL_NO_LENGTH];
extern char HW_NO[HW_NO_LENGTH];
extern char m_static_passkey[PASSKEY_LENGTH];
extern bool bond_data_delete;
extern uint32_t m_life_cycle;
extern uint8_t m_reset_status;
#endif /* MAIN_H__ */