/**
******************************************************************************
* @file : main.h
* @brief : Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
*
© Copyright (c) 2021 STMicroelectronics.
* All rights reserved.
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include
#include "stm32g0xx.h"
#include "board.h"
/* Exported types ------------------------------------------------------------*/
typedef enum {
DOWN = 0,
UP = 1
} updown_t;
typedef enum {
OFF = 0,
ON = 1
} onoff_t;
typedef struct t_flag {
uint32_t ONE_CHANNEL: 1;
uint32_t _reserv: 31;
} flag_t;
extern volatile flag_t Flag;
typedef union {
uint16_t u16; // element specifier for accessing whole u16
int16_t i16; // element specifier for accessing whole i16
uint8_t u8[2];
struct {
#ifdef LITTLE_ENDIAN // Byte-order is little endian
uint8_t u8L; // element specifier for accessing low u8
uint8_t u8H; // element specifier for accessing high u8
#else // Byte-order is big endian
uint8_t u8H; // element specifier for accessing low u8
uint8_t u8L; // element specifier for accessing high u8
#endif
} s16; // element spec. for acc. struct with low or high u8
} nt16_t;
typedef union {
uint32_t u32; // element specifier for accessing whole u32
int32_t i32; // element specifier for accessing whole i32
uint16_t u16[2];
uint8_t u8[4];
struct {
#ifdef LITTLE_ENDIAN // Byte-order is little endian
uint16_t u16L; // element specifier for accessing low u16
uint16_t u16H; // element specifier for accessing high u16
#else // Byte-order is big endian
uint16_t u16H; // element specifier for accessing low u16
uint16_t u16L; // element specifier for accessing high u16
#endif
} s32; // element spec. for acc. struct with low or high u16
} nt32_t;
/* Exported constants --------------------------------------------------------*/
#ifndef true
#define true 1
#endif
#ifndef false
#define false 0
#endif
/* Exported macro ------------------------------------------------------------*/
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
/* Private defines -----------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/