123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef __MAIN_H
- #define __MAIN_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "stm32g0xx.h"
- #include "board.h"
- #include "sensor.h"
- #include "i2c.h"
- #include "ds3231.h"
- #include "bme280.h"
- #include "rtos.h"
- #include "event-system.h"
- #include "list_event.h"
- #include "clock.h"
- typedef enum {
- DOWN = 0,
- UP = 1
- } updown_t;
- typedef enum {
- OFF = 0,
- ON = 1
- } onoff_t;
- typedef struct t_flag {
- uint32_t RTC_IRQ: 1;
- uint32_t SPI_TX_End: 1;
- uint32_t I2C_TX_End: 1;
- uint32_t I2C_RX_End: 1;
- uint32_t I2C_TX_Err: 1;
- uint32_t I2C_RX_Err: 1;
- uint32_t BME280: 1;
- uint32_t Blink_1: 1;
- uint32_t Blink_2: 1;
- uint32_t Blink_3: 1;
- uint32_t Blink_4: 1;
- uint32_t Blink_5: 1;
- uint32_t Now_Day: 1;
- uint32_t _reserv: 19;
- } flag_t;
- extern volatile flag_t Flag;
- typedef union {
- uint16_t u16;
- int16_t i16;
- struct {
- #ifdef LITTLE_ENDIAN
- uint8_t u8L;
- uint8_t u8H;
- #else
- uint8_t u8H;
- uint8_t u8L;
- #endif
- } s16;
- } nt16_t;
- typedef union {
- uint32_t u32;
- int32_t i32;
- struct {
- #ifdef LITTLE_ENDIAN
- uint16_t u16L;
- uint16_t u16H;
- #else
- uint16_t u16H;
- uint16_t u16L;
- #endif
- } s32;
- } nt32_t;
- void Error_Handler(void);
- #ifdef __cplusplus
- }
- #endif
- #endif
|