HCI PHY layer for serialization.
More...
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.
A type of generic callback function handler to be used by all PHY HCI events.
- Parameters
-
[in] | event | Serialization PHY HCI module event. |
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.
|
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).
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_close has to be called before ser_phy_hci_open can be called again.
- Parameters
-
[in] | events_handler | Generic callback function handler to be used by all PHY HCI module events. |
- Return values
-
NRF_SUCCESS | Operation success. |
NRF_ERROR_INVALID_STATE | Operation failure. The function has been already called. To call it again the function ser_phy_hci_close has to be called previously. |
NRF_ERROR_NULL | Operation failure. NULL pointer supplied. |
NRF_ERROR_INVALID_PARAM | Operation 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_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_buffer | Pointer to an RX buffer which must be freed. |
- Return values
-
NRF_SUCCESS | Operation success. |
NRF_ERROR_NULL | Operation failure. NULL pointer supplied. |
NRF_ERROR_INVALID_STATE | Operation failure. A buffer was already free. |
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_TX_PKT_SENT upon transmission completion.
- Parameters
-
- Return values
-
NRF_SUCCESS | Operation success. Packet was added to the transmission queue and event will be send upon transmission completion. |
NRF_ERROR_NULL | Operation failure. NULL pointer supplied in p_header parameter. NULL pointer is allowed for p_payload and p_crc parameters. |
NRF_ERROR_INVALID_PARAM | Operation failure. Number of bytes to be send equal to 0. |
NRF_ERROR_BUSY | Operation failure. Transmitting of a packet in progress. |