12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #ifndef _MAIN_H_
- #define _MAIN_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <stdint.h>
- #include <stdlib.h>
- #include "stm32f0xx.h"
- #include "board.h"
- #include "rtos.h"
- #include "i2c.h"
- #include "ds3231.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 I2C_TX_Err: 1;
- uint32_t I2C_TX_End: 1;
- uint32_t I2C_RX_Err: 1;
- uint32_t I2C_RX_End: 1;
- uint32_t _reserv: 27;
- } flag_t;
- extern volatile flag_t Flag;
- typedef union {
- uint16_t u16;
- int16_t i16;
- uint8_t u8[2];
- 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;
- uint16_t u16[2];
- uint8_t u8[4];
- 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
|