Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
arm_hal_phy.h File Reference
PHY device driver API. More...
Go to the source code of this file.
| Data Structures | |
| struct | phy_signal_info_s | 
| Signal level info.  More... | |
| struct | phy_rf_channel_configuration_s | 
| Channel configuration.  More... | |
| struct | phy_device_channel_page_s | 
| Channel page configuration.  More... | |
| struct | virtual_data_req_s | 
| Virtual data request.  More... | |
| struct | phy_device_driver_s | 
| Device driver structure.  More... | |
| Typedefs | |
| typedef enum phy_link_type_e | phy_link_type_e | 
| PHY types. | |
| typedef enum data_protocol_e | data_protocol_e | 
| Data layers. | |
| typedef enum driver_data_request_e | driver_data_request_e | 
| Requested data layer. | |
| typedef enum phy_signal_info_type_e | phy_signal_info_type_e | 
| Signal info types. | |
| typedef struct phy_signal_info_s | phy_signal_info_s | 
| Signal level info. | |
| typedef enum phy_modulation_e | phy_modulation_e | 
| PHY modulation scheme. | |
| typedef struct phy_rf_channel_configuration_s | phy_rf_channel_configuration_s | 
| Channel configuration. | |
| typedef struct phy_device_channel_page_s | phy_device_channel_page_s | 
| Channel page configuration. | |
| typedef struct virtual_data_req_s | virtual_data_req_t | 
| Virtual data request. | |
| typedef int8_t | arm_net_phy_rx_fn (const uint8_t *data_ptr, uint16_t data_len, uint8_t link_quality, int8_t dbm, int8_t driver_id) | 
| arm_net_phy_rx RX callback set by upper layer. | |
| typedef int8_t | arm_net_phy_tx_done_fn (int8_t driver_id, uint8_t tx_handle, phy_link_tx_status_e status, uint8_t cca_retry, uint8_t tx_retry) | 
| arm_net_phy_tx_done TX done callback set by upper layer. | |
| typedef int8_t | arm_net_virtual_rx_fn (const uint8_t *data_ptr, uint16_t data_len, int8_t driver_id) | 
| arm_net_virtual_rx RX callback set by user of serial MAC. | |
| typedef int8_t | arm_net_virtual_tx_fn (const virtual_data_req_t *data_req, int8_t driver_id) | 
| arm_net_virtual_tx TX callback set by serial MAC. | |
| typedef int8_t | arm_net_virtual_config_rx_fn (int8_t driver_id, const uint8_t *data, uint16_t length) | 
| arm_net_virtual_config Configuration receive callback set by upper layer. | |
| typedef int8_t | arm_net_virtual_config_tx_fn (int8_t driver_id, const uint8_t *data, uint16_t length) | 
| arm_net_virtual_config Configuration send callback set by upper layer. | |
| typedef int8_t | arm_net_virtual_confirmation_rx_fn (int8_t driver_id, const uint8_t *data, uint16_t length) | 
| arm_net_virtual_confirmation Confirmation receive callback set by upper layer. | |
| typedef struct phy_device_driver_s | phy_device_driver_s | 
| Device driver structure. | |
| Enumerations | |
| enum | phy_interface_state_e { PHY_INTERFACE_RESET, PHY_INTERFACE_DOWN, PHY_INTERFACE_UP, PHY_INTERFACE_RX_ENERGY_STATE, PHY_INTERFACE_SNIFFER_STATE } | 
| Interface states.More... | |
| enum | phy_link_tx_status_e { PHY_LINK_TX_DONE, PHY_LINK_TX_DONE_PENDING, PHY_LINK_TX_SUCCESS, PHY_LINK_TX_FAIL, PHY_LINK_CCA_FAIL } | 
| TX process return codes.More... | |
| enum | phy_extension_type_e { PHY_EXTENSION_CTRL_PENDING_BIT, PHY_EXTENSION_READ_LAST_ACK_PENDING_STATUS, PHY_EXTENSION_SET_CHANNEL, PHY_EXTENSION_READ_CHANNEL_ENERGY, PHY_EXTENSION_READ_LINK_STATUS, PHY_EXTENSION_CONVERT_SIGNAL_INFO, PHY_EXTENSION_ACCEPT_ANY_BEACON } | 
| Extension types.More... | |
| enum | phy_address_type_e { PHY_MAC_48BIT, PHY_MAC_64BIT, PHY_MAC_16BIT, PHY_MAC_PANID } | 
| Address types.More... | |
| enum | phy_link_type_e { PHY_LINK_ETHERNET_TYPE, PHY_LINK_15_4_2_4GHZ_TYPE, PHY_LINK_15_4_SUBGHZ_TYPE, PHY_LINK_TUN, PHY_LINK_SLIP } | 
| PHY types.More... | |
| enum | data_protocol_e { LOCAL_SOCKET_DATA = 0, INTERFACE_DATA = 1, PHY_LAYER_PAYLOAD = 2, IPV6_DATAGRAM = 3, UNKNOWN_PROTOCOL = 4 } | 
| Data layers.More... | |
| enum | driver_data_request_e { PHY_LAYER_PAYLOAD_DATA_FLOW, IPV6_DATAGRAMS_DATA_FLOW } | 
| Requested data layer.More... | |
| enum | phy_signal_info_type_e { PHY_SIGNAL_INFO_ETX, PHY_SIGNAL_INFO_IDR, PHY_SIGNAL_INFO_LINK_MARGIN } | 
| Signal info types.More... | |
| enum | phy_modulation_e { M_OFDM, M_OQPSK, M_BPSK, M_GFSK, M_UNDEFINED } | 
| PHY modulation scheme.More... | |
| enum | channel_page_e { CHANNEL_PAGE_0 = 0, CHANNEL_PAGE_1 = 1, CHANNEL_PAGE_2 = 2, CHANNEL_PAGE_3 = 3, CHANNEL_PAGE_4 = 4, CHANNEL_PAGE_5 = 5, CHANNEL_PAGE_6 = 6, CHANNEL_PAGE_9 = 9, CHANNEL_PAGE_10 = 10 } | 
| Channel page numbers.More... | |
| Functions | |
| int8_t | arm_net_phy_register (phy_device_driver_s *phy_driver) | 
| This function registers the device driver to stack. | |
| int8_t | arm_net_phy_mac64_set (uint8_t *MAC, int8_t id) | 
| Set driver mac64 address. | |
| uint8_t * | arm_net_phy_mac64_get (int8_t id) | 
| Get driver mac64 address. | |
| int | arm_net_phy_rf_type (int8_t id) | 
| Get driver link type. | |
| uint16_t | arm_net_phy_mtu_size (int8_t id) | 
| Get driver link type MTU size. | |
| void | arm_net_phy_unregister (int8_t driver_id) | 
| Unregister the driver from storage. | |
Detailed Description
PHY device driver API.
Definition in file arm_hal_phy.h.
Typedef Documentation
| typedef int8_t arm_net_phy_rx_fn(const uint8_t *data_ptr, uint16_t data_len, uint8_t link_quality, int8_t dbm, int8_t driver_id) | 
arm_net_phy_rx RX callback set by upper layer.
Called when data is received
- Parameters:
- 
  data_ptr Data received data_len Length of the data received link_quality Link quality dbm Power ratio in decibels driver_id ID of driver which received data 
