Skip to content

Commit ea1f164

Browse files
committed
Update board startup code to allow for not initializing the HAL
1 parent 0b21a69 commit ea1f164

File tree

18 files changed

+167
-57
lines changed

18 files changed

+167
-57
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062S2_43012/cybsp.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
*******************************************************************************/
2525

2626
#include <stdlib.h>
27+
#include "cy_syspm.h"
28+
#include "cy_sysclk.h"
2729
#include "cybsp.h"
28-
#include "cyhal_utils.h"
29-
#include "cycfg.h"
30+
#if defined(CY_USING_HAL)
31+
#include "cyhal_hwmgr.h"
32+
#endif
3033

3134
#if defined(__cplusplus)
3235
extern "C" {
@@ -41,7 +44,7 @@ extern "C" {
4144
#define CYBSP_SYSCLK_PM_CALLBACK_ORDER (255u)
4245
#endif
4346

44-
#if defined(CYBSP_WIFI_CAPABLE)
47+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
4548
static cyhal_sdio_t sdio_obj;
4649

4750
cyhal_sdio_t* cybsp_get_wifi_sdio_obj(void)
@@ -76,15 +79,22 @@ static cy_rslt_t cybsp_register_sysclk_pm_callback(void)
7679
cy_rslt_t cybsp_init(void)
7780
{
7881
/* Setup hardware manager to track resource usage then initialize all system (clock/power) board configuration */
82+
#if defined(CY_USING_HAL)
7983
cy_rslt_t result = cyhal_hwmgr_init();
80-
init_cycfg_system();
84+
#else
85+
cy_rslt_t result = CY_RSLT_SUCCESS;
86+
#endif
87+
88+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
89+
init_cycfg_all();
90+
#endif
8191

8292
if (CY_RSLT_SUCCESS == result)
8393
{
8494
result = cybsp_register_sysclk_pm_callback();
8595
}
8696

87-
#if defined(CYBSP_WIFI_CAPABLE)
97+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
8898
/* Initialize SDIO interface. This must be done before other HAL API calls as some SDIO implementations require
8999
* specific peripheral instances.
90100
* NOTE: The full WiFi interface still needs to be initialized via cybsp_wifi_init_primary(). This is typically

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062S2_43012/cybsp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626

2727
#include "cy_result.h"
2828
#include "cybsp_types.h"
29-
#if defined(CYBSP_WIFI_CAPABLE)
29+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
30+
#include "cycfg.h"
31+
#endif
32+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
3033
#include "cyhal_sdio.h"
3134
#endif
3235

@@ -57,7 +60,7 @@ extern "C" {
5760
*/
5861
cy_rslt_t cybsp_init(void);
5962

60-
#if defined(CYBSP_WIFI_CAPABLE)
63+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
6164
/**
6265
* \brief Get the initialized sdio object used for communicating with the WiFi Chip.
6366
* \note This function should only be called after cybsp_init();

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/cybsp.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
*******************************************************************************/
2525

2626
#include <stdlib.h>
27+
#include "cy_syspm.h"
28+
#include "cy_sysclk.h"
2729
#include "cybsp.h"
28-
#include "cyhal_utils.h"
29-
#include "cycfg.h"
30+
#if defined(CY_USING_HAL)
31+
#include "cyhal_hwmgr.h"
32+
#endif
3033

3134
#if defined(__cplusplus)
3235
extern "C" {
@@ -41,7 +44,7 @@ extern "C" {
4144
#define CYBSP_SYSCLK_PM_CALLBACK_ORDER (255u)
4245
#endif
4346

44-
#if defined(CYBSP_WIFI_CAPABLE)
47+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
4548
static cyhal_sdio_t sdio_obj;
4649

4750
cyhal_sdio_t* cybsp_get_wifi_sdio_obj(void)
@@ -76,15 +79,22 @@ static cy_rslt_t cybsp_register_sysclk_pm_callback(void)
7679
cy_rslt_t cybsp_init(void)
7780
{
7881
/* Setup hardware manager to track resource usage then initialize all system (clock/power) board configuration */
82+
#if defined(CY_USING_HAL)
7983
cy_rslt_t result = cyhal_hwmgr_init();
80-
init_cycfg_system();
84+
#else
85+
cy_rslt_t result = CY_RSLT_SUCCESS;
86+
#endif
87+
88+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
89+
init_cycfg_all();
90+
#endif
8191

8292
if (CY_RSLT_SUCCESS == result)
8393
{
8494
result = cybsp_register_sysclk_pm_callback();
8595
}
8696

87-
#if defined(CYBSP_WIFI_CAPABLE)
97+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
8898
/* Initialize SDIO interface. This must be done before other HAL API calls as some SDIO implementations require
8999
* specific peripheral instances.
90100
* NOTE: The full WiFi interface still needs to be initialized via cybsp_wifi_init_primary(). This is typically

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/cybsp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626

2727
#include "cy_result.h"
2828
#include "cybsp_types.h"
29-
#if defined(CYBSP_WIFI_CAPABLE)
29+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
30+
#include "cycfg.h"
31+
#endif
32+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
3033
#include "cyhal_sdio.h"
3134
#endif
3235

@@ -57,7 +60,7 @@ extern "C" {
5760
*/
5861
cy_rslt_t cybsp_init(void);
5962

60-
#if defined(CYBSP_WIFI_CAPABLE)
63+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
6164
/**
6265
* \brief Get the initialized sdio object used for communicating with the WiFi Chip.
6366
* \note This function should only be called after cybsp_init();

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_WIFI_BT/cybsp.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
*******************************************************************************/
2525

2626
#include <stdlib.h>
27+
#include "cy_syspm.h"
28+
#include "cy_sysclk.h"
2729
#include "cybsp.h"
28-
#include "cyhal_utils.h"
29-
#include "cycfg.h"
30+
#if defined(CY_USING_HAL)
31+
#include "cyhal_hwmgr.h"
32+
#endif
3033

3134
#if defined(__cplusplus)
3235
extern "C" {
@@ -41,7 +44,7 @@ extern "C" {
4144
#define CYBSP_SYSCLK_PM_CALLBACK_ORDER (255u)
4245
#endif
4346

44-
#if defined(CYBSP_WIFI_CAPABLE)
47+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
4548
static cyhal_sdio_t sdio_obj;
4649

4750
cyhal_sdio_t* cybsp_get_wifi_sdio_obj(void)
@@ -76,15 +79,22 @@ static cy_rslt_t cybsp_register_sysclk_pm_callback(void)
7679
cy_rslt_t cybsp_init(void)
7780
{
7881
/* Setup hardware manager to track resource usage then initialize all system (clock/power) board configuration */
82+
#if defined(CY_USING_HAL)
7983
cy_rslt_t result = cyhal_hwmgr_init();
80-
init_cycfg_system();
84+
#else
85+
cy_rslt_t result = CY_RSLT_SUCCESS;
86+
#endif
87+
88+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
89+
init_cycfg_all();
90+
#endif
8191

8292
if (CY_RSLT_SUCCESS == result)
8393
{
8494
result = cybsp_register_sysclk_pm_callback();
8595
}
8696

87-
#if defined(CYBSP_WIFI_CAPABLE)
97+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
8898
/* Initialize SDIO interface. This must be done before other HAL API calls as some SDIO implementations require
8999
* specific peripheral instances.
90100
* NOTE: The full WiFi interface still needs to be initialized via cybsp_wifi_init_primary(). This is typically

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_WIFI_BT/cybsp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626

2727
#include "cy_result.h"
2828
#include "cybsp_types.h"
29-
#if defined(CYBSP_WIFI_CAPABLE)
29+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
30+
#include "cycfg.h"
31+
#endif
32+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
3033
#include "cyhal_sdio.h"
3134
#endif
3235

@@ -57,7 +60,7 @@ extern "C" {
5760
*/
5861
cy_rslt_t cybsp_init(void);
5962

60-
#if defined(CYBSP_WIFI_CAPABLE)
63+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
6164
/**
6265
* \brief Get the initialized sdio object used for communicating with the WiFi Chip.
6366
* \note This function should only be called after cybsp_init();

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_064S2_4343W/cybsp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
*******************************************************************************/
2525

2626
#include <stdlib.h>
27+
#include "cy_syspm.h"
28+
#include "cy_sysclk.h"
2729
#include "cybsp.h"
2830
#if defined(CY_USING_HAL)
29-
#include "cyhal_utils.h"
31+
#include "cyhal_hwmgr.h"
3032
#endif
3133

3234
#if defined(__cplusplus)
@@ -83,7 +85,9 @@ cy_rslt_t cybsp_init(void)
8385
cy_rslt_t result = CY_RSLT_SUCCESS;
8486
#endif
8587

86-
init_cycfg_system();
88+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
89+
init_cycfg_all();
90+
#endif
8791

8892
if (CY_RSLT_SUCCESS == result)
8993
{

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_064S2_4343W/cybsp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
#include "cy_result.h"
2828
#include "cybsp_types.h"
29+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
2930
#include "cycfg.h"
31+
#endif
3032
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
3133
#include "cyhal_sdio.h"
3234
#endif

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062_4343W/cybsp.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
*******************************************************************************/
2525

2626
#include <stdlib.h>
27+
#include "cy_syspm.h"
28+
#include "cy_sysclk.h"
2729
#include "cybsp.h"
28-
#include "cyhal_utils.h"
29-
#include "cycfg.h"
30+
#if defined(CY_USING_HAL)
31+
#include "cyhal_hwmgr.h"
32+
#endif
3033

3134
#if defined(__cplusplus)
3235
extern "C" {
@@ -41,7 +44,7 @@ extern "C" {
4144
#define CYBSP_SYSCLK_PM_CALLBACK_ORDER (255u)
4245
#endif
4346

44-
#if defined(CYBSP_WIFI_CAPABLE)
47+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
4548
static cyhal_sdio_t sdio_obj;
4649

4750
cyhal_sdio_t* cybsp_get_wifi_sdio_obj(void)
@@ -76,15 +79,22 @@ static cy_rslt_t cybsp_register_sysclk_pm_callback(void)
7679
cy_rslt_t cybsp_init(void)
7780
{
7881
/* Setup hardware manager to track resource usage then initialize all system (clock/power) board configuration */
82+
#if defined(CY_USING_HAL)
7983
cy_rslt_t result = cyhal_hwmgr_init();
80-
init_cycfg_system();
84+
#else
85+
cy_rslt_t result = CY_RSLT_SUCCESS;
86+
#endif
87+
88+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
89+
init_cycfg_all();
90+
#endif
8191

8292
if (CY_RSLT_SUCCESS == result)
8393
{
8494
result = cybsp_register_sysclk_pm_callback();
8595
}
8696

87-
#if defined(CYBSP_WIFI_CAPABLE)
97+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
8898
/* Initialize SDIO interface. This must be done before other HAL API calls as some SDIO implementations require
8999
* specific peripheral instances.
90100
* NOTE: The full WiFi interface still needs to be initialized via cybsp_wifi_init_primary(). This is typically

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062_4343W/cybsp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626

2727
#include "cy_result.h"
2828
#include "cybsp_types.h"
29-
#if defined(CYBSP_WIFI_CAPABLE)
29+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
30+
#include "cycfg.h"
31+
#endif
32+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
3033
#include "cyhal_sdio.h"
3134
#endif
3235

@@ -57,7 +60,7 @@ extern "C" {
5760
*/
5861
cy_rslt_t cybsp_init(void);
5962

60-
#if defined(CYBSP_WIFI_CAPABLE)
63+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
6164
/**
6265
* \brief Get the initialized sdio object used for communicating with the WiFi Chip.
6366
* \note This function should only be called after cybsp_init();

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_063_BLE/cybsp.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
*******************************************************************************/
2525

2626
#include <stdlib.h>
27+
#include "cy_syspm.h"
28+
#include "cy_sysclk.h"
2729
#include "cybsp.h"
28-
#include "cyhal_utils.h"
29-
#include "cycfg.h"
30+
#if defined(CY_USING_HAL)
31+
#include "cyhal_hwmgr.h"
32+
#endif
3033

3134
#if defined(__cplusplus)
3235
extern "C" {
@@ -41,7 +44,7 @@ extern "C" {
4144
#define CYBSP_SYSCLK_PM_CALLBACK_ORDER (255u)
4245
#endif
4346

44-
#if defined(CYBSP_WIFI_CAPABLE)
47+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
4548
static cyhal_sdio_t sdio_obj;
4649

4750
cyhal_sdio_t* cybsp_get_wifi_sdio_obj(void)
@@ -76,15 +79,22 @@ static cy_rslt_t cybsp_register_sysclk_pm_callback(void)
7679
cy_rslt_t cybsp_init(void)
7780
{
7881
/* Setup hardware manager to track resource usage then initialize all system (clock/power) board configuration */
82+
#if defined(CY_USING_HAL)
7983
cy_rslt_t result = cyhal_hwmgr_init();
80-
init_cycfg_system();
84+
#else
85+
cy_rslt_t result = CY_RSLT_SUCCESS;
86+
#endif
87+
88+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
89+
init_cycfg_all();
90+
#endif
8191

8292
if (CY_RSLT_SUCCESS == result)
8393
{
8494
result = cybsp_register_sysclk_pm_callback();
8595
}
8696

87-
#if defined(CYBSP_WIFI_CAPABLE)
97+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
8898
/* Initialize SDIO interface. This must be done before other HAL API calls as some SDIO implementations require
8999
* specific peripheral instances.
90100
* NOTE: The full WiFi interface still needs to be initialized via cybsp_wifi_init_primary(). This is typically

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_063_BLE/cybsp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626

2727
#include "cy_result.h"
2828
#include "cybsp_types.h"
29-
#if defined(CYBSP_WIFI_CAPABLE)
29+
#if defined(COMPONENT_BSP_DESIGN_MODUS)
30+
#include "cycfg.h"
31+
#endif
32+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
3033
#include "cyhal_sdio.h"
3134
#endif
3235

@@ -57,7 +60,7 @@ extern "C" {
5760
*/
5861
cy_rslt_t cybsp_init(void);
5962

60-
#if defined(CYBSP_WIFI_CAPABLE)
63+
#if defined(CYBSP_WIFI_CAPABLE) && defined(CY_USING_HAL)
6164
/**
6265
* \brief Get the initialized sdio object used for communicating with the WiFi Chip.
6366
* \note This function should only be called after cybsp_init();

0 commit comments

Comments
 (0)