aboutsummaryrefslogtreecommitdiff
path: root/CH5xx_ble_firmware_library/StdPeriphDriver/inc/CH58x_common.h
diff options
context:
space:
mode:
authorFran莽ois Cartegnie <281376+fcartegnie@users.noreply.github.com>2024-06-06 11:22:09 +0700
committerGitHub <noreply@github.com>2024-06-06 11:22:09 +0700
commitf6d84a1ead1a57574c45bb80b6fd450c5b784e09 (patch)
treeccfe2db3861197bc29eff52e53a814d909501863 /CH5xx_ble_firmware_library/StdPeriphDriver/inc/CH58x_common.h
parentd641c0de85f6ccf73c8c99012f1a5c4e28af54dc (diff)
parent90cdb61063b408aa4d8ba0c1e3c36d804f69f61a (diff)
Merge pull request #10 from kienvo/led-scan
Add basic Charlieplexing scan
Diffstat (limited to 'CH5xx_ble_firmware_library/StdPeriphDriver/inc/CH58x_common.h')
-rw-r--r--CH5xx_ble_firmware_library/StdPeriphDriver/inc/CH58x_common.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/CH5xx_ble_firmware_library/StdPeriphDriver/inc/CH58x_common.h b/CH5xx_ble_firmware_library/StdPeriphDriver/inc/CH58x_common.h
new file mode 100644
index 0000000..f77af25
--- /dev/null
+++ b/CH5xx_ble_firmware_library/StdPeriphDriver/inc/CH58x_common.h
@@ -0,0 +1,101 @@
+/********************************** (C) COPYRIGHT *******************************
+ * File Name : CH57x_common.h
+ * Author : WCH
+ * Version : V1.2
+ * Date : 2021/11/17
+ * Description
+ *********************************************************************************
+ * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
+ * Attention: This software (modified or not) and binary are used for
+ * microcontroller manufactured by Nanjing Qinheng Microelectronics.
+ *******************************************************************************/
+
+
+#ifndef __CH58x_COMM_H__
+#define __CH58x_COMM_H__
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+#ifndef NULL
+#define NULL 0
+#endif
+#define ALL 0xFFFF
+
+#ifndef __HIGH_CODE
+#define __HIGH_CODE __attribute__((section(".highcode")))
+#endif
+
+#ifndef __INTERRUPT
+#ifdef INT_SOFT
+#define __INTERRUPT __attribute__((interrupt()))
+#else
+#define __INTERRUPT __attribute__((interrupt("WCH-Interrupt-fast")))
+#endif
+#endif
+
+#define Debug_UART0 0
+#define Debug_UART1 1
+#define Debug_UART2 2
+#define Debug_UART3 3
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+/**
+ * @brief 系统主频时钟(Hz)
+ */
+#ifndef FREQ_SYS
+#define FREQ_SYS 60000000
+#endif
+
+#ifndef SAFEOPERATE
+#define SAFEOPERATE __nop();__nop()
+#endif
+
+/**
+ * @brief 32K时钟(Hz)
+ */
+#ifdef CLK_OSC32K
+#if ( CLK_OSC32K == 1 )
+#define CAB_LSIFQ 32000
+#else
+#define CAB_LSIFQ 32768
+#endif
+#else
+#define CAB_LSIFQ 32000
+#endif
+
+#include <string.h>
+#include <stdint.h>
+#include "CH583SFR.h"
+#include "core_riscv.h"
+#include "CH58x_clk.h"
+#include "CH58x_uart.h"
+#include "CH58x_gpio.h"
+#include "CH58x_i2c.h"
+#include "CH58x_flash.h"
+#include "CH58x_pwr.h"
+#include "CH58x_pwm.h"
+#include "CH58x_adc.h"
+#include "CH58x_sys.h"
+#include "CH58x_timer.h"
+#include "CH58x_spi.h"
+#include "CH58x_usbdev.h"
+#include "CH58x_usbhost.h"
+#include "ISP583.h"
+
+
+#define DelayMs(x) mDelaymS(x)
+#define DelayUs(x) mDelayuS(x)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __CH58x_COMM_H__
+