- Returns:
- 0 if success, error otherwise
Definition at line 171 of file arm_hal_phy.h.
| typedef int8_t arm_net_phy_tx_done_fn(int8_t driver_id, uint8_t tx_handle, phy_link_tx_status_e status, uint8_t cca_retry, uint8_t tx_retry) | 
arm_net_phy_tx_done TX done callback set by upper layer.
Called when tx sent by upper layer has been handled
- Parameters:
- 
  driver_id Id of the driver which handled TX request tx_handle Handle of the TX status Status code of the TX handling result cca_retry Number of CCA retries done during handling tx_retry Number of TX retries done during handling 
- Returns:
- 0 if success, error otherwise
Definition at line 182 of file arm_hal_phy.h.
| typedef int8_t arm_net_virtual_config_rx_fn(int8_t driver_id, const uint8_t *data, uint16_t length) | 
arm_net_virtual_config Configuration receive callback set by upper layer.
Used to receive internal configuration parameters.
- Parameters:
- 
  driver_id Id of the driver to be used. data Pointer to received configuration data. length Length of the configuration data. 
- Returns:
- 0 if success, error otherwise
Definition at line 208 of file arm_hal_phy.h.
| typedef int8_t arm_net_virtual_config_tx_fn(int8_t driver_id, const uint8_t *data, uint16_t length) | 
arm_net_virtual_config Configuration send callback set by upper layer.
Used to send internal configuration parameters.
- Parameters:
- 
  driver_id Id of the driver to be used. data Pointer to sent configuration data. length Length of the configuration data. 
- Returns:
- 0 if success, error otherwise
Definition at line 217 of file arm_hal_phy.h.
| typedef int8_t arm_net_virtual_confirmation_rx_fn(int8_t driver_id, const uint8_t *data, uint16_t length) | 
arm_net_virtual_confirmation Confirmation receive callback set by upper layer.
Used to receive MLME confirmation data.
- Parameters:
- 
  driver_id Id of the driver to be used. data Pointer to received confirmation data. length Length of the confirmation data. 
- Returns:
- 0 if success, error otherwise
Definition at line 226 of file arm_hal_phy.h.
| typedef int8_t arm_net_virtual_rx_fn(const uint8_t *data_ptr, uint16_t data_len, int8_t driver_id) | 
arm_net_virtual_rx RX callback set by user of serial MAC.
Called when virtual RF has received data.
- Parameters:
- 
  data_ptr Data received data_len Length of the data received driver_id ID of driver which received data 
