Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Arduino SDK libraries #244

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
#define F_BT_LE_READ_REMOTE_VERSION_INFO_SUPPORT (F_BT_LE_SUPPORT && 1)

//BT 4.1
#define F_BT_LE_4_1_COC_SUPPORT (F_BT_LE_SUPPORT && 1)
#define F_BT_LE_4_1_SUPPORT (F_BT_LE_SUPPORT && 1)
#define F_BT_LE_4_1_COC_SUPPORT (F_BT_LE_4_1_SUPPORT && 1)

//BT 4.2
#define F_BT_LE_4_2_SUPPORT (F_BT_LE_SUPPORT && 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 0
#define VERSION_REVISION 0
#define VERSION_BUILDNUM 681
#define VERSION_GCID 0x16c0bd8b
#define VERSION_GCIDH 0xbbdf0d0d
#define VERSION_PGCID 0x8265090d
#define VERSION_PGCIDH 0xb89a2871
#define VERSION_BUILDNUM 861
#define VERSION_GCID 0xd0611a85
#define VERSION_GCIDH 0xe954ba7f
#define VERSION_PGCID 0x15d22af0
#define VERSION_PGCIDH 0x8d5d8dc0
#define LIB_NAME "amebapro2"
#define CUSTOMER_NAME lib
#define CN_1 'l'
Expand All @@ -16,14 +16,14 @@
#define CN_6 '#'
#define CN_7 '#'
#define CN_8 '#'
#define BUILDING_TIME "Thu Mar 30 16:50:34 2023"
#define BUILDING_TIME "Fri Mar 29 10:38:25 2024"
#define NAME2STR(a) #a
#define CUSTOMER_NAME_S #NAME2STR(CUSTOMER_NAME)
#define NUM4STR(a,b,c,d) #a "." #b "." #c "." #d
#define VERSIONBUILDSTR(a,b,c,d) NUM4STR(a,b,c,d)
#define VERSION_BUILD_STR VERSIONBUILDSTR(VERSION_MAJOR,VERSION_MINOR,VERSION_REVISION,VERSION_BUILD)
#define COMMIT 16c0bd8bbbdf
#define BUILDING_TIME_STR Thu_2023_03_30_16_50_34
#define COMMIT d0611a85e954
#define BUILDING_TIME_STR Fri_2024_03_29_10_38_26
#define BUILDER server
#define BUILDER_STR server
#define TO_STR(R) NAME2STR(R)
Expand Down
220 changes: 220 additions & 0 deletions Arduino_package/hardware/system/component/mbed/hal_ext/ecdsa_api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
/** mbed Microcontroller Library
******************************************************************************
* @file ecdsa_api.h
* @author
* @version V1.0.0
* @brief This file provides following mbed ECDSA API
******************************************************************************
* @attention
*
* Copyright(c) 2006 - 2022 Realtek Corporation. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/

#ifndef MBED_EXT_ECDSA_API_EXT_H
#define MBED_EXT_ECDSA_API_EXT_H

#include "device.h"

#ifdef __cplusplus
extern "C" {
#endif

/** @addtogroup ecdsa ECDSA
* @ingroup hal
* @brief ecdsa functions
* @{
*/


/**
\brief Define the ECDSA bit length.
*/
typedef enum {
ECDSA_L_256 = ECDSA_256_BIT,
ECDSA_L_224 = ECDSA_224_BIT,
ECDSA_L_192 = ECDSA_192_BIT,
ECDSA_L_160 = ECDSA_160_BIT,
ECDSA_L_128 = ECDSA_128_BIT,
ECDSA_L_112 = ECDSA_112_BIT,
ECDSA_L_232 = ECDSA_232_BIT,
ECDSA_L_200 = ECDSA_200_BIT,
ECDSA_L_168 = ECDSA_168_BIT,
ECDSA_L_136 = ECDSA_136_BIT,
ECDSA_L_120 = ECDSA_120_BIT
} ecdsa_bit_num;

