Synergy Software Package User's Manual
Common BSP Code

Code common to all BSPs. More...

Modules

 Common BSP LED Code and Types
 Common support for board LEDs.
 
 Compiler Support
 
 Software Delay
 Common function to implement a software delay.
 
 Error Checking
 
 Module specific feature overrides
 
 Grouped Interrupt Support
 
 Interrupt Initialization
 
 Atomic Locking
 
 Register Protection
 
 BSP_MCU_SBRK
 

Macros

#define BSP_IRQ_DISABLED   (0xFFU)
 
#define SSP_ASSERT_FAIL
 
#define SSP_ERROR_LOG(err, module, version)
 
#define SSP_ASSERT(a)
 
#define SSP_ERROR_RETURN(a, err, module, version)
 
#define SSP_CRITICAL_SECTION_DEFINE   uint32_t old_mask_level = 0U
 
#define SSP_CRITICAL_SECTION_ENTER
 
#define SSP_CRITICAL_SECTION_EXIT   __set_PRIMASK(old_mask_level)
 

Functions

ssp_err_t R_BSP_VersionGet (ssp_version_t *p_version)
 Set BSP version based on compile time macros. More...
 
ssp_err_t R_SSP_VersionGet (ssp_pack_version_t *const p_version)
 Set SSP version based on compile time macros. More...
 
void bsp_init_internal (void *p_args)
 Default initialization function, used only if bsp_init is not defined in the user application.
 

Detailed Description

Code common to all BSPs.

Implements functions that are common to all BSPs.

Macro Definition Documentation

◆ BSP_IRQ_DISABLED

#define BSP_IRQ_DISABLED   (0xFFU)

Used to signify that an ELC event is not able to be used as an interrupt.

◆ SSP_ASSERT

#define SSP_ASSERT (   a)
Value:
{ \
if ((a)) \
{ \
(void) 0;/* Do nothing */ \
} \
else \
{ \
SSP_ASSERT_FAIL; \
return SSP_ERR_ASSERTION; \
} \
}

Default assertion calls SSP_ASSERT_FAIL if condition "a" is false. Used to identify incorrect use of API's in SSP functions.

◆ SSP_ASSERT_FAIL

#define SSP_ASSERT_FAIL

Function call to insert before returning assertion error.

◆ SSP_CRITICAL_SECTION_DEFINE

#define SSP_CRITICAL_SECTION_DEFINE   uint32_t old_mask_level = 0U

This check is performed to select suitable ASM API with respect to core This macro defines a variable for saving previous mask value

◆ SSP_CRITICAL_SECTION_ENTER

#define SSP_CRITICAL_SECTION_ENTER
Value:
old_mask_level = __get_PRIMASK(); \
__set_PRIMASK(1U)

This macro defined to get the mask value

◆ SSP_CRITICAL_SECTION_EXIT

#define SSP_CRITICAL_SECTION_EXIT   __set_PRIMASK(old_mask_level)

This macro defined to restore the old mask value

◆ SSP_ERROR_LOG

#define SSP_ERROR_LOG (   err,
  module,
  version 
)

This function is called before returning an error code. To stop on a runtime error, define ssp_error_log in user code and do required debugging (breakpoints, stack dump, etc) in this function.

◆ SSP_ERROR_RETURN

#define SSP_ERROR_RETURN (   a,
  err,
  module,
  version 
)
Value:
{ \
if ((a)) \
{ \
(void) 0; /* Do nothing */ \
} \
else \
{ \
SSP_ERROR_LOG((err), (module), (version)); \
return (err); \
} \
}

All SSP error codes are returned using this macro. Calls SSP_ERROR_LOG function if condition "a" is false. Used to identify runtime errors in SSP functions.

Function Documentation

◆ R_BSP_VersionGet()

ssp_err_t R_BSP_VersionGet ( ssp_version_t p_version)

Set BSP version based on compile time macros.

Parameters
[out]p_versionMemory address to return version information to.
Return values
SSP_SUCCESSVersion information stored.
SSP_ERR_ASSERTIONThe parameter p_version is NULL.

◆ R_SSP_VersionGet()

ssp_err_t R_SSP_VersionGet ( ssp_pack_version_t *const  p_version)

Set SSP version based on compile time macros.

Parameters
[out]p_versionMemory address to return version information to.
Return values
SSP_SUCCESSVersion information stored.
SSP_ERR_ASSERTIONThe parameter p_version is NULL.