- Returns:
- 0 if success, error otherwise
Definition at line 191 of file arm_hal_phy.h.
| typedef int8_t arm_net_virtual_tx_fn(const virtual_data_req_t *data_req, int8_t driver_id) | 
arm_net_virtual_tx TX callback set by serial MAC.
Used to send data.
- Parameters:
- 
  data_req Data to be sent driver_id Id of the driver to be used. 
- Returns:
- 0 if success, error otherwise
Definition at line 199 of file arm_hal_phy.h.
| typedef enum data_protocol_e data_protocol_e | 
Data layers.
| typedef enum driver_data_request_e driver_data_request_e | 
Requested data layer.
| typedef struct phy_device_channel_page_s phy_device_channel_page_s | 
Channel page configuration.
| typedef struct phy_device_driver_s phy_device_driver_s | 
Device driver structure.
| typedef enum phy_link_type_e phy_link_type_e | 
PHY types.
| typedef enum phy_modulation_e phy_modulation_e | 
PHY modulation scheme.
| typedef struct phy_rf_channel_configuration_s phy_rf_channel_configuration_s | 
Channel configuration.
| typedef struct phy_signal_info_s phy_signal_info_s | 
Signal level info.
| typedef enum phy_signal_info_type_e phy_signal_info_type_e | 
Signal info types.
Types of signal quality indication desired by various link protocols. Some are really statistical, but a driver should ideally be able to create an estimate based on its LQI/DBM numbers, for example to bootstrap a statistic calculation.
| typedef struct virtual_data_req_s virtual_data_req_t | 
Virtual data request.
Enumeration Type Documentation
| enum channel_page_e | 
Channel page numbers.
- Enumerator:
Definition at line 124 of file arm_hal_phy.h.
| enum data_protocol_e | 
Data layers.
- Enumerator:
Definition at line 79 of file arm_hal_phy.h.
Requested data layer.
- Enumerator:
- PHY_LAYER_PAYLOAD_DATA_FLOW - PHY layer data. - IPV6_DATAGRAMS_DATA_FLOW - IP layer data or TUN driver request data. 
Definition at line 88 of file arm_hal_phy.h.
| enum phy_address_type_e | 
Address types.
- Enumerator:
Definition at line 62 of file arm_hal_phy.h.
| enum phy_extension_type_e | 
Extension types.
- Enumerator:
Definition at line 51 of file arm_hal_phy.h.
Interface states.
- Enumerator:
Definition at line 33 of file arm_hal_phy.h.
| enum phy_link_tx_status_e | 
TX process return codes.
- Enumerator:
Definition at line 42 of file arm_hal_phy.h.
| enum phy_link_type_e | 
PHY types.
- Enumerator:
Definition at line 70 of file arm_hal_phy.h.
| enum phy_modulation_e | 
PHY modulation scheme.
Definition at line 114 of file arm_hal_phy.h.
Signal info types.
Types of signal quality indication desired by various link protocols. Some are really statistical, but a driver should ideally be able to create an estimate based on its LQI/DBM numbers, for example to bootstrap a statistic calculation.
- Enumerator:
Definition at line 99 of file arm_hal_phy.h.
Function Documentation
| uint8_t* arm_net_phy_mac64_get | ( | int8_t | id ) | 
Get driver mac64 address.
- Parameters:
- 
  id driver id 
- Returns:
- > 0 Return pointer to MAC.
- NULL.
Definition at line 114 of file rf_driver_storage.c.
| int8_t arm_net_phy_mac64_set | ( | uint8_t * | MAC, | 
| int8_t | id | ||
| ) | 
Set driver mac64 address.
- Parameters:
- 
  MAC A pointer to new mac64 address which is copied to old one. id driver id 
- Returns:
- >= 0 SET OK.
- < 0 Means register fail.
Definition at line 103 of file rf_driver_storage.c.
| uint16_t arm_net_phy_mtu_size | ( | int8_t | id ) | 
Get driver link type MTU size.
- Parameters:
- 
  id driver id 
- Returns:
- size of MTU.
Definition at line 132 of file rf_driver_storage.c.
| int8_t arm_net_phy_register | ( | phy_device_driver_s * | phy_driver ) | 
This function registers the device driver to stack.
- Parameters:
- 
  phy_driver A pointer to device driver structure. 
- Returns:
- >= 0 Device driver ID.
- < 0 Means register fail.
Definition at line 67 of file rf_driver_storage.c.
| int arm_net_phy_rf_type | ( | int8_t | id ) | 
Get driver link type.
- Parameters:
- 
  id driver id 
- Returns:
- driver link type.
Definition at line 123 of file rf_driver_storage.c.
| void arm_net_phy_unregister | ( | int8_t | driver_id ) | 
Unregister the driver from storage.
- Parameters:
- 
  driver_id driver id 
Definition at line 141 of file rf_driver_storage.c.
Generated on Tue Jul 12 2022 18:18:56 by
 1.7.2
 1.7.2