Skip to content

Commit 971d5b4

Browse files
committed
Release version 2.4.0
1 parent 501388b commit 971d5b4

22 files changed

Lines changed: 79 additions & 4 deletions

File tree

hal/ambiq/mcu/apollo3/hal/am_hal_clkgen.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,34 @@ am_hal_clkgen_control(am_hal_clkgen_control_e eControl, void *pArgs)
9696
break;
9797

9898
case AM_HAL_CLKGEN_CONTROL_XTAL_START:
99+
if (CLKGEN->OCTRL_b.STOPXT == CLKGEN_OCTRL_STOPXT_EN)
100+
{
101+
break;
102+
}
103+
104+
if (APOLLO3_B0)
105+
{
106+
MCUCTRL->XTALCTRL_b.XTALICOMPTRIM = 1;
107+
}
99108
CLKGEN->OCTRL_b.STOPXT = CLKGEN_OCTRL_STOPXT_EN;
109+
if (APOLLO3_B0)
110+
{
111+
am_hal_flash_delay(FLASH_CYCLES_US(1000000));
112+
MCUCTRL->XTALCTRL_b.XTALICOMPTRIM = 3;
113+
am_hal_flash_delay(FLASH_CYCLES_US(1000));
114+
}
100115
break;
101116

102117
case AM_HAL_CLKGEN_CONTROL_LFRC_STOP:
103118
CLKGEN->OCTRL_b.STOPRC = CLKGEN_OCTRL_STOPRC_STOP;
104119
break;
105120

106121
case AM_HAL_CLKGEN_CONTROL_XTAL_STOP:
122+
if (CLKGEN->OCTRL_b.STOPXT == CLKGEN_OCTRL_STOPXT_STOP)
123+
{
124+
break;
125+
}
126+
107127
// Software Workaround to guarantee proper function of HFADJ.
108128
if (APOLLO3_B0)
109129
{

hal/ambiq/mcu/apollo3p/hal/am_hal_clkgen.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,22 @@ am_hal_clkgen_control(am_hal_clkgen_control_e eControl, void *pArgs)
9696
break;
9797

9898
case AM_HAL_CLKGEN_CONTROL_XTAL_START:
99+
if (CLKGEN->OCTRL_b.STOPXT == CLKGEN_OCTRL_STOPXT_EN)
100+
{
101+
break;
102+
}
103+
104+
if (APOLLO3_GE_B0)
105+
{
106+
MCUCTRL->XTALCTRL_b.XTALICOMPTRIM = 1;
107+
}
99108
CLKGEN->OCTRL_b.STOPXT = CLKGEN_OCTRL_STOPXT_EN;
109+
if (APOLLO3_GE_B0)
110+
{
111+
am_hal_flash_delay(FLASH_CYCLES_US(1000000));
112+
MCUCTRL->XTALCTRL_b.XTALICOMPTRIM = 3;
113+
am_hal_flash_delay(FLASH_CYCLES_US(1000));
114+
}
100115
break;
101116

102117
case AM_HAL_CLKGEN_CONTROL_LFRC_STOP:
0 Bytes
Binary file not shown.
3.71 KB
Binary file not shown.
0 Bytes
Binary file not shown.

targets/nm1801xx/common/comms/lora_mesh/include/lrm_api.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ typedef enum
8080
*/
8181
LRM_ERROR_NO_BUFS = 3,
8282

83+
/**
84+
* Device or service busy.
85+
*/
86+
LRM_ERROR_BUSY = 5,
87+
8388
/**
8489
* Failed to parse message.
8590
*/
@@ -95,6 +100,10 @@ typedef enum
95100
*/
96101
LRM_ERROR_INVALID_STATE = 13,
97102

103+
/**
104+
* Operation is already in progress.
105+
*/
106+
LRM_ERROR_ALREADY = 24,
98107
} lrm_error_e;
99108

100109
typedef struct
@@ -118,6 +127,7 @@ typedef enum
118127
LRM_DEVICE_ROLE_CHILD = 2, // The Child role.
119128
LRM_DEVICE_ROLE_ROUTER = 3, // The Router role.
120129
LRM_DEVICE_ROLE_LEADER = 4, // The Leader role.
130+
LRM_DEVICE_ROLE_PAUSED = 5,
121131
} lrm_device_role_e;
122132

123133
/**
@@ -283,6 +293,36 @@ lrm_error_e lrm_network_stop(lrm_context_t *context);
283293
*/
284294
bool lrm_is_network_started(lrm_context_t *context);
285295

296+
/**
297+
* Pause the LoRa mesh network.
298+
*
299+
* @param[in] context A pointer to a LoRa mesh context.
300+
*
301+
* @retval LRM_ERROR_NONE Successfully paused the network.
302+
* @retval LRM_ERROR_INVALID_STATE The network interface was not not up.
303+
*/
304+
lrm_error_e lrm_network_pause(lrm_context_t *context);
305+
306+
/**
307+
* Resume the LoRa mesh network.
308+
*
309+
* @param[in] context A pointer to a LoRa mesh context.
310+
*
311+
* @retval LRM_ERROR_NONE Successfully resumed the network.
312+
* @retval LRM_ERROR_INVALID_STATE The network interface was not not up.
313+
*/
314+
lrm_error_e lrm_network_resume(lrm_context_t *context);
315+
316+
/**
317+
* Indicates whether a LoRa mesh network is paused or not.
318+
*
319+
* @param[in] context A pointer to a LoRa mesh context.
320+
*
321+
* @returns TRUE if a LoRa mesh network is paused, FALSE otherwise.
322+
*
323+
*/
324+
bool lrm_is_network_paused(lrm_context_t *context);
325+
286326
/**
287327
* Get the device role.
288328
*
8 Bytes
Binary file not shown.
141 KB
Binary file not shown.
0 Bytes
Binary file not shown.
104 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)