Welcome to mirror list, hosted at ThFree Co, Russian Federation.

custom_stm.h « App « STM32_WPAN « BLE_Custom « BLE « Applications « P-NUCLEO-WB55.Nucleo « Projects - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 929c6f17420dc858419128c5df6309a798808c1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * File Name          : App/custom_stm.h
  * Description        : Header for custom_stm.c module.
  *
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under Ultimate Liberty license
  * SLA0044, the "License"; You may not use this file except in compliance with
  * the License. You may obtain a copy of the License at:
  *                             www.st.com/SLA0044
  *
 ******************************************************************************
 */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __CUSTOM_STM_H
#define __CUSTOM_STM_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
typedef enum
{
  /* My_P2P_Server */
  CUSTOM_STM_LED_C,
  CUSTOM_STM_SWITCH_C,
  /* My_Heart_Rate */
  CUSTOM_STM_HRS_M,
  CUSTOM_STM_HRS_SL,
  CUSTOM_STM_HRS_CTRLP,
} Custom_STM_Char_Opcode_t;

typedef enum
{
  /* My_LED_Char */
  CUSTOM_STM_LED_C_READ_EVT,
  CUSTOM_STM_LED_C_WRITE_NO_RESP_EVT,
  /* My_Switch_Char */
  CUSTOM_STM_SWITCH_C_READ_EVT,
  CUSTOM_STM_SWITCH_C_NOTIFY_ENABLED_EVT,
  CUSTOM_STM_SWITCH_C_NOTIFY_DISABLED_EVT,
  /* My_HRS_Meas */
  CUSTOM_STM_HRS_M_READ_EVT,
  CUSTOM_STM_HRS_M_NOTIFY_ENABLED_EVT,
  CUSTOM_STM_HRS_M_NOTIFY_DISABLED_EVT,
  /* My_Sensor_Loc */
  CUSTOM_STM_HRS_SL_READ_EVT,
  /* My_HRS_CTRL_Point */
  CUSTOM_STM_HRS_CTRLP_READ_EVT,
  CUSTOM_STM_HRS_CTRLP_WRITE_EVT,

  CUSTOM_STM_BOOT_REQUEST_EVT
} Custom_STM_Opcode_evt_t;

typedef struct
{
  uint8_t * pPayload;
  uint8_t   Length;
} Custom_STM_Data_t;

typedef struct
{
  Custom_STM_Opcode_evt_t       Custom_Evt_Opcode;
  Custom_STM_Data_t             DataTransfered;
  uint16_t                      ConnectionHandle;
  uint8_t                       ServiceInstance;
} Custom_STM_App_Notification_evt_t;

/* USER CODE BEGIN ET */
  typedef enum
  {
    CUSTOM_STM_HRS_HRM_VALUE_FORMAT_UINT16       = 1,
    CUSTOM_STM_HRS_HRM_SENSOR_CONTACTS_PRESENT   = 2,
    CUSTOM_STM_HRS_HRM_SENSOR_CONTACTS_SUPPORTED = 4,
    CUSTOM_STM_HRS_HRM_ENERGY_EXPENDED_PRESENT   = 8,
    CUSTOM_STM_HRS_HRM_RR_INTERVAL_PRESENT       = 0x10
  } Custom_STM_HRS_HrmFlags_t;

  typedef enum
  {
    CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_OTHER    = 0,
    CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_CHEST    = 1,
    CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_WRIST    = 2,
    CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_FINGER   = 3,
    CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_HAND     = 4,
    CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_EAR_LOBE = 5,
    CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_FOOT     = 6
  } Custom_STM_HRS_BodySensorLocation_t;

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* External variables --------------------------------------------------------*/
/* USER CODE BEGIN EV */

/* USER CODE END EV */

/* Exported macros -----------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions ------------------------------------------------------- */
void SVCCTL_InitCustomSvc( void );
void Custom_STM_App_Notification(Custom_STM_App_Notification_evt_t *pNotification);
tBleStatus Custom_STM_App_Update_Char(Custom_STM_Char_Opcode_t CharOpcode,  uint8_t *pPayload);
/* USER CODE BEGIN EF */

/* USER CODE END EF */

#ifdef __cplusplus
}
#endif

#endif /*__CUSTOM_STM_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/