/**
\brief Define the ECDSA Curve.
*/
typedef enum {
CURVE_SPEC256K1 = ECDSA_SPEC256K1,
CURVE_P256 = ECDSA_P256,
CURVE_CURVE25519_W = ECDSA_CURVE25519_W,
OTHER_CURVE = ECDSA_OTHERS
} ecdsa_curve;

/**
\brief Define the private key of ECDSA.
*/
typedef enum {
INPUT_PRK = ECDSA_INPUT_PRK,
OTP_PRK_1 = ECDSA_OTP_PRK_1,
OTP_PRK_2 = ECDSA_OTP_PRK_2
} ecdsa_sel_prk;

typedef void (*ecdsa_irq_handler)(void *);

typedef struct ecdsa_s ecdsa_t;

/**
\brief Describe ECDSA curve parameter
*/
typedef struct ecdsa_curve_para_s {
u32 *ppoint_x; /*!< Base point x address */
u32 *ppoint_y; /*!< Base point y addres */
u32 *pa_adr; /*!< Curve cor_a addres */
u32 *pprime; /*!< Prime addres */
u32 *porder_n; /*!< Order_n addres */
ecdsa_bit_num bit_num; /*!< Bit length */
ecdsa_curve curve; /*!< Curve */
} ecdsa_curve_para_t, *pecdsa_curve_para_t;

/**
* @brief Initialize the ECDSA hardware and turn on the ECDSA
* @param obj: ECDSA object define in application software.
* @retval none
*/
void ecdsa_init(ecdsa_t *obj);

/**
* @brief Register the ECDSA callback function and argument.
* @param obj: ECDSA object define in application software.
* @param handler: The callback function.
* @param parg: The callback argument.
* @retval none
*/
void ecdsa_cb_irq_handler(ecdsa_t *obj, ecdsa_irq_handler handler, void *parg);

/**
* @brief Set the ECDSA curve.
* @param obj: ECDSA object define in application software.
* @param pecdsa_curve_para: Set curve parameters.
* @retval none
*/
void ecdsa_set_curve(ecdsa_t *obj, ecdsa_curve_para_t *pecdsa_curve_para);

/**
* @brief Generate the ECDSA signature.
* @param obj: ECDSA object define in application software.
* @param pprivate_key: Set private key.
* @param prandom_k: Set random k.
* @retval none
*/
void ecdsa_signature(ecdsa_t *obj, u32 *pprivate_key, u32 *prandom_k);

/**
* @brief Make the ECDSA verificaion.
* @param obj: ECDSA object define in application software.
* @param pprivate_key: Set private key.
* @param prandom_k: Set random k.
* @retval none
*/
void ecdsa_verificaion(ecdsa_t *obj, u32 *ppublic_key_x, u32 *ppublic_key_y, u32 *pr, u32 *ps);

/**
* @brief Set the ECDSA hash.
* @param obj: ECDSA object define in application software.
* @param phash: Set hash.
* @retval none
*/
void ecdsa_hash(ecdsa_t *obj, u32 *phash);

/**
* @brief De-initialize of the ECDSA hardware and turn off the ECDSA.
* @retval none
*/
void ecdsa_deinit(ecdsa_t *obj);

/**
* @brief Get the result of using ECDSA HW to check error status.
* @param obj: ECDSA object define in application software.
* @retval Error Status
*/
u32 ecdsa_get_err_sta(ecdsa_t *obj);

/**
* @brief Get the pubic key of the signature.
* @param obj: ECDSA object define in application software.
* @param ppub_key_x: Set the pointer to get the pubic key x.
* @param ppub_key_y: Set the pointer to get the pubic key y.
* @retval none
*/
void ecdsa_get_pbk(ecdsa_t *obj, u32 *ppub_key_x, u32 *ppub_key_y);

/**
* @brief Get signature R and S.
* @param obj: ECDSA object define in application software.
* @param pr_adr: Set the pointer to get R.
* @param ps_adr: Set the pointer to get S.
* @retval none
*/
void ecdsa_get_rs(ecdsa_t *obj, u32 *pr_adr, u32 *ps_adr);

