File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ uint32_t am_apollo3_bt_controller_init(void)
76
76
}
77
77
else
78
78
{
79
- return AM_HAL_STATUS_FAIL ;
79
+ am_hal_ble_initialize (0 , & BLE );
80
+ am_hal_ble_power_control (BLE , AM_HAL_BLE_POWER_ACTIVE );
80
81
}
81
82
82
83
//
@@ -159,6 +160,31 @@ uint32_t am_apollo3_bt_controller_init(void)
159
160
return AM_HAL_STATUS_SUCCESS ;
160
161
}
161
162
163
+ //*****************************************************************************
164
+ //
165
+ // Deinitialize the Apollo3x BLE controller driver.
166
+ //
167
+ //*****************************************************************************
168
+ uint32_t am_apollo3_bt_controller_deinit (void )
169
+ {
170
+ uint32_t ui32Status ;
171
+
172
+ ui32Status = am_hal_ble_power_control (BLE , AM_HAL_BLE_POWER_OFF );
173
+ if (ui32Status != AM_HAL_STATUS_SUCCESS )
174
+ {
175
+ return ui32Status ;
176
+ }
177
+
178
+ //
179
+ // Give some time to power off the BLE controller
180
+ //
181
+ k_sleep (K_SECONDS (1 ));
182
+
183
+ ui32Status = am_hal_ble_deinitialize (BLE );
184
+
185
+ return ui32Status ;
186
+ }
187
+
162
188
//*****************************************************************************
163
189
//
164
190
// BLE ISR preprocessing.
Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ typedef enum
66
66
//*****************************************************************************
67
67
uint32_t am_apollo3_bt_controller_init (void );
68
68
69
+ //*****************************************************************************
70
+ //
71
+ //! @brief Deinitialize the Apollo3x BLE controller driver.
72
+ //!
73
+ //! @return status of BLE controller deinitialization.
74
+ //
75
+ //*****************************************************************************
76
+ uint32_t am_apollo3_bt_controller_deinit (void );
77
+
69
78
//*****************************************************************************
70
79
//
71
80
//! @brief BLE ISR preprocessing.
You can’t perform that action at this time.
0 commit comments