74 lines
1.8 KiB
C
74 lines
1.8 KiB
C
/****************************************************************************
|
|
|
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
|
|
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
|
be copied by any method or incorporated into another program without
|
|
the express written consent of Aerospace C.Power. This Information or any portion
|
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
|
liability for its use in any way and conveys no license or title under
|
|
any patent or copyright and makes no representation or warranty that this
|
|
Information is free from patent or copyright infringement.
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef OEM_COMMON_H
|
|
#define OEM_COMMON_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <ctype.h>
|
|
|
|
#include "iot_oem.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct pin_config_t{
|
|
uint8_t gpio;
|
|
uint8_t io;
|
|
uint8_t func;
|
|
uint8_t inid;
|
|
uint8_t outid;
|
|
uint8_t used;
|
|
} pin_cfg;
|
|
|
|
typedef struct uart_config_t {
|
|
uint8_t port;
|
|
uint8_t type;
|
|
uint8_t used;
|
|
} uart_cfg;
|
|
|
|
typedef struct gpio_config_t {
|
|
uint8_t gpio;
|
|
uint8_t type;
|
|
uint8_t used;
|
|
}gpio_cfg;
|
|
|
|
extern iot_oem_cfg_t oemcfg;
|
|
|
|
uint8_t iot_getcrc8(uint8_t *pbyData, uint32_t stLength);
|
|
uint32_t iot_getcrc32(uint8_t *pbyData, uint32_t stLength);
|
|
|
|
size_t iot_strlen( const char *s );
|
|
int oem_atoi(char *s);
|
|
|
|
void die (const char *format, ...);
|
|
|
|
char *peek_next_token (char *buf);
|
|
|
|
bool is_whitespace (const char *text);
|
|
|
|
void chomp_trailing_whitespace (char *buf);
|
|
|
|
bool starts_with (const char *str, const char *prefix);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif //OEM_COMMON_H
|
|
|