/**
* @brief Get verificaion X and Y.
* @param obj: ECDSA object define in application software.
* @param prx_adr: Set the pointer to get X.
* @param pry_adr: Set the pointer to get Y.
* @retval none
*/
void ecdsa_get_result_x_y(ecdsa_t *obj, u32 *prx_adr, u32 *pry_adr);

/**
* @brief Get verificaion result.
* @param obj: ECDSA object define in application software.
* @retval Verificaion result. 0: Pass
*/
u32 ecdsa_get_veri_result(ecdsa_t *obj);

/**
* @brief Generate public key.
* @param obj: ECDSA object define in application software.
* @param ppriv_key: Set private key.
* @param ppoint_x: Set the base point x.
* @param ppoint_y: Set the base point y.
* @retval none
*/
void ecdsa_gen_public_key(ecdsa_t *obj, uint32_t *ppriv_key, uint32_t *ppoint_x, uint32_t *ppoint_y);

/**
* @brief Select private key.
* @param obj: ECDSA object define in application software.
* @param sel_private_key: Select private key. INPUT_PRK: need to set key, OTP_PRK_1: OTP private key 1, OTP_PRK_2: OTP private key 1.
* @retval none
*/
void ecdsa_select_prk(ecdsa_t *obj, ecdsa_sel_prk sel_private_key);

/*\@}*/

#ifdef __cplusplus
}
#endif

#endif

Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,5 @@ void video_set_sensor_id(int SensorName);
void video_setup_sensor(void *sensor_setup_cb);
void video_show_fps(int enable);
int video_get_cb_fps(int chn);
void video_set_fps_dropframe_mode(int drop_frame);
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,17 @@
#define MPU_REGION2_ATTR_IDX 0 // the memory attribute indirect index of the MAIR0/1

// MPU region 3 configuration
#define MPU_REGION3_EN 0 // If MPU region 3 configuration enabled
#define MPU_REGION3_EN 1 // If MPU region 3 configuration enabled
// define MPU region 3 configuration
#define MPU_REGION3_BASE (0x20179E00) /* region base, the address must be aligned to multiple of 32 bytes,
extern uint32_t __sram_rev_start__[];
extern uint32_t __sram_rev_end__[];
#define MPU_REGION3_BASE ((uint32_t)__sram_rev_start__) /* region base, the address must be aligned to multiple of 32 bytes,
it should sync. with the linker script */
#define MPU_REGION3_LIMIT (0x20179FFF) // region limit, it should sync. with linker script
#define MPU_REGION3_LIMIT ((uint32_t)__sram_rev_end__) // region limit, it should sync. with linker script
#define MPU_REGION3_XN MPU_EXEC_ALLOW // eXecute Never attribute
#define MPU_REGION3_AP MPU_UN_PRIV_RW // Access permissions
#define MPU_REGION3_SH MPU_OUT_SHAREABLE // Shareability for Normal memory
#define MPU_REGION3_ATTR_IDX 2 // the memory attribute indirect index of the MAIR0/1
#define MPU_REGION3_ATTR_IDX 0 // the memory attribute indirect index of the MAIR0/1

