4G_module/custom/custom_main/inc/app_common.h

70 lines
1.5 KiB
C

#ifndef __app_COMMON_H__
#define __app_COMMON_H__
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "cm_os.h"
#include "cm_iomux.h"
//uart0
#define UART0_TX_IOMUX CM_IOMUX_PIN_18, CM_IOMUX_FUNC_FUNCTION1
#define UART0_RX_IOMUX CM_IOMUX_PIN_17, CM_IOMUX_FUNC_FUNCTION1
//uart1
#define UART1_RX_IOMUX CM_IOMUX_PIN_28, CM_IOMUX_FUNC_FUNCTION1
#define UART1_TX_IOMUX CM_IOMUX_PIN_29, CM_IOMUX_FUNC_FUNCTION1
//uart2
#define UART2_TX_IOMUX CM_IOMUX_PIN_50, CM_IOMUX_FUNC_FUNCTION3
#define UART2_RX_IOMUX CM_IOMUX_PIN_51, CM_IOMUX_FUNC_FUNCTION3
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef FALSE
#define FALSE (0U)
#endif
#ifndef TRUE
#define TRUE (1U)
#endif
typedef enum{
RET_BUSY = -2,
RET_ERROR =-1,
RET_SUCCESS = 0
}CM_RET_E;
typedef enum{
EVENT_NETWORK_READY = 0x00000001,
EVENT_NETWORK_DISCONNECT = 0x00000002,
EVENT_GPS_LOCATE_SUCCESS = 0x00000004,
EVENT_GPS_NO_LOCATE = 0x00000008,
EVENT_ERROR = 0x80000000,
}led_event_t;
typedef union{
struct{
uint8_t network_ready : 1;
uint8_t gps_ready : 1;
uint8_t reserved : 6;
};
uint32_t val8;
}led_status_t;
void led_set_event(led_event_t event);
#endif /* __APP_COMMON_H__ */