SmartSnippets DA1459x SDK
Files | Typedefs | Enumerations | Functions

DGTL Declarations. More...

Files

file  dgtl.h
 Declarations for DGTL.
 

Typedefs

typedef void(* dgtl_sent_cb_t) (void *user_data)
 Callback called once tx is completed. More...
 

Enumerations

enum  dgtl_queue_t
 DGTL queue type.
 

Functions

void dgtl_app_specific_hci_cb (const dgtl_msg_t *msg)
 
void dgtl_init (void)
 
void dgtl_register (dgtl_queue_t queue, uint32_t notif)
 Register current task for given queue. More...
 
bool dgtl_send_ex (dgtl_msg_t *msg, dgtl_sent_cb_t cb, void *user_data)
 Send message to the DGTL interface. More...
 
void dgtl_send (dgtl_msg_t *msg)
 Send message to the DGTL interface. More...
 
dgtl_msg_t * dgtl_receive (dgtl_queue_t queue)
 Receive message from the DGTL interface. More...
 
void dgtl_wkup_handler (void)
 Wake up handler for dgtl task. More...
 
void dgtl_close (void)
 Send signal to the DGTL task for closing transport. More...
 

Detailed Description

DGTL Declarations.

Typedef Documentation

◆ dgtl_sent_cb_t

typedef void(* dgtl_sent_cb_t) (void *user_data)

Callback called once tx is completed.

This callback is called when DGTL message was sent using dgtl_send_ex() function.

Parameters
[in]user_datadata passed by the user

Function Documentation

◆ dgtl_app_specific_hci_cb()

void dgtl_app_specific_hci_cb ( const dgtl_msg_t *  msg)

Callback for application specific HCI commands

This function is called by DGTL when HCI command from application specific opcode range is received. It is called when DGTL_APP_SPECIFIC_HCI_ENABLE option is non-zero. Application shall define this function in order to override weak reference defined by DGTL code internally.

Warning
Application is responsible for freeing msg when no longer needed.
Parameters
[in]msgDGTL message

◆ dgtl_close()

void dgtl_close ( void  )

Send signal to the DGTL task for closing transport.

It will inform the DGTL task to stop exchanging data. In order to reopen transport, dgtl_wkup_handler() function should be called. This function is blocking and waits until transport has been closed.

◆ dgtl_init()

void dgtl_init ( void  )

Initialize DGTL

This function initializes internal DGTL structures and thus shall be called by the application before using any other DGTL API.

◆ dgtl_receive()

dgtl_msg_t* dgtl_receive ( dgtl_queue_t  queue)

Receive message from the DGTL interface.

This function receives a message from a specified queue from the DGTL interface. The application can only receive messages from the queue it previously registered to using dgtl_register().

The receiver becomes owner of the message and shall free it when it is no longer in use.

Parameters
[in]queuequeue to receive message from
Returns
received message or NULL if either no message is present in queue or the application is not allowed to receive message from queue

◆ dgtl_register()

void dgtl_register ( dgtl_queue_t  queue,
uint32_t  notif 
)

Register current task for given queue.

This function allows the calling task to register itself as a client to receive messages from a given queue. The DGTL interface will notify application task using notif bitmask whenever a new message is available in the queue, which can be received using dgtl_receive().

Note
Only one task can be registered to get notifications for a queue.
Parameters
[in]queuequeue type
[in]notifnotification bitmask to be used

◆ dgtl_send()

void dgtl_send ( dgtl_msg_t *  msg)

Send message to the DGTL interface.

This function sends a message to the DGTL interface. The target queue is automatically selected based on the packet type indicator present in the message.

After calling this function, the sender is no longer the owner of the message and should not use it anymore.

Parameters
[in]msgDGTL message

◆ dgtl_send_ex()

bool dgtl_send_ex ( dgtl_msg_t *  msg,
dgtl_sent_cb_t  cb,
void *  user_data 
)

Send message to the DGTL interface.

This function sends a message to the DGTL interface. The target queue is automatically selected based on the packet type indicator present in the message. If callback is set, it will be called when tx is completed.

Note
After calling this function, the sender is no longer the owner of the message and should not use it anymore.
Parameters
[in]msgDGTL message
[in]cbcallback called once tx is completed
[in]user_datauser data passed to callback
Returns
true if message has been put to TX queue, otherwise false.

◆ dgtl_wkup_handler()

void dgtl_wkup_handler ( void  )

Wake up handler for dgtl task.

Start data receiving in DGTL task. It should be called after closing the DGTL with dgtl_close().

Note
It may be called from both ISR or non ISR context