전원 + BLE + 배터리
This commit is contained in:
+77
@@ -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__ */
|
||||
Reference in New Issue
Block a user