Bluetooth: controller: support for code exe. in co-operation with radio
Extend radio ticker nodes for support in-timeslice execution Added interface for abort the radio Added interface for check whether the radio is idle Added interface for get ticker IDs for timeslice ticker node Added interface for check whether radio ticker is running Added interface for check whether radio ticker is initialized Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no> Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
parent
abcb8d446e
commit
7e6b9fa841
5 changed files with 44 additions and 4 deletions
|
@ -10,6 +10,8 @@
|
|||
|
||||
int ll_init(struct k_sem *sem_rx);
|
||||
void ll_reset(void);
|
||||
void ll_radio_state_abort(void);
|
||||
u32_t ll_radio_state_is_idle(void);
|
||||
u8_t *ll_addr_get(u8_t addr_type, u8_t *p_bdaddr);
|
||||
void ll_addr_set(u8_t addr_type, u8_t const *const p_bdaddr);
|
||||
|
||||
|
@ -69,6 +71,7 @@ u32_t ll_start_enc_req_send(u16_t handle, u8_t err_code,
|
|||
u32_t ll_feature_req_send(u16_t handle);
|
||||
u32_t ll_version_ind_send(u16_t handle);
|
||||
u32_t ll_terminate_ind_send(u16_t handle, u8_t reason);
|
||||
void ll_timeslice_ticker_id_get(u8_t * const instance_index, u8_t * const user_id);
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_CONTROLLER_DATA_LENGTH)
|
||||
u32_t ll_length_req_send(u16_t handle, u16_t tx_octets);
|
||||
|
|
|
@ -7860,6 +7860,16 @@ static void phy_rsp_send(struct connection *conn)
|
|||
}
|
||||
#endif /* CONFIG_BLUETOOTH_CONTROLLER_PHY */
|
||||
|
||||
void ll_radio_state_abort(void)
|
||||
{
|
||||
event_stop(0, 0, 0, (void *)STATE_ABORT);
|
||||
}
|
||||
|
||||
u32_t ll_radio_state_is_idle(void)
|
||||
{
|
||||
return radio_is_idle();
|
||||
}
|
||||
|
||||
void radio_ticks_active_to_start_set(u32_t ticks_active_to_start)
|
||||
{
|
||||
_radio.ticks_active_to_start = ticks_active_to_start;
|
||||
|
|
|
@ -39,12 +39,27 @@
|
|||
#include "ll_filter.h"
|
||||
|
||||
/* Global singletons */
|
||||
|
||||
/* memory for storing Random number */
|
||||
static u8_t MALIGN(4) _rand_context[3 + 4 + 1];
|
||||
static u8_t MALIGN(4) _ticker_nodes[RADIO_TICKER_NODES][TICKER_NODE_T_SIZE];
|
||||
static u8_t MALIGN(4) _ticker_users[MAYFLY_CALLER_COUNT]
|
||||
[TICKER_USER_T_SIZE];
|
||||
|
||||
/* memory for ticker nodes/instances */
|
||||
#if defined(CONFIG_SOC_FLASH_NRF5_RADIO_SYNC)
|
||||
#define FLASH_TICKER_NODES 1 /* No. of tickers reserved for flashing */
|
||||
#else
|
||||
#define FLASH_TICKER_NODES 0
|
||||
#endif
|
||||
#define TICKER_NODES (RADIO_TICKER_NODES + FLASH_TICKER_NODES)
|
||||
static u8_t MALIGN(4) _ticker_nodes[TICKER_NODES][TICKER_NODE_T_SIZE];
|
||||
|
||||
/* memory for users/contexts operating on ticker module */
|
||||
static u8_t MALIGN(4) _ticker_users[MAYFLY_CALLER_COUNT][TICKER_USER_T_SIZE];
|
||||
|
||||
/* memory for user/context simultaneous API operations */
|
||||
static u8_t MALIGN(4) _ticker_user_ops[RADIO_TICKER_USER_OPS]
|
||||
[TICKER_USER_OP_T_SIZE];
|
||||
|
||||
/* memory for Bluetooth Controller (buffers, queues etc.) */
|
||||
static u8_t MALIGN(4) _radio[LL_MEM_TOTAL];
|
||||
|
||||
static struct k_sem *sem_recv;
|
||||
|
@ -191,7 +206,7 @@ int ll_init(struct k_sem *sem_rx)
|
|||
_ticker_users[MAYFLY_CALL_ID_2][0] = 0;
|
||||
_ticker_users[MAYFLY_CALL_ID_PROGRAM][0] = RADIO_TICKER_USER_APP_OPS;
|
||||
|
||||
ticker_init(RADIO_TICKER_INSTANCE_ID_RADIO, RADIO_TICKER_NODES,
|
||||
ticker_init(RADIO_TICKER_INSTANCE_ID_RADIO, TICKER_NODES,
|
||||
&_ticker_nodes[0], MAYFLY_CALLER_COUNT, &_ticker_users[0],
|
||||
RADIO_TICKER_USER_OPS, &_ticker_user_ops[0]);
|
||||
|
||||
|
@ -231,6 +246,12 @@ int ll_init(struct k_sem *sem_rx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void ll_timeslice_ticker_id_get(u8_t * const instance_index, u8_t * const user_id)
|
||||
{
|
||||
*user_id = (TICKER_NODES - FLASH_TICKER_NODES); /* The last index in the total tickers */
|
||||
*instance_index = RADIO_TICKER_INSTANCE_ID_RADIO;
|
||||
}
|
||||
|
||||
u8_t *ll_addr_get(u8_t addr_type, u8_t *bdaddr)
|
||||
{
|
||||
if (addr_type) {
|
||||
|
|
|
@ -1504,6 +1504,11 @@ u32_t ticker_init(u8_t instance_index, u8_t count_node, void *node,
|
|||
return TICKER_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool ticker_is_initialized(u8_t instance_index)
|
||||
{
|
||||
return !!(_instance[instance_index].count_node);
|
||||
}
|
||||
|
||||
void ticker_trigger(u8_t instance_index)
|
||||
{
|
||||
DEBUG_TICKER_ISR(1);
|
||||
|
|
|
@ -96,6 +96,7 @@ typedef void (*ticker_op_func) (u32_t status, void *op_context);
|
|||
*/
|
||||
u32_t ticker_init(u8_t instance_index, u8_t count_node, void *node,
|
||||
u8_t count_user, void *user, u8_t count_op, void *user_op);
|
||||
bool ticker_is_initialized(u8_t instance_index);
|
||||
void ticker_trigger(u8_t instance_index);
|
||||
u32_t ticker_start(u8_t instance_index, u8_t user_id, u8_t ticker_id,
|
||||
u32_t ticks_anchor, u32_t ticks_first, u32_t ticks_periodic,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue