Skip to content

Commit ac91953

Browse files
committed
Release v6.1.0
1 parent 7689c2d commit ac91953

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2501
-512
lines changed

Core/openbl_core.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
#ifndef OPENBL_CORE_H
2121
#define OPENBL_CORE_H
2222

23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif /* __cplusplus */
26+
2327
/* Includes ------------------------------------------------------------------*/
2428
#include <stdint.h>
2529

@@ -30,7 +34,7 @@
3034
#define ACK_BYTE 0x79U /* Acknowledge Byte ID */
3135
#define NACK_BYTE 0x1FU /* No Acknowledge Byte ID */
3236
#define BUSY_BYTE 0x76U /* Busy Byte */
33-
#define SYNC_BYTE 0xA5U /* synchronization byte */
37+
#define SYNC_BYTE 0xA5U /* Synchronization byte */
3438
#define SPECIAL_CMD_SIZE_BUFFER1 128U /* Special command received data buffer size */
3539
#define SPECIAL_CMD_SIZE_BUFFER2 1024U /* Special command write data buffer size */
3640

@@ -54,8 +58,8 @@
5458
#define CMD_NS_WRITE_UNPROTECT 0x74U /* No Stretch Write Unprotect command */
5559
#define CMD_NS_READ_PROTECT 0x83U /* No Stretch Read Protect command */
5660
#define CMD_NS_READ_UNPROTECT 0x93U /* No Stretch Read Unprotect command */
57-
#define CMD_SPECIAL_COMMAND 0x50U /* Special Read Protect */
58-
#define CMD_EXTENDED_SPECIAL_COMMAND 0x51U /* Special write command */
61+
#define CMD_SPECIAL_COMMAND 0x50U /* Special Command command */
62+
#define CMD_EXTENDED_SPECIAL_COMMAND 0x51U /* Extended Special Command command */
5963
#define CMD_CHECKSUM 0xA1U /* Checksum command */
6064

6165
/* Exported types ------------------------------------------------------------*/
@@ -123,4 +127,8 @@ uint32_t OPENBL_InterfaceDetection(void);
123127
void OPENBL_CommandProcess(void);
124128
ErrorStatus OPENBL_RegisterInterface(OPENBL_HandleTypeDef *Interface);
125129

130+
#ifdef __cplusplus
131+
}
132+
#endif /* __cplusplus */
133+
126134
#endif /* OPENBL_CORE_H */

Interfaces/Patterns/FDCAN/fdcan_interface.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ static void OPENBL_FDCAN_Init(void);
4343

4444
/* Private functions ---------------------------------------------------------*/
4545
/**
46-
* @brief This function is used to initialize the used FDCAN instance.
47-
* @retval None.
48-
*/
46+
* @brief This function is used to initialize the used FDCAN instance.
47+
* @retval None.
48+
*/
4949
static void OPENBL_FDCAN_Init(void)
5050
{
5151
/* Bit time configuration:
@@ -112,9 +112,9 @@ static void OPENBL_FDCAN_Init(void)
112112
/* Exported functions --------------------------------------------------------*/
113113

114114
/**
115-
* @brief This function is used to configure FDCAN pins and then initialize the used FDCAN instance.
116-
* @retval None.
117-
*/
115+
* @brief This function is used to configure FDCAN pins and then initialize the used FDCAN instance.
116+
* @retval None.
117+
*/
118118
void OPENBL_FDCAN_Configuration(void)
119119
{
120120
/* Enable all resources clocks --------------------------------------------*/
@@ -125,9 +125,9 @@ void OPENBL_FDCAN_Configuration(void)
125125
}
126126

127127
/**
128-
* @brief This function is used to De-initialize the FDCAN pins and instance.
129-
* @retval None.
130-
*/
128+
* @brief This function is used to De-initialize the FDCAN pins and instance.
129+
* @retval None.
130+
*/
131131
void OPENBL_FDCAN_DeInit(void)
132132
{
133133
/* Only de-initialize the FDCAN if it is not the current detected interface */
@@ -143,9 +143,9 @@ void OPENBL_FDCAN_DeInit(void)
143143
}
144144

145145
/**
146-
* @brief This function is used to detect if there is any activity on FDCAN protocol.
147-
* @retval Returns 1 if interface is detected else 0..
148-
*/
146+
* @brief This function is used to detect if there is any activity on FDCAN protocol.
147+
* @retval Returns 1 if interface is detected else 0..
148+
*/
149149
uint8_t OPENBL_FDCAN_ProtocolDetection(void)
150150
{
151151
/* check if FIFO 0 receive at least one message */
@@ -162,9 +162,9 @@ uint8_t OPENBL_FDCAN_ProtocolDetection(void)
162162
}
163163

164164
/**
165-
* @brief This function is used to get the command opcode from the host.
166-
* @retval Returns the command.
167-
*/
165+
* @brief This function is used to get the command opcode from the host.
166+
* @retval Returns the command.
167+
*/
168168
uint8_t OPENBL_FDCAN_GetCommandOpcode(void)
169169
{
170170
uint8_t command_opc = 0x0;
@@ -273,10 +273,10 @@ void OPENBL_FDCAN_SendBytes(uint8_t *Buffer, uint32_t BufferSize)
273273
}
274274

275275
/**
276-
* @brief This function is used to process and execute the special commands.
277-
* The user must define the special commands routine here.
278-
* @retval Returns NACK status in case of error else returns ACK status.
279-
*/
276+
* @brief This function is used to process and execute the special commands.
277+
* The user must define the special commands routine here.
278+
* @retval Returns NACK status in case of error else returns ACK status.
279+
*/
280280
void OPENBL_FDCAN_SpecialCommandProcess(OPENBL_SpecialCmdTypeDef *Frame)
281281
{
282282
switch (Frame->OpCode)

Interfaces/Patterns/FLASH/flash_interface.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,20 +409,20 @@ ErrorStatus OPENBL_FLASH_Erase(uint8_t *p_Data, uint32_t DataLength)
409409
}
410410

411411
/**
412-
* @brief This function is used to Set Flash busy state variable to activate busy state sending
413-
* during flash operations
414-
* @retval None.
415-
*/
412+
* @brief This function is used to Set Flash busy state variable to activate busy state sending
413+
* during flash operations
414+
* @retval None.
415+
*/
416416
void OPENBL_Enable_BusyState_Flag(void)
417417
{
418418
/* Enable Flash busy state sending */
419419
Flash_BusyState = FLASH_BUSY_STATE_ENABLED;
420420
}
421421

422422
/**
423-
* @brief This function is used to disable the send of busy state in I2C non stretch mode.
424-
* @retval None.
425-
*/
423+
* @brief This function is used to disable the send of busy state in I2C non stretch mode.
424+
* @retval None.
425+
*/
426426
void OPENBL_Disable_BusyState_Flag(void)
427427
{
428428
/* Disable Flash busy state sending */
@@ -723,7 +723,7 @@ __attribute__((section(".ramfunc"))) static HAL_StatusTypeDef OPENBL_FLASH_Exten
723723
__IO uint32_t *reg_cr;
724724
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
725725
uint32_t primask_bit;
726-
#endif
726+
#endif /* (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
727727

728728
/* Process Locked */
729729
__HAL_LOCK(&FlashProcess);

Interfaces/Patterns/I2C/i2c_interface.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ static void OPENBL_I2C_Init(void);
3838
/* Private functions ---------------------------------------------------------*/
3939

4040
/**
41-
* @brief This function is used to initialize the used I2C instance.
42-
* @retval None.
43-
*/
41+
* @brief This function is used to initialize the used I2C instance.
42+
* @retval None.
43+
*/
4444
static void OPENBL_I2C_Init(void)
4545
{
4646
LL_I2C_InitTypeDef I2C_InitStruct;
@@ -60,9 +60,9 @@ static void OPENBL_I2C_Init(void)
6060
/* Exported functions --------------------------------------------------------*/
6161

6262
/**
63-
* @brief This function is used to configure I2C pins and then initialize the used I2C instance.
64-
* @retval None.
65-
*/
63+
* @brief This function is used to configure I2C pins and then initialize the used I2C instance.
64+
* @retval None.
65+
*/
6666
void OPENBL_I2C_Configuration(void)
6767
{
6868
GPIO_InitTypeDef GPIO_InitStruct;
@@ -92,9 +92,9 @@ void OPENBL_I2C_Configuration(void)
9292
}
9393

9494
/**
95-
* @brief This function is used to De-initialize the I2C pins and instance.
96-
* @retval None.
97-
*/
95+
* @brief This function is used to De-initialize the I2C pins and instance.
96+
* @retval None.
97+
*/
9898
void OPENBL_I2C_DeInit(void)
9999
{
100100
/* Only de-initialize the I2C if it is not the current detected interface */
@@ -107,9 +107,9 @@ void OPENBL_I2C_DeInit(void)
107107
}
108108

109109
/**
110-
* @brief This function is used to detect if there is any activity on I2C protocol.
111-
* @retval None.
112-
*/
110+
* @brief This function is used to detect if there is any activity on I2C protocol.
111+
* @retval None.
112+
*/
113113
uint8_t OPENBL_I2C_ProtocolDetection(void)
114114
{
115115
/* Check if the I2Cx is addressed */
@@ -126,9 +126,9 @@ uint8_t OPENBL_I2C_ProtocolDetection(void)
126126
}
127127

128128
/**
129-
* @brief This function is used to get the command opcode from the host.
130-
* @retval Returns the command.
131-
*/
129+
* @brief This function is used to get the command opcode from the host.
130+
* @retval Returns the command.
131+
*/
132132
uint8_t OPENBL_I2C_GetCommandOpcode(void)
133133
{
134134
uint8_t command_opc = 0x0U;
@@ -353,11 +353,11 @@ __attribute__((section(".ramfunc"))) void OPENBL_I2C_SendBusyByte(void)
353353
}
354354

355355
/**
356-
* @brief This function is used to process and execute the special commands.
357-
* The user must define the special commands routine here.
358-
* @param SpecialCmd Pointer to the OPENBL_SpecialCmdTypeDef structure.
359-
* @retval Returns NACK status in case of error else returns ACK status.
360-
*/
356+
* @brief This function is used to process and execute the special commands.
357+
* The user must define the special commands routine here.
358+
* @param SpecialCmd Pointer to the OPENBL_SpecialCmdTypeDef structure.
359+
* @retval Returns NACK status in case of error else returns ACK status.
360+
*/
361361
void OPENBL_I2C_SpecialCommandProcess(OPENBL_SpecialCmdTypeDef *SpecialCmd)
362362
{
363363
switch (SpecialCmd->OpCode)
@@ -388,20 +388,20 @@ void OPENBL_I2C_SpecialCommandProcess(OPENBL_SpecialCmdTypeDef *SpecialCmd)
388388
}
389389

390390
/**
391-
* @brief This function is used to Set Flash busy state variable to activate busy state sending
392-
* during flash operations
393-
* @retval None.
394-
*/
391+
* @brief This function is used to Set Flash busy state variable to activate busy state sending
392+
* during flash operations
393+
* @retval None.
394+
*/
395395
void OPENBL_Enable_BusyState_Sending(void)
396396
{
397397
/* Enable Flash busy state sending */
398398
OPENBL_Enable_BusyState_Flag();
399399
}
400400

401401
/**
402-
* @brief This function is used to disable the send of busy state in I2C non stretch mode.
403-
* @retval None.
404-
*/
402+
* @brief This function is used to disable the send of busy state in I2C non stretch mode.
403+
* @retval None.
404+
*/
405405
void OPENBL_Disable_BusyState_Sending(void)
406406
{
407407
/* Disable Flash busy state sending */

0 commit comments

Comments
 (0)