// MPU region 4 configuration
#define MPU_REGION4_EN 0 // If MPU region 4 configuration enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,48 @@ extern "C"
/**
\brief Defines FEMAC Interrupt Status/Mask register (0x3C)
*/
// IMR
#define FEMAC_IMR_SHIFT_SWINT 26
#define FEMAC_IMR_BIT_SWINT ((u32)0x00000001 << 26)
#define FEMAC_IMR_SHIFT_TDU 25
#define FEMAC_IMR_BIT_TDU ((u32)0x00000001 << 25)
#define FEMAC_IMR_SHIFT_LINKCHG 24
#define FEMAC_IMR_BIT_LINKCHG ((u32)0x00000001 << 24)
#define FEMAC_IMR_SHIFT_TER 23
#define FEMAC_IMR_BIT_TER ((u32)0x00000001 << 23)
#define FEMAC_IMR_SHIFT_TOK 22
#define FEMAC_IMR_BIT_TOK ((u32)0x00000001 << 22)
#define FEMAC_IMR_SHIFT_RDU 21
#define FEMAC_IMR_BIT_RDU ((u32)0x00000001 << 21)
#define FEMAC_IMR_SHIFT_RER_OVF 20
#define FEMAC_IMR_BIT_RER_OVF ((u32)0x00000001 << 20)
#define FEMAC_IMR_SHIFT_RER_RUNT 18
#define FEMAC_IMR_BIT_RER_RUNT ((u32)0x00000001 << 18)
#define FEMAC_IMR_SHIFT_CNT_WRAP 17
#define FEMAC_IMR_BIT_CNT_WRAP ((u32)0x00000001 << 17)
#define FEMAC_IMR_SHIFT_ROK 16
#define FEMAC_IMR_BIT_ROK ((u32)0x00000001 << 16)
// ISR
#define FEMAC_ISR_SHIFT_SWINT 10
#define FEMAC_ISR_BIT_SWINT ((u32)0x00000001 << 10)
#define FEMAC_ISR_SHIFT_TDU 9
#define FEMAC_ISR_BIT_TDU ((u32)0x00000001 << 9)
#define FEMAC_ISR_SHIFT_LINKCHG 8
#define FEMAC_ISR_BIT_LINKCHG ((u32)0x00000001 << 8)
#define FEMAC_ISR_SHIFT_TER 7
#define FEMAC_ISR_BIT_TER ((u32)0x00000001 << 7)
#define FEMAC_ISR_SHIFT_TOK 6
#define FEMAC_ISR_BIT_TOK ((u32)0x00000001 << 6)
#define FEMAC_ISR_SHIFT_RDU 5
#define FEMAC_ISR_BIT_RDU ((u32)0x00000001 << 5)
#define FEMAC_ISR_SHIFT_RER_OVF 4
#define FEMAC_ISR_BIT_RER_OVF ((u32)0x00000001 << 4)
#define FEMAC_ISR_SHIFT_RER_RUNT 2
#define FEMAC_ISR_BIT_RER_RUNT ((u32)0x00000001 << 2)
#define FEMAC_ISR_SHIFT_CNT_WRAP 1
#define FEMAC_ISR_BIT_CNT_WRAP ((u32)0x00000001 << 1)
#define FEMAC_ISR_SHIFT_ROK 0
#define FEMAC_ISR_BIT_ROK ((u32)0x00000001 << 0)

/**
\brief Defines FEMAC Receive Configuration register (0x44)
Expand Down Expand Up @@ -222,11 +254,17 @@ enum fephy_reg_addr {
\brief Defines Ethernet interrupt event.
*/
enum eth_int_event_e {
EthTxDone = 0,
EthRxDone = 1,
EthLinkUp = 2,
EthLinkDown = 3,
EthRx_RDU = 4
EthIntRok = 0,
EthIntCntWrap = 1,
EthIntRerRunt = 2,
EthIntRerOvf = 3,
EthIntRdu = 4,
EthIntTok = 5,
EthIntTer = 6,
EthIntLinkUp = 7,
EthIntLinkDown = 8,
EthIntTdu = 9,
EthIntSwInt = 10
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ int hal_isp_set_ctrl(uint32_t id, int *value);
int hal_isp_set_init_ae(int init_exposure, int init_gain);
int hal_isp_set_init_awb(int init_r_gain, int init_b_gain);
void hal_isp_set_drop_frame_num(uint32_t num);
void hal_isp_set_drop_frame_num_sw(uint32_t num);
int hal_isp_set_init_dn_mode(int dn_mode);
void hal_isp_set_direct_i2c_mode(uint32_t direct_i2c_mode);
int hal_isp_set_init_gray_mode(int gray_mode);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<03/28/2024 12:00 Juling>
Version : RTL8735B_VOE_1.5.3.0
Modified Files:
All
Change Notes:

ISP/sensor related
1. Improve RGB stream SW drop frame flow
2. Add release slot error handling
3. Soften the limitation of AE initial exp value

--------------------------------------------------------------------------
<03/15/2024 12:00 Juling>
Version : RTL8735B_VOE_1.5.2.0
Modified Files:
Expand Down
Loading
Loading