Hospital Analyser  1.0
main.h
1 /* Define to prevent recursive inclusion -------------------------------------*/
2 #ifndef __MAIN_H
3 #define __MAIN_H
4 
5 #include <stdio.h>
6 #include <stdint.h>
7 
8 /* Define the ALLMEMS1 Name MUST be 7 char long */
9 #define NAME_BLUEMS 'U','T','B','_','H','S','P'
10 
11 /* Define that bluetooth MAC is constructed on STM32 UID base */
12 #define MAC_STM32UID_BLUEMS
13 
14 /* Package Version only numbers 0->9 */
15 #define UTB_HSP_VERSION_MAJOR '0'
16 #define UTB_HSP_VERSION_MINOR '1'
17 #define UTB_HSP_VERSION_PATCH '0'
18 
19 /* BlueNRG Board Type */
20 #define IDB04A1 0
21 #define IDB05A1 1
22 
23 #define STM32_UUID ((uint32_t *)0x1FFF7590)
24 
25 /* Private define ------------------------------------------------------------*/
26 
27 #define LED_4_Pin GPIO_PIN_2
28 #define LED_4_GPIO_Port GPIOB
29 
30 
31 #ifdef ALLMEMS1_ENABLE_PRINTF
32 #include "usbd_cdc_interface.h"
33 #define ALLMEMS1_PRINTF(...)\
34 {\
35  char TmpBufferToWrite[256];\
36  int32_t TmpBytesToWrite;\
37  TmpBytesToWrite = sprintf( TmpBufferToWrite, __VA_ARGS__);\
38  CDC_Fill_Buffer(( uint8_t * )TmpBufferToWrite, TmpBytesToWrite);\
39  CDC_TIM_PeriodElapsedCallback(NULL);\
40 }
41 #endif
42 
43 #ifdef STM32_SENSORTILE
44  #ifdef ALLMEMS1_ENABLE_PRINTF
45  extern TIM_HandleTypeDef TimHandle;
46  extern void CDC_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim);
47  #endif /* ALLMEMS1_ENABLE_PRINTF */
48 
49  /* BlueNRG SPI */
50  extern SPI_HandleTypeDef SpiHandle;
51  extern SPI_HandleTypeDef SPI_SD_Handle;
52  extern I2C_HandleTypeDef I2C_SENSORTILE_Handle;
53 #endif /* STM32_SENSORTILE */
54 
55 
56 /*Function prototypes*/
57 static void Init_BlueNRG_Stack(void);
58 
64 static void MX_CRC_Init(void);
65 
71 static void SystemClock_Config(void);
72 
80 void HAL_Delay(__IO uint32_t Delay);
81 
87 void setConnectable(void);
88 
93 void measureOrientation_Task(void const *parameter);
94 
95 void measureWeight_Task(void const *parameter);
96 
97 void bleService_Task(void const *parameter);
98 
99 void _Error_Handler(char *, int);
100 
101 #endif /* __MAIN_H */
Header for usbd_cdc_interface.c file.