Goodix
GR551x API Reference  V1_6_06_B5676
gr55xx_sys.h
Go to the documentation of this file.
1 /**
2  *******************************************************************************
3  *
4  * @file gr55xx_sys.h
5  *
6  * @brief GR55XX System API
7  *
8  *******************************************************************************
9  * @attention
10  #####Copyright (c) 2019 GOODIX
11  All rights reserved.
12 
13  Redistribution and use in source and binary forms, with or without
14  modification, are permitted provided that the following conditions are met:
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17  * Redistributions in binary form must reproduce the above copyright
18  notice, this list of conditions and the following disclaimer in the
19  documentation and/or other materials provided with the distribution.
20  * Neither the name of GOODIX nor the names of its contributors may be used
21  to endorse or promote products derived from this software without
22  specific prior written permission.
23 
24  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  POSSIBILITY OF SUCH DAMAGE.
35  *****************************************************************************************
36  */
37 
38 /**
39  @addtogroup SYSTEM
40  @{
41  */
42 
43 /**
44  * @addtogroup SYS System SDK
45  * @{
46  * @brief Definitions and prototypes for the system SDK interface.
47 */
48 
49 
50 
51 #ifndef __GR55XX_SYS_H__
52 #define __GR55XX_SYS_H__
53 
54 #include "gr55xx_sys_cfg.h"
55 #include "gr55xx_nvds.h"
56 #include "gr55xx_pwr.h"
57 #include "gr55xx_fpb.h"
58 #include "ble.h"
59 
60 #include <stdint.h>
61 #include <stdio.h>
62 #include <stdbool.h>
63 #include <stdarg.h>
64 
65 /** @addtogroup GR55XX_SYS_DEFINES Defines
66  * @{
67  */
68 #define SYS_INVALID_TIMER_ID 0xFF /**< Invalid system Timer ID. */
69 #define SYS_BD_ADDR_LEN GAP_ADDR_LEN /**< Length of Bluetoth Device Address. */
70 #define SYS_CHIP_UID_LEN 0x10 /**< Length of Bluetoth Chip UID. */
71 #define SYS_SET_BD_ADDR(BD_ADDR_ARRAY) nvds_put(0xC001, SYS_BD_ADDR_LEN, BD_ADDR_ARRAY) /**< NVDS put BD address. */
72 /** @} */
73 
74 /**
75  * @defgroup GR55XX_SYS_TYPEDEF Typedefs
76  * @{
77  */
78 /**@brief The function pointers to register event callback. */
79 typedef void (*callback_t)(int);
80 
81 /** @brief Timer callback type. */
82 typedef void (*timer_callback_t)(uint8_t timer_id);
83 
84 /**@brief Printf callback type. */
85 typedef int (*vprintf_callback_t) (const char *fmt, va_list argp);
86 
87 /**@brief Low power clock update function type. */
88 typedef void (*void_func_t)(void);
89 
90 /**@brief Low power clock update function type with resturn. */
91 typedef int (*int_func_t)(void);
92 
93 /**@brief Function type for saving user context before deep sleep. */
94 typedef void (*sys_context_func_t)(void);
95 
96 /**@brief Error assert callback type. */
97 typedef void (*assert_err_cb_t)(const char *expr, const char *file, int line);
98 
99 /**@brief Parameter assert callback type. */
100 typedef void (*assert_param_cb_t)(int param0, int param1, const char *file, int line);
101 
102 /**@brief Warning assert callback type. */
103 typedef void (*assert_warn_cb_t)(int param0, int param1, const char *file, int line);
104 /** @} */
105 
106 /** @addtogroup GR55XX_SYS_ENUMERATIONS Enumerations
107  * @{
108  */
109 /**@brief Definition of Device SRAM Size Enumerations. */
110 typedef enum
111 {
112  SYS_DEV_SRAM_64K = 0x02, /**< Supported 64K SRAM. */
113  SYS_DEV_SRAM_128K = 0x01, /**< Supported 128K SRAM. */
114  SYS_DEV_SRAM_256K = 0x00, /**< Supported 256K SRAM. */
115 } sram_size_t;
116 
117 /**@brief package type. */
118 typedef enum
119 {
120  PACKAGE_NONE = 0, /**< Package unused. */
121  PACKAGE_GR5515RGBD = 1, /**< BGA68 package. */
122  PACKAGE_GR5515GGBD = 2, /**< BGA55 package. */
123  PACKAGE_GR5515IGND = 3, /**< QFN56 + 1024K flash package. */
124  PACKAGE_GR5515I0ND = 4, /**< QFN56 + no flash package */
125  PACKAGE_GR5513BEND = 5, /**< QFN40 + 128KB RAM + 512KB flash packet. */
126  PACKAGE_GR5515BEND = 6, /**< QFN40 + 256KB RAM + 512KB flash packet. */
128  /** @} */
129 
130 /** @addtogroup GR55XX_SYS_STRUCTURES Structures
131  * @{
132  */
133 /**@brief SDK version definition. */
134 typedef struct
135 {
136  uint8_t major; /**< Major version. */
137  uint8_t minor; /**< Minor version. */
138  uint16_t build; /**< Build number. */
139  uint32_t commit_id; /**< commit ID. */
141 
142 /**@brief Assert callbacks.*/
143 typedef struct
144 {
145  assert_err_cb_t assert_err_cb; /**< Assert error type callback. */
146  assert_param_cb_t assert_param_cb; /**< Assert parameter error type callback. */
147  assert_warn_cb_t assert_warn_cb; /**< Assert warning type callback. */
149 
150 /**@brief Link RX information definition. */
151 typedef struct
152 {
153  uint32_t rx_total_cnt; /**< Counts of RX times. */
154  uint32_t rx_sync_err_cnt; /**< Counts of RX sync error times. */
155  uint32_t rx_crc_err_cnt; /**< Counts of RX crc error times. */
156  uint32_t rx_other_err_cnt; /**< Counts of RX other error times. */
157  uint32_t rx_sn_err_cnt; /**< Counts of sn CRC error times. */
158  uint32_t rx_mic_err_cnt; /**< Counts of mic CRC error times. */
159  uint32_t rx_normal_cnt; /**< Counts of RX normal times. */
161 
162 /**@brief RF trim parameter information definition. */
163 typedef struct
164 {
165  int8_t rssi_cali; /**< RSSI calibration. */
166  int8_t tx_power; /**< TX power. */
168 
169 /**@brief ADC trim parameter information definition. */
170 typedef struct
171 {
172  uint16_t adc_temp; /**< ADC TEMP. */
173  uint16_t slope_int_0p8; /**< Internal reference 0.8v. */
174  uint16_t offset_int_0p8; /**< Internal reference 0.8v. */
175  uint16_t slope_int_1p2; /**< Internal reference 1.2v. */
176  uint16_t offset_int_1p2; /**< Internal reference 1.2v. */
177  uint16_t slope_int_1p6; /**< Internal reference 1.6v. */
178  uint16_t offset_int_1p6; /**< Internal reference 1.6v. */
179  uint16_t slope_int_2p0; /**< Internal reference 2.0v. */
180  uint16_t offset_int_2p0; /**< Internal reference 2.0v. */
181  uint16_t slope_ext_1p0; /**< External reference 1.0v. */
182  uint16_t offset_ext_1p0; /**< External reference 1.0v. */
184 
185 /**@brief PMU trim parameter information definition. */
186 typedef struct
187 {
188  uint8_t io_ldo_bypass; /**< IO LDO bypass */
189  uint8_t io_ldo_vout; /**< IO LDO Vout. */
190  uint8_t dig_ldo_64m; /**< DIG LDO 64m. */
191  uint8_t dig_ldo_16m; /**< DIG LDO 16m */
192  uint8_t dcdc_vout; /**< DCDC Vout */
194 
195 /** @} */
196 
197 /** @addtogroup GR55XX_SYS_FUNCTIONS Functions
198  * @{
199  */
200 /**
201  *****************************************************************************************
202  * @brief Output debug logs.
203  *
204  * @param[in] format: Pointer to the log information.
205  *****************************************************************************************
206  */
207 void sys_app_printf(const char *format, ...);
208 
209 /**
210  *****************************************************************************************
211  * @brief Delay the function execution.
212  *
213  * @param[in] us: Microsecond.
214  *****************************************************************************************
215  */
216 void sys_delay_us(uint32_t us);
217 
218 /**
219  *****************************************************************************************
220  * @brief Delay the function execution.
221  *
222  * @param[in] ms: Millisecond.
223  *****************************************************************************************
224  */
225 void sys_delay_ms(uint32_t ms);
226 
227 /**
228  *****************************************************************************************
229  * @brief Memory allocation.
230  *
231  * @param[in] size: Requested memory size.
232  *
233  * @return Valid memory location if successful, else null.
234  *****************************************************************************************
235  */
236 void *sys_malloc(uint32_t size);
237 
238 /**
239  *****************************************************************************************
240  * @brief Free allocated memory.
241  *
242  * @param[in] p_mem: Pointer to memory block.
243  *****************************************************************************************
244  */
245 void sys_free(void *p_mem);
246 
247 /**
248  *****************************************************************************************
249  * @brief Register signal handler.
250  *
251  * @note This function is mainly used to register the upper-layer APP callback functions to the protocol layer,
252  * which will be invoked when there are event responses in the protocol layer.
253  *****************************************************************************************
254  */
256 
257 /**
258  *****************************************************************************************
259  * @brief Get SDK version.
260  *
261  * @note This function is mainly used to get the version of SDK.
262  *
263  * @param[out] p_version: The pointer to struct of @ref sdk_version_t.
264  *****************************************************************************************
265  */
267 
268 /**
269  *****************************************************************************************
270  * @brief Save system context.
271  *
272  * @note This function is used to save system context before the system goes to deep sleep.
273  * Boot codes will be used to restore system context in the wakeup procedure.
274  *****************************************************************************************
275  */
276 void sys_context_save(void);
277 
278 /**
279  *****************************************************************************************
280  * @brief Load system context.
281  *
282  * @note This function is used to load system context after the system goes to deep sleep.
283  *****************************************************************************************
284  */
286 
287 /**
288  *****************************************************************************************
289  * @brief Save system registers.
290  *
291  * @note This function is used to save system register before the system goes to deep sleep.
292  *
293  * @param[in] p_address: The pointer to register address.
294  * @param[in] value: The register value to be saved, it will be restored when system wakes up.
295  *****************************************************************************************
296  */
297 void sys_regs_save(volatile uint32_t *p_address, uint32_t value);
298 
299 /**
300  *****************************************************************************************
301  * @brief Generate checksum info for system context.
302  *
303  * @note This function is used to generate checksum for system context, it will be called
304  * before deep sleep in power management module.
305  *****************************************************************************************
306  */
308 
309 /**
310  *****************************************************************************************
311  * @brief Encrypt and decrypt data using Present.
312  *
313  * @note This function is only used to encrypt and decrypt data that needs to be stored in Flash.
314  *
315  * @param[in] addr: Operation address (Flash address minus Flash start address).
316  * @param[in] input: Data before encryption and decryption.
317  * @param[in] size: Data size.
318  * @param[out] output: Data after encryption and decryption.
319  *****************************************************************************************
320  */
321 void sys_security_data_use_present(uint32_t addr, uint8_t *input, uint32_t size, uint8_t *output);
322 
323 /**
324  *****************************************************************************************
325  * @brief Check the chip's security level.
326  *
327  * @return 0: Security is not supported.
328  * 1: Security is supported.
329  *****************************************************************************************
330  */
332 
333 /**
334  *****************************************************************************************
335  * @brief Get the RF trim information.
336  *
337  * @param[out] p_rf_trim: The pointer to struct of @ref rf_trim_info_t.
338  * @return 0: Operation is OK.
339  * 1: the chip's parameter is incorrect.
340  *****************************************************************************************
341  */
342 uint16_t sys_rf_trim_get(rf_trim_info_t *p_rf_trim);
343 
344 /**
345  *****************************************************************************************
346  * @brief Get the ADC trim information.
347  *
348  * @param[out] p_adc_trim: The pointer to struct of @ref adc_trim_info_t.
349  * @return 0: Operation is OK.
350  * 1: the chip's parameter is incorrect.
351  *****************************************************************************************
352  */
353 uint16_t sys_adc_trim_get(adc_trim_info_t *p_adc_trim);
354 
355 /**
356  *****************************************************************************************
357  * @brief Get the PMU trim information.
358  *
359  * @param[out] p_pmu_trim: The pointer to struct of @ref pmu_trim_info_t.
360  * @return 0: Operation is OK.
361  * 1: the chip's parameter is incorrect.
362  *****************************************************************************************
363  */
364 uint16_t sys_pmu_trim_get(pmu_trim_info_t *p_pmu_trim);
365 
366 /**
367  *****************************************************************************************
368  * @brief Get the crystal trim information.
369  *
370  * @param[out] p_crystal_trim: offset information for crystal.
371  * @return 0: Operation is OK.
372  * 1: the chip's parameter is incorrect.
373  *****************************************************************************************
374  */
375 uint16_t sys_crystal_trim_get(uint16_t *p_crystal_trim);
376 
377 /**
378  *****************************************************************************************
379  * @brief Get the trim checksum.
380  *
381  * @param[out] p_trim_sum: The pointer to the buffer for trim checksum.
382  * @return 0: Operation is OK.
383  * 1: the chip's parameter is incorrect.
384  *****************************************************************************************
385  */
386 uint16_t sys_trim_sum_get(uint16_t *p_trim_sum);
387 
388 /**
389  *****************************************************************************************
390  * @brief Get the device address information.
391  *
392  * @param[out] p_device_addr: Bluetooth address by default.
393  * @return 0: Operation is OK.
394  * 1: the chip's parameter is incorrect.
395  *****************************************************************************************
396  */
397 uint16_t sys_device_addr_get(uint8_t *p_device_addr);
398 
399 /**
400  *****************************************************************************************
401  * @brief Get the device UID information.
402  *
403  * @param[out] p_device_uid: Device chip UID.
404  * @return 0: Operation is OK.
405  * 1: the chip's parameter is incorrect.
406  *****************************************************************************************
407  */
408 uint16_t sys_device_uid_get(uint8_t *p_device_uid);
409 
410 /**
411  *****************************************************************************************
412  * @brief Get the LP gain offset 2M information.
413  *
414  * @param[out] p_offset: the offset of LP gain.
415  * @return 0: Operation is OK.
416  * 1: the chip's parameter is incorrect.
417  *****************************************************************************************
418  */
419 uint16_t sys_device_lp_gain_offset_2m_get(uint8_t *p_offset);
420 
421 /**
422  *****************************************************************************************
423  * @brief Get the RAM size information.
424  *
425  * @param[out] p_sram_size: The pointer to enumeration of @ref sram_size_t.
426  * @return 0: Operation is OK.
427  * 1: the chip's parameter is incorrect.
428  *****************************************************************************************
429  */
430 uint16_t sys_device_sram_get(sram_size_t *p_sram_size);
431 
432 /**
433  *****************************************************************************************
434  * @brief Get the chip's package type.
435  *
436  * @param[out] p_package_type: The pointer to enumeration of @ref package_type_t.
437  * @return 0: Operation is OK.
438  * 1: the chip's parameter is incorrect.
439  *****************************************************************************************
440  */
441 uint16_t sys_device_package_get(package_type_t *p_package_type);
442 
443 /**
444  *****************************************************************************************
445  * @brief Set low power CLK frequency.
446  *
447  * @param[in] user_lpclk: CLK frequency.
448  *****************************************************************************************
449  */
450 void sys_lpclk_set(uint32_t user_lpclk);
451 
452 /**
453  ****************************************************************************************
454  * @brief Convert a duration in μs into a duration in lp cycles.
455  *
456  * The function converts a duration in μs into a duration in lp cycles, according to the
457  * low power clock frequency (32768Hz or 32000Hz).
458  *
459  * @param[in] us: Duration in μs.
460  *
461  * @return Duration in lpcycles.
462  ****************************************************************************************
463  */
464 uint32_t sys_us_2_lpcycles(uint32_t us);
465 
466 /**
467  ****************************************************************************************
468  * @brief Convert a duration in lp cycles into a duration in half μs.
469  *
470  * The function converts a duration in lp cycles into a duration in half μs, according to the
471  * low power clock frequency (32768Hz or 32000Hz).
472  * @param[in] lpcycles: Duration in lp cycles.
473  * @param[in,out] error_corr: Insert and retrieve error created by truncating the LP Cycle Time to a half μs (in half μs).
474  *
475  * @return Duration in half μs
476  ****************************************************************************************
477  */
478 uint32_t sys_lpcycles_2_hus(uint32_t lpcycles, uint32_t *error_corr);
479 
480 /**
481  *****************************************************************************************
482  * @brief Set BLE Sleep HeartBeat Period.
483  * @note The BLE Sleep HeartBeat Period is used to Wakeup BLE Periodically when BLE is IDLE.
484  *
485  * @param[in] period_hus: The wake up duration of BLE when BLE is IDEL.
486  * Range 0x00000000-0xFFFFFFFF (in unit of μs).
487  *
488  * @retval ::SDK_SUCCESS: Operation is Success.
489  *****************************************************************************************
490  */
491 uint16_t sys_ble_heartbeat_period_set(uint32_t period_hus);
492 
493 
494 /**
495  *****************************************************************************************
496  * @brief Get BLE Sleep HeartBeat Period.
497  * @note The BLE Sleep HeartBeat Period is used to Wakeup BLE Periodically when BLE is IDLE.
498  *
499  * @param[in] p_period_hus: Pointer to the wake up duration.
500  * Range 0x00000000-0xFFFFFFFF (in unit of μs).
501  *
502  * @retval ::SDK_SUCCESS: Operation is Success.
503  *****************************************************************************************
504  */
505 uint16_t sys_ble_heartbeat_period_get(uint32_t* p_period_hus);
506 
507 /**
508  ****************************************************************************************
509  * @brief Set system maximum usage ratio of message heap.
510  *
511  * The function will used to set message ratio of message heap.
512  * Valid ratio range is 50 - 100 percent in full message size.
513  *
514  * @param[in] usage_ratio: Usage ratio of message heap size.
515  *
516  ****************************************************************************************
517  */
518 void sys_max_msg_usage_ratio_set(uint8_t usage_ratio);
519 
520 /**
521  ****************************************************************************************
522  * @brief Get system message heap usage ratio.
523  *
524  * The function will used to get message ratio of message heap.
525  * This ratio is heap used percent in full message size.
526  *
527  * @return current heap used percent.
528  ****************************************************************************************
529  */
531 
532 /**
533  ****************************************************************************************
534  * @brief Get system environment heap usage ratio.
535  *
536  * The function will used to get environment ratio of environment heap.
537  * This ratio is heap used percent in full environment size.
538  *
539  * @return current heap used percent.
540  ****************************************************************************************
541  */
543 
544 /**
545  ****************************************************************************************
546  * @brief Get system attriute database heap usage ratio.
547  *
548  * The function will used to get attriute database ratio of attriute database heap.
549  * This ratio is heap used percent in full attriute database size.
550  *
551  * @return current heap used percent.
552  ****************************************************************************************
553  */
555 
556 /**
557  ****************************************************************************************
558  * @brief Get system non retention heap usage ratio.
559  *
560  * The function will used to get non retention ratio of non retention heap.
561  * This ratio is heap used percent in full non retention size.
562  *
563  * @return current heap used percent.
564  ****************************************************************************************
565  */
567 
568 /**
569  ****************************************************************************************
570  * @brief Get link quality info
571  *
572  * @param[in] conn_idx: Connect index.
573  * @param[in,out] rx_info: RX detailed information.
574  *
575  * @return Current connect index link quality.
576  ****************************************************************************************
577  */
578 uint8_t sys_link_quality_get(uint8_t conn_idx, link_rx_info_t* rx_info);
579 
580 /**
581  ****************************************************************************************
582  * @brief Clear link quality info.
583  *
584  * @param[in] conn_idx: Connect index.
585  ****************************************************************************************
586  */
587 void sys_link_quality_clear(uint8_t conn_idx);
588 
589 /**
590  ****************************************************************************************
591  * @brief Register low power clock update function.
592  *
593  * @param[in] func_update_lpclk: function pointer to update_lpclk.
594  ****************************************************************************************
595  */
597 
598 /**
599  ****************************************************************************************
600  * @brief Register low power clock update function with int return.
601  *
602  * @param[in] func_update_lpclk: function pointer to update_lpclk.
603  ****************************************************************************************
604  */
606 
607 /**
608  ****************************************************************************************
609  * @brief Get low power CLK frequency.
610  *
611  * This function is used to get the low power clock frequency.
612  *
613  * @return Low power CLK frequency.
614  ****************************************************************************************
615  */
616 uint32_t sys_lpclk_get(void);
617 
618 /**
619  ****************************************************************************************
620  * @brief Get low power CLK period.
621  *
622  * This function is used to get the low power CLK period.
623  *
624  * @return Low power CLK period.
625  ****************************************************************************************
626  */
627 uint32_t sys_lpper_get(void);
628 
629 /**
630  *****************************************************************************************
631  * @brief Register assert callbacks.
632  *
633  * @param[in] p_assert_cb: Pointer to assert callbacks.
634  *****************************************************************************************
635  */
637 
638 /**
639  ****************************************************************************************
640  * @brief Get status of ke_event list
641  * @return true: ke_event not busy, false : ke_event busy.
642  ****************************************************************************************
643  */
645 
646 /**
647  ****************************************************************************************
648  * @brief Enable swd function
649  ****************************************************************************************
650  */
651 void sys_swd_enable(void);
652 
653 /**
654  ****************************************************************************************
655  * @brief Diable swd function
656  ****************************************************************************************
657  */
658 void sys_swd_disable(void);
659 
660 /** @} */
661 #endif
662 
663 /** @} */
664 /** @} */
sys_lpcycles_2_hus
uint32_t sys_lpcycles_2_hus(uint32_t lpcycles, uint32_t *error_corr)
Convert a duration in lp cycles into a duration in half μs.
sram_size_t
sram_size_t
Definition of Device SRAM Size Enumerations.
Definition: gr55xx_sys.h:111
assert_warn_cb_t
void(* assert_warn_cb_t)(int param0, int param1, const char *file, int line)
Warning assert callback type.
Definition: gr55xx_sys.h:103
callback_t
void(* callback_t)(int)
The function pointers to register event callback.
Definition: gr55xx_sys.h:79
adc_trim_info_t::offset_int_1p2
uint16_t offset_int_1p2
Internal reference 1.2v.
Definition: gr55xx_sys.h:176
vprintf_callback_t
int(* vprintf_callback_t)(const char *fmt, va_list argp)
Printf callback type.
Definition: gr55xx_sys.h:85
pmu_trim_info_t::io_ldo_vout
uint8_t io_ldo_vout
IO LDO Vout.
Definition: gr55xx_sys.h:189
sdk_version_t::major
uint8_t major
Major version.
Definition: gr55xx_sys.h:136
adc_trim_info_t::offset_int_2p0
uint16_t offset_int_2p0
Internal reference 2.0v.
Definition: gr55xx_sys.h:180
adc_trim_info_t::slope_int_1p6
uint16_t slope_int_1p6
Internal reference 1.6v.
Definition: gr55xx_sys.h:177
assert_err_cb_t
void(* assert_err_cb_t)(const char *expr, const char *file, int line)
Error assert callback type.
Definition: gr55xx_sys.h:97
sys_context_checksum_gen
void sys_context_checksum_gen(void)
Generate checksum info for system context.
sys_rf_trim_get
uint16_t sys_rf_trim_get(rf_trim_info_t *p_rf_trim)
Get the RF trim information.
sys_lpclk_get
uint32_t sys_lpclk_get(void)
Get low power CLK frequency.
rf_trim_info_t
RF trim parameter information definition.
Definition: gr55xx_sys.h:164
sdk_version_t::minor
uint8_t minor
Minor version.
Definition: gr55xx_sys.h:137
sys_attdb_usage_ratio_get
uint8_t sys_attdb_usage_ratio_get(void)
Get system attriute database heap usage ratio.
sys_max_msg_usage_ratio_set
void sys_max_msg_usage_ratio_set(uint8_t usage_ratio)
Set system maximum usage ratio of message heap.
adc_trim_info_t::offset_int_0p8
uint16_t offset_int_0p8
Internal reference 0.8v.
Definition: gr55xx_sys.h:174
PACKAGE_NONE
@ PACKAGE_NONE
Package unused.
Definition: gr55xx_sys.h:120
adc_trim_info_t::slope_ext_1p0
uint16_t slope_ext_1p0
External reference 1.0v.
Definition: gr55xx_sys.h:181
sys_device_addr_get
uint16_t sys_device_addr_get(uint8_t *p_device_addr)
Get the device address information.
sys_lpclk_update_func_with_return_register
void sys_lpclk_update_func_with_return_register(int_func_t func_update_lpclk)
Register low power clock update function with int return.
sys_signal_handler_register
void sys_signal_handler_register(callback_t isr_handler)
Register signal handler.
timer_callback_t
void(* timer_callback_t)(uint8_t timer_id)
Timer callback type.
Definition: gr55xx_sys.h:82
PACKAGE_GR5513BEND
@ PACKAGE_GR5513BEND
QFN40 + 128KB RAM + 512KB flash packet.
Definition: gr55xx_sys.h:125
sys_context_func_t
void(* sys_context_func_t)(void)
Function type for saving user context before deep sleep.
Definition: gr55xx_sys.h:94
PACKAGE_GR5515I0ND
@ PACKAGE_GR5515I0ND
QFN56 + no flash package.
Definition: gr55xx_sys.h:124
PACKAGE_GR5515BEND
@ PACKAGE_GR5515BEND
QFN40 + 256KB RAM + 512KB flash packet.
Definition: gr55xx_sys.h:126
adc_trim_info_t::slope_int_0p8
uint16_t slope_int_0p8
Internal reference 0.8v.
Definition: gr55xx_sys.h:173
sys_assert_cb_t::assert_warn_cb
assert_warn_cb_t assert_warn_cb
Assert warning type callback.
Definition: gr55xx_sys.h:147
pmu_trim_info_t
PMU trim parameter information definition.
Definition: gr55xx_sys.h:187
SYS_DEV_SRAM_128K
@ SYS_DEV_SRAM_128K
Supported 128K SRAM.
Definition: gr55xx_sys.h:113
sdk_version_t
SDK version definition.
Definition: gr55xx_sys.h:135
PACKAGE_GR5515GGBD
@ PACKAGE_GR5515GGBD
BGA55 package.
Definition: gr55xx_sys.h:122
sys_free
void sys_free(void *p_mem)
Free allocated memory.
sys_app_printf
void sys_app_printf(const char *format,...)
Output debug logs.
assert_param_cb_t
void(* assert_param_cb_t)(int param0, int param1, const char *file, int line)
Parameter assert callback type.
Definition: gr55xx_sys.h:100
gr55xx_sys_cfg.h
Define the chip configuration.
sys_link_quality_clear
void sys_link_quality_clear(uint8_t conn_idx)
Clear link quality info.
restore_sys_context
void restore_sys_context(void)
Load system context.
void_func_t
void(* void_func_t)(void)
Low power clock update function type.
Definition: gr55xx_sys.h:88
sys_device_package_get
uint16_t sys_device_package_get(package_type_t *p_package_type)
Get the chip's package type.
adc_trim_info_t::slope_int_2p0
uint16_t slope_int_2p0
Internal reference 2.0v.
Definition: gr55xx_sys.h:179
sys_msg_usage_ratio_get
uint8_t sys_msg_usage_ratio_get(void)
Get system message heap usage ratio.
sys_crystal_trim_get
uint16_t sys_crystal_trim_get(uint16_t *p_crystal_trim)
Get the crystal trim information.
sys_link_quality_get
uint8_t sys_link_quality_get(uint8_t conn_idx, link_rx_info_t *rx_info)
Get link quality info.
gr55xx_nvds.h
NVDS API.
sys_context_save
void sys_context_save(void)
Save system context.
gr55xx_pwr.h
GR55XX Platform Power Manager Module API.
sys_security_data_use_present
void sys_security_data_use_present(uint32_t addr, uint8_t *input, uint32_t size, uint8_t *output)
Encrypt and decrypt data using Present.
sys_env_usage_ratio_get
uint8_t sys_env_usage_ratio_get(void)
Get system environment heap usage ratio.
adc_trim_info_t::adc_temp
uint16_t adc_temp
ADC TEMP.
Definition: gr55xx_sys.h:172
int_func_t
int(* int_func_t)(void)
Low power clock update function type with resturn.
Definition: gr55xx_sys.h:91
sys_ble_heartbeat_period_set
uint16_t sys_ble_heartbeat_period_set(uint32_t period_hus)
Set BLE Sleep HeartBeat Period.
sys_delay_ms
void sys_delay_ms(uint32_t ms)
Delay the function execution.
sys_delay_us
void sys_delay_us(uint32_t us)
Delay the function execution.
package_type_t
package_type_t
package type.
Definition: gr55xx_sys.h:119
sys_pmu_trim_get
uint16_t sys_pmu_trim_get(pmu_trim_info_t *p_pmu_trim)
Get the PMU trim information.
pmu_trim_info_t::io_ldo_bypass
uint8_t io_ldo_bypass
IO LDO bypass.
Definition: gr55xx_sys.h:188
sys_device_uid_get
uint16_t sys_device_uid_get(uint8_t *p_device_uid)
Get the device UID information.
sys_lpclk_update_func_register
void sys_lpclk_update_func_register(void_func_t func_update_lpclk)
Register low power clock update function.
rf_trim_info_t::rssi_cali
int8_t rssi_cali
RSSI calibration.
Definition: gr55xx_sys.h:165
sys_swd_disable
void sys_swd_disable(void)
Diable swd function.
sys_adc_trim_get
uint16_t sys_adc_trim_get(adc_trim_info_t *p_adc_trim)
Get the ADC trim information.
sys_sdk_verison_get
void sys_sdk_verison_get(sdk_version_t *p_version)
Get SDK version.
SYS_DEV_SRAM_64K
@ SYS_DEV_SRAM_64K
Supported 64K SRAM.
Definition: gr55xx_sys.h:112
adc_trim_info_t::offset_ext_1p0
uint16_t offset_ext_1p0
External reference 1.0v.
Definition: gr55xx_sys.h:182
sys_device_lp_gain_offset_2m_get
uint16_t sys_device_lp_gain_offset_2m_get(uint8_t *p_offset)
Get the LP gain offset 2M information.
sys_trim_sum_get
uint16_t sys_trim_sum_get(uint16_t *p_trim_sum)
Get the trim checksum.
sys_device_sram_get
uint16_t sys_device_sram_get(sram_size_t *p_sram_size)
Get the RAM size information.
sys_assert_cb_t::assert_param_cb
assert_param_cb_t assert_param_cb
Assert parameter error type callback.
Definition: gr55xx_sys.h:146
PACKAGE_GR5515IGND
@ PACKAGE_GR5515IGND
QFN56 + 1024K flash package.
Definition: gr55xx_sys.h:123
sys_swd_enable
void sys_swd_enable(void)
Enable swd function.
sys_nonret_usage_ratio_get
uint8_t sys_nonret_usage_ratio_get(void)
Get system non retention heap usage ratio.
adc_trim_info_t
ADC trim parameter information definition.
Definition: gr55xx_sys.h:171
rf_trim_info_t::tx_power
int8_t tx_power
TX power.
Definition: gr55xx_sys.h:166
sdk_version_t::commit_id
uint32_t commit_id
commit ID.
Definition: gr55xx_sys.h:139
sdk_version_t::build
uint16_t build
Build number.
Definition: gr55xx_sys.h:138
adc_trim_info_t::slope_int_1p2
uint16_t slope_int_1p2
Internal reference 1.2v.
Definition: gr55xx_sys.h:175
sys_lpclk_set
void sys_lpclk_set(uint32_t user_lpclk)
Set low power CLK frequency.
pmu_trim_info_t::dcdc_vout
uint8_t dcdc_vout
DCDC Vout.
Definition: gr55xx_sys.h:192
SYS_DEV_SRAM_256K
@ SYS_DEV_SRAM_256K
Supported 256K SRAM.
Definition: gr55xx_sys.h:114
sys_assert_cb_t
Assert callbacks.
Definition: gr55xx_sys.h:144
pmu_trim_info_t::dig_ldo_64m
uint8_t dig_ldo_64m
DIG LDO 64m.
Definition: gr55xx_sys.h:190
sys_assert_cb_register
void sys_assert_cb_register(sys_assert_cb_t *p_assert_cb)
Register assert callbacks.
sys_regs_save
void sys_regs_save(volatile uint32_t *p_address, uint32_t value)
Save system registers.
sys_ble_heartbeat_period_get
uint16_t sys_ble_heartbeat_period_get(uint32_t *p_period_hus)
Get BLE Sleep HeartBeat Period.
sys_malloc
void * sys_malloc(uint32_t size)
Memory allocation.
sys_security_enable_status_check
uint32_t sys_security_enable_status_check(void)
Check the chip's security level.
sys_lpper_get
uint32_t sys_lpper_get(void)
Get low power CLK period.
sys_us_2_lpcycles
uint32_t sys_us_2_lpcycles(uint32_t us)
Convert a duration in μs into a duration in lp cycles.
adc_trim_info_t::offset_int_1p6
uint16_t offset_int_1p6
Internal reference 1.6v.
Definition: gr55xx_sys.h:178
pmu_trim_info_t::dig_ldo_16m
uint8_t dig_ldo_16m
DIG LDO 16m.
Definition: gr55xx_sys.h:191
gr55xx_fpb.h
sys_assert_cb_t::assert_err_cb
assert_err_cb_t assert_err_cb
Assert error type callback.
Definition: gr55xx_sys.h:145
ble.h
include all ble sdk header files
PACKAGE_GR5515RGBD
@ PACKAGE_GR5515RGBD
BGA68 package.
Definition: gr55xx_sys.h:121
sys_ke_sleep_check
bool sys_ke_sleep_check(void)
Get status of ke_event list.