nRF51 SDK - S110 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
HCI Serialization PHY

HCI PHY layer for serialization. More...

Data Structures

struct  ser_phy_hci_pkt_params_t
 A struct representing a PHY HCI packet. More...
 
struct  ser_phy_hci_evt_hw_error_params_t
 A struct containing parameters of the event of type SER_PHY_HCI_SLIP_EVT_HW_ERROR. More...
 
struct  ser_phy_hci_slip_evt_t
 A struct containing events from a Serialization PHY module. More...
 

Typedefs

typedef void(* ser_phy_hci_slip_event_handler_t )(ser_phy_hci_slip_evt_t *p_event)
 A type of generic callback function handler to be used by all PHY HCI events. More...
 

Enumerations

enum  ser_phy_hci_slip_evt_type_t {
  SER_PHY_HCI_SLIP_EVT_PKT_SENT = 0,
  SER_PHY_HCI_SLIP_EVT_ACK_SENT,
  SER_PHY_HCI_SLIP_EVT_PKT_RECEIVED,
  SER_PHY_HCI_SLIP_EVT_HW_ERROR,
  SER_PHY_HCI_SLIP_EVT_TYPE_MAX
}
 Serialization PHY HCI module events types. More...
 

Functions

uint32_t ser_phy_hci_slip_open (ser_phy_hci_slip_event_handler_t events_handler)
 A function for opening and initializing a HCI SLIP PHY module. More...
 
uint32_t ser_phy_hci_slip_tx_pkt_send (const ser_phy_hci_pkt_params_t *p_header, const ser_phy_hci_pkt_params_t *p_payload, const ser_phy_hci_pkt_params_t *p_crc)
 A function for transmitting a HCI SLIP packet. More...
 
uint32_t ser_phy_hci_slip_rx_buf_free (uint8_t *p_buffer)
 A function for freeing an RX buffer. More...
 
void ser_phy_hci_slip_close (void)
 A function for closing a PHY HCI module. More...
 
void ser_phy_hci_slip_interrupts_enable (void)
 A function for enabling a PHY HCI module interrupts. More...
 
void ser_phy_hci_slip_interrupts_disable (void)
 A function for disabling a PHY HCI module interrupts. More...
 

Detailed Description

HCI PHY layer for serialization.

This file contains declarations of functions and definitions of data structures and identifiers (typedef enum) used as API of the serialization HCI PHY layer.

Typedef Documentation

typedef void(* ser_phy_hci_slip_event_handler_t)(ser_phy_hci_slip_evt_t *p_event)

A type of generic callback function handler to be used by all PHY HCI events.

Parameters
[in]eventSerialization PHY HCI module event.

Enumeration Type Documentation

Serialization PHY HCI module events types.

Enumerator
SER_PHY_HCI_SLIP_EVT_PKT_SENT 

An event indicating that packet has been transmitted.

SER_PHY_HCI_SLIP_EVT_ACK_SENT 

An event indicating that ack packet has been transmitted.

SER_PHY_HCI_SLIP_EVT_PKT_RECEIVED 

An event indicating that packet has been received.

SER_PHY_HCI_SLIP_EVT_HW_ERROR 

An event indicating a hardware error in PHY HCI module.

SER_PHY_HCI_SLIP_EVT_TYPE_MAX 

Enumeration upper bound.

Function Documentation

void ser_phy_hci_slip_close ( void  )

A function for closing a PHY HCI module.

Note
The function disables hardware, resets internal module states and unregisters events callback function.
void ser_phy_hci_slip_interrupts_disable ( void  )

A function for disabling a PHY HCI module interrupts.

Note
The function disables all interrupts that are used by a PHY HCI module (and only those).
void ser_phy_hci_slip_interrupts_enable ( void  )

A function for enabling a PHY HCI module interrupts.

Note
The function enables all interrupts that are used by a PHY HCI module (and only those).
uint32_t ser_phy_hci_slip_open ( ser_phy_hci_slip_event_handler_t  events_handler)

A function for opening and initializing a HCI SLIP PHY module.

Note
The function initializes hardware and internal module states, and registers callback function to be used by all PHY HCI module events.
Warning
If the function has been already called, the function ser_phy_hci_slip_close has to be called before ser_phy_hci_slip_open can be called again.
Parameters
[in]events_handlerGeneric callback function handler to be used by all PHY HCI module events.
Return values
NRF_SUCCESSOperation success.
NRF_ERROR_INVALID_STATEOperation failure. The function has been already called. To call it again the function ser_phy_hci_slip_close has to be called previously.
NRF_ERROR_NULLOperation failure. NULL pointer supplied.
NRF_ERROR_INVALID_PARAMOperation failure. Hardware initialization parameters are not supported.
uint32_t ser_phy_hci_slip_rx_buf_free ( uint8_t *  p_buffer)

A function for freeing an RX buffer.

Note
The function has to be called as a response for event SER_PHY_HCI_SLIP_EVT_PKT_RECEIVED when RX packet has been processed. The function frees the RX buffer and therefore enables reception of next incoming data.
Parameters
[in]p_bufferPointer to an RX buffer which must be freed.
Return values
NRF_SUCCESSOperation success.
NRF_ERROR_NULLOperation failure. NULL pointer supplied.
NRF_ERROR_INVALID_STATEOperation failure. A buffer was already free.
uint32_t ser_phy_hci_slip_tx_pkt_send ( const ser_phy_hci_pkt_params_t p_header,
const ser_phy_hci_pkt_params_t p_payload,
const ser_phy_hci_pkt_params_t p_crc 
)

A function for transmitting a HCI SLIP packet.

Note
The function adds a packet pointed by p_buffer parameter to a transmission queue and schedules generating an event of type SER_PHY_HCI_SLIP_EVT_PKT_SENT upon transmission completion.
Parameters
[in]p_headerPointer to ser_phy_hci_pkt_params_t structure representing packet header.
[in]p_payloadPointer to ser_phy_hci_pkt_params_t structure representing packet payload.
[in]p_crcPointer to ser_phy_hci_pkt_params_t structure representing packet crc.
Return values
NRF_SUCCESSOperation success. Packet was added to the transmission queue and event will be send upon transmission completion.
NRF_ERROR_NULLOperation failure. NULL pointer supplied in p_header parameter. NULL pointer is allowed for p_payload and p_crc parameters.
NRF_ERROR_INVALID_PARAMOperation failure. Number of bytes to be send equal to 0.
NRF_ERROR_BUSYOperation failure. Transmitting of a packet in progress.