Skip to content

Commit

Permalink
updated sdk to v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Huckies committed Jan 18, 2024
1 parent d53626d commit 904861c
Show file tree
Hide file tree
Showing 29 changed files with 31,815 additions and 31,877 deletions.
2 changes: 2 additions & 0 deletions qmk_porting/protocol/pre_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ enum {
#error "Too many BLE slots! Cap: 16"
#endif

#define BLE_SNV_NUM ((EEPROM_MAX_SIZE - BLE_SNV_ADDR) / BLE_SNV_BLOCK)

#ifdef BATTERY_MEASURE_PIN
#if BATTERY_MEASURE_PIN != A7 && BATTERY_MEASURE_PIN != A8 && BATTERY_MEASURE_PIN != A9 && \
BATTERY_MEASURE_PIN != A4 && BATTERY_MEASURE_PIN != A5 && BATTERY_MEASURE_PIN != A6 && \
Expand Down
21 changes: 17 additions & 4 deletions sdk/BLE_LIB/CH58xBLE_LIB.H
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/********************************** (C) COPYRIGHT ******************************
* File Name : CH58xBLE_LIB.H
* Author : WCH
* Version : V1.91
* Date : 2023/09/18
* Version : V2.00
* Date : 2024/01/02
* Description : head file
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
Expand Down Expand Up @@ -191,7 +191,7 @@ typedef struct
/*********************************************************************
* GLOBAL MACROS
*/
#define VER_FILE "CH58x_BLE_LIB_V1.9"
#define VER_FILE "CH58x_BLE_LIB_V2.0"
extern const uint8_t VER_LIB[]; // LIB version
#define SYSTEM_TIME_MICROSEN 625 // unit of process event timer is 625us
#define MS1_TO_SYSTEM_TIME(x) ((x)*1000/SYSTEM_TIME_MICROSEN) // transform unit in ms to unit in 625us ( attentional bias )
Expand Down Expand Up @@ -890,7 +890,9 @@ extern const uint8_t VER_LIB[]; // LIB version
#define TGAP_ADV_PRIMARY_PHY_OPTIONS 64 //!< Indicate the Host's preference or requirement concerning coding scheme.Default GAP_PHY_OPTIONS_NOPRE.
#define TGAP_ADV_SECONDARY_PHY_OPTIONS 65 //!< indicate the Host's preference or requirement concerning coding scheme (including for periodic advertising).Default GAP_PHY_OPTIONS_NOPRE.

#define TGAP_PARAMID_MAX 66 //!< ID MAX-valid Parameter ID
#define TGAP_ADV_RSP_RSSI_MIN 66 //!< The minimum RSSI for advertising to send scanning response. Default -127.

#define TGAP_PARAMID_MAX 67 //!< ID MAX-valid Parameter ID

// GAP_DEVDISC_MODE_DEFINES GAP Device Discovery Modes
#define DEVDISC_MODE_NONDISCOVERABLE 0x00 //!< No discoverable setting
Expand Down Expand Up @@ -4545,6 +4547,17 @@ extern bStatus_t RF_Shut( void );
*/
extern void RF_SetChannel( uint32_t channel );

/**
* @brief rf mode set radio frequency and whitening channel index
* note: LLEMode bit6 set 1
*
* @param frequency -
* @param ch - the whitening channel index
*
* @return 0 - success.
*/
extern bStatus_t RF_SetFrequency( uint32_t frequency, uint8_t ch );

/**
* @brief shut down rf frequency hopping
*
Expand Down
18 changes: 15 additions & 3 deletions sdk/BLE_LIB/CH58xBLE_ROM.H
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/********************************** (C) COPYRIGHT ******************************
* File Name : CH58xBLE_ROM.H
* Author : WCH
* Version : V1.91
* Date : 2023/09/18
* Version : V2.00
* Date : 2024/01/02
* Description : head file
* Address Space
* CODE: 00010000H - 0003FFFFH 192K
Expand Down Expand Up @@ -201,7 +201,7 @@ typedef struct
/*********************************************************************
* GLOBAL MACROS
*/
#define VER_FILE "CH58x_BLE_LIB_V1.9"
#define VER_FILE "CH58x_BLE_LIB_V2.0"
extern const uint8_t VER_LIB[]; // LIB version
#define SYSTEM_TIME_MICROSEN 625 // unit of process event timer is 625us
#define MS1_TO_SYSTEM_TIME(x) ((x)*1000/SYSTEM_TIME_MICROSEN) // transform unit in ms to unit in 625us ( attentional bias )
Expand Down Expand Up @@ -4570,6 +4570,18 @@ typedef struct tag_rf_config
*/
#define RF_SetChannel (( void (*) ( uint32_t channel )) BLE_LIB_JT(115) )

/**
* @brief rf mode set radio frequency and whitening channel index
* note: LLEMode bit6 set 1
*
* @param frequency -
* @param ch - the whitening channel index
*
* @return 0 - success.
*/
#define RF_SetFrequency (( bStatus_t (*) ( uint32_t frequency, uint8_t channel )) BLE_LIB_JT(141) )


/**
* @brief shut down rf frequency hopping
*
Expand Down
Loading

0 comments on commit 904861c

Please sign in to comment.