Rtos API example
ethernet_mac_api.h File Reference
Ethernet MAC API. More...
Go to the source code of this file.
Data Structures | |
struct | eth_data_conf_s |
Struct eth_data_conf_s defines arguments for data confirm message. More... | |
struct | eth_data_req_s |
Struct eth_data_req_s defines arguments for data request message. More... | |
struct | eth_data_ind_s |
Struct eth_data_ind_s defines arguments for data indication message. More... | |
struct | eth_mac_api_s |
Struct eth_mac_api_s defines functions for two-way communications between ethernet MAC and Upper layer. More... | |
Typedefs | |
typedef struct eth_data_conf_s | eth_data_conf_t |
Struct eth_data_conf_s defines arguments for data confirm message. | |
typedef struct eth_data_req_s | eth_data_req_t |
Struct eth_data_req_s defines arguments for data request message. | |
typedef struct eth_data_ind_s | eth_data_ind_t |
Struct eth_data_ind_s defines arguments for data indication message. | |
typedef void | eth_mac_data_request (const eth_mac_api_t *api, const eth_data_req_t *data) |
data_request data request call | |
typedef void | eth_mac_data_confirm (const eth_mac_api_t *api, const eth_data_conf_t *data) |
data_confirm confirm is called as a response to data_request | |
typedef void | eth_mac_data_indication (const eth_mac_api_t *api, const eth_data_ind_t *data) |
data_indication Data indication is called when MAC layer has received data | |
typedef int8_t | eth_mac_mac48_address_set (const eth_mac_api_t *api, const uint8_t *mac48) |
Set 48 bit address from MAC. | |
typedef int8_t | eth_mac_mac48_address_get (const eth_mac_api_t *api, uint8_t *mac48_buf) |
Read 48 bit address from MAC. | |
typedef int8_t | eth_mac_api_initialize (eth_mac_api_t *api, eth_mac_data_confirm *conf_cb, eth_mac_data_indication *ind_cb, uint8_t parent_id) |
Upper layer will call this function, when MAC is taken into use. | |
Functions | |
eth_mac_api_t * | ethernet_mac_create (int8_t driver_id) |
Creates ethernet MAC API instance which will use driver given. | |
int8_t | ethernet_mac_destroy (eth_mac_api_t *mac_api) |
Destroy ethernet MAC API instance Call this only for freeing all allocated memory and when mac is total unused. |
Detailed Description
Ethernet MAC API.
Definition in file ethernet_mac_api.h.
Typedef Documentation
typedef struct eth_data_conf_s eth_data_conf_t |
Struct eth_data_conf_s defines arguments for data confirm message.
typedef struct eth_data_ind_s eth_data_ind_t |
Struct eth_data_ind_s defines arguments for data indication message.
typedef struct eth_data_req_s eth_data_req_t |
Struct eth_data_req_s defines arguments for data request message.
typedef int8_t eth_mac_api_initialize(eth_mac_api_t *api, eth_mac_data_confirm *conf_cb, eth_mac_data_indication *ind_cb, uint8_t parent_id) |
Upper layer will call this function, when MAC is taken into use.
- Parameters:
-
api API to initialize conf_cb Callback for confirm type of messages ind_cb Callback for indication type of messages parent_id Upper layer identifier
- Returns:
- 0 if success; -1 if api is NULL or not found
Definition at line 131 of file ethernet_mac_api.h.
typedef void eth_mac_data_confirm(const eth_mac_api_t *api, const eth_data_conf_t *data) |
data_confirm confirm is called as a response to data_request
- Parameters:
-
api The API which handled the request data Data containing confirm parameters
Definition at line 98 of file ethernet_mac_api.h.
typedef void eth_mac_data_indication(const eth_mac_api_t *api, const eth_data_ind_t *data) |
data_indication Data indication is called when MAC layer has received data
- Parameters:
-
api The API which handled the response data Data containing indication parameters
Definition at line 105 of file ethernet_mac_api.h.
typedef void eth_mac_data_request(const eth_mac_api_t *api, const eth_data_req_t *data) |
data_request data request call
- Parameters:
-
api API to handle the request data Data containing request parameters
Definition at line 91 of file ethernet_mac_api.h.
typedef int8_t eth_mac_mac48_address_get(const eth_mac_api_t *api, uint8_t *mac48_buf) |
Read 48 bit address from MAC.
- Parameters:
-
api API to handle the request mac48_buf Pointer where mac address can be written
- Returns:
- 0 if successful, -1 otherwise
Definition at line 121 of file ethernet_mac_api.h.
typedef int8_t eth_mac_mac48_address_set(const eth_mac_api_t *api, const uint8_t *mac48) |
Set 48 bit address from MAC.
- Parameters:
-
api API to handle the request mac48 Pointer having mac address to be set
- Returns:
- 0 if successful, -1 otherwise
Definition at line 113 of file ethernet_mac_api.h.
Function Documentation
eth_mac_api_t* ethernet_mac_create | ( | int8_t | driver_id ) |
Creates ethernet MAC API instance which will use driver given.
- Parameters:
-
driver_id Ethernet driver id. Must be valid
- Returns:
- New MAC instance if successful, NULL otherwise
int8_t ethernet_mac_destroy | ( | eth_mac_api_t * | mac_api ) |
Destroy ethernet MAC API instance Call this only for freeing all allocated memory and when mac is total unused.
- Parameters:
-
mac_api Removed mac class pointer
- Returns:
- -1 Unknow MAC
- 0 Mac class is removed
Generated on Sun Jul 17 2022 08:25:34 by 1.7.2