• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. \n
14  *
15  * Description: Provides at base server header. Only for AT module. \n
16  */
17 
18 #ifndef    AT_BASE_H
19 #define    AT_BASE_H
20 
21 #include "at_product.h"
22 
23 #ifdef CONFIG_AT_SUPPORT_LOG
24 #define at_log_normal(buf, buf_size, level) at_log(buf, strlen(buf), 0)
25 #else
26 #define at_log_normal(buf, buf_size, level)
27 #endif
28 
29 void at_base_toupper(char *str, uint32_t len);
30 
31 void* at_malloc(uint32_t size);
32 
33 void at_free(void *addr);
34 
35 void at_msg_queue_create(uint32_t msg_count, uint32_t msg_size, unsigned long *queue_id);
36 
37 uint32_t at_msg_queue_write(unsigned long queue_id, void *msg_ptr, uint32_t msg_size, uint32_t timeout);
38 
39 uint32_t at_msg_queue_read(unsigned long queue_id, void *buf_ptr, uint32_t *buf_size, uint32_t timeout);
40 
41 void at_yield(void);
42 
43 bool at_base_is_at_init(void);
44 
45 #ifdef CONFIG_AT_SUPPORT_ASYNCHRONOUS
46 void at_timer_delete(void);
47 
48 void at_timer_start(uint32_t time_us, at_timer_callback_func_t call_back, void *cmd_id);
49 #endif
50 
51 #ifdef CONFIG_AT_SUPPORT_NOTIFY_REPORT
52 void* at_mutex_create(void);
53 
54 void at_mutex_acquire(void *handle);
55 
56 void at_mutex_release(void *handle);
57 #endif
58 
59 void at_log(const char *buf, uint16_t buf_size, uint8_t level);
60 
61 bool at_cmd_attr(uint16_t attr);
62 
63 #endif
64