InPlay API
IPMAC driver

HAL_IPMAC. More...

Data Structures

struct  ipmac_init_t
 Initialization parameters for ipmac. More...
 
struct  ipmac_mst_cb_t
 Master callback parameter. More...
 
struct  ipmac_slv_cb_t
 Slave callback parameter. More...
 
struct  ipmac_mst_tx_t
 Master TX parameter. More...
 
struct  ipmac_mst_prio_tx_t
 Master priority TX parameter. More...
 
struct  ipmac_slv_tx_t
 Slave TX parameter. More...
 
struct  ipmac_slv_prio_tx_t
 Slave priority TX parameter. More...
 
struct  ipmac_queue_t
 Queue configuration parameter. More...
 
struct  ipmac_freq_tab_t
 Frequence table parameter. More...
 
struct  ipmac_update_remote_t
 Update remote deivce parameter. More...
 
struct  ipmac_mst_update_cfg_t
 Master update configration parameter. More...
 
struct  ipmac_slv_update_cfg_t
 Slave update configration parameter. More...
 

Functions

ipmac_dev_t * hal_ipmac_open (ipmac_init_t *para)
 Open HAL IPMAC driver. More...
 
void hal_ipmac_close (ipmac_dev_t *pd)
 Close HAL IPMAC driver. More...
 
int hal_ipmac_mst_cfg (ipmac_dev_t *pd, ipmac_offset_param_t *offset)
 Config master device. More...
 
int hal_ipmac_slv_cfg (ipmac_dev_t *pd, int slv_id, ipmac_offset_param_t *offset)
 Config slave device. More...
 
int hal_ipmac_set_freq_table (ipmac_dev_t *pd, ipmac_freq_tab_t *tab)
 Set frequency table. More...
 
int hal_ipmac_mst_start (ipmac_dev_t *pd)
 Start master device. More...
 
int hal_ipmac_slv_start (ipmac_dev_t *pd)
 Start slave device. More...
 
int hal_ipmac_mst_tx (ipmac_dev_t *pd, ipmac_mst_tx_t *para)
 Send packet from master device. More...
 
int hal_ipmac_slv_tx (ipmac_dev_t *pd, ipmac_slv_tx_t *para)
 Send packet from slave device. More...
 
int hal_ipmac_mst_udpate_remote_offset (ipmac_dev_t *pd, ipmac_update_remote_t *update)
 Master udpate slave offset parameter. More...
 
int hal_ipmac_mst_stop (ipmac_dev_t *pd)
 Stop master device. More...
 
int hal_ipmac_mst_set_cb (ipmac_dev_t *pd, ipmac_mst_cb_t *cb)
 Set master callback. More...
 
int hal_ipmac_slv_set_cb (ipmac_dev_t *pd, ipmac_slv_cb_t *cb)
 Set slave callback. More...
 
int hal_ipmac_slv_stop (ipmac_dev_t *pd)
 Stop slave device. More...
 
int hal_ipmac_slv_en_queue (ipmac_dev_t *pd, ipmac_queue_t *para)
 Slave enable queue. More...
 
int hal_ipmac_slv_dis_queue (ipmac_dev_t *pd)
 Slave disable queue. More...
 
int hal_ipmac_mst_en_queue (ipmac_dev_t *pd, int slv_id, ipmac_queue_t *para)
 Master enable queue. More...
 
int hal_ipmac_mst_dis_queue (ipmac_dev_t *pd, int slv_id)
 Master disable queue. More...
 
int hal_ipmac_mst_ota_tx (ipmac_dev_t *pd, ipmac_mst_tx_t *para)
 Master send OTA data. More...
 
int hal_ipmac_bc_int_set (ipmac_dev_t *pd, uint8_t *data, uint16_t len)
 udpate internal buffer of broadcast pdu, normally, is using to hopping application. More...
 
int hal_ipmac_set_bc_buf (ipmac_dev_t *pd, uint8_t *buf, uint16_t max_len)
 set bc buffer and maximum length More...
 
int hal_ipmac_mst_bc_cont_tx (ipmac_dev_t *pd, uint8_t *buffer, uint16_t buffer_len)
 update broadcast pdu buffer, and tx in every frame. need firstly call More...
 
int hal_ipmac_slv_status (ipmac_dev_t *pd)
 Get current status of the slave. More...
 
uint32_t hal_ipmac_frame_time (ipmac_dev_t *pd)
 Get the real time of the superframe. More...
 
int16_t get_rssi (void)
 Get RSSI. More...
 
uint32_t hal_ipmac_convert_sf_timestamp (ipmac_dev_t *pd, uint32_t sf_reg)
 Convert the super frame counter into time. Before successfully using this API, you should do the following two steps at first. More...
 
int hal_ipmac_enable_intr (ipmac_dev_t *pd, uint32_t intr_src)
 Enable interrupt. More...
 
int hal_ipmac_disable_intr (ipmac_dev_t *pd, uint32_t intr_src)
 Disable Interrupt. More...
 
int hal_ipmac_set_sync (ipmac_dev_t *pd, uint8_t addr_idx, uint32_t address)
 set SYNC word, 4 different SYNC words can be configured. More...
 
int hal_ipmac_set_resp_sync (ipmac_dev_t *pd, uint8_t addr_idx, uint32_t address)
 set response SYNC word More...
 
int hal_ipmac_sync_sel (ipmac_dev_t *pd, uint8_t addr_idx, uint8_t sf_idx)
 Select the SYNC word for the superframe. More...
 
int hal_ipmac_resp_sync_sel (ipmac_dev_t *pd, uint8_t addr_idx, uint8_t sf_idx)
 Select the response SYNC word for the superframe. More...
 
int hal_ipmac_sync_sel_clear (ipmac_dev_t *pd)
 The default SYNC word is used for all superframes. More...
 
int hal_ipmac_resp_sync_sel_clear (ipmac_dev_t *pd)
 The default response SYNC word is used for all superframes. More...
 

Detailed Description

HAL_IPMAC.

Function Documentation

◆ get_rssi()

int16_t get_rssi ( void  )

Get RSSI.

Returns
int16 RSSI value

◆ hal_ipmac_bc_int_set()

int hal_ipmac_bc_int_set ( ipmac_dev_t *  pd,
uint8_t *  data,
uint16_t  len 
)

udpate internal buffer of broadcast pdu, normally, is using to hopping application.

Parameters
pdDevice handle.
databuffer data
lenbuffer length
Returns
See also
enum ipmac_error.

◆ hal_ipmac_close()

void hal_ipmac_close ( ipmac_dev_t *  pd)

Close HAL IPMAC driver.

Parameters
[in]pdDevice handle.
Returns
N/A.

◆ hal_ipmac_convert_sf_timestamp()

uint32_t hal_ipmac_convert_sf_timestamp ( ipmac_dev_t *  pd,
uint32_t  sf_reg 
)

Convert the super frame counter into time. Before successfully using this API, you should do the following two steps at first.

  1. enable the SF count snapshot by calling ipmac_sf_cnt_snapshot_en
  2. get the SF count by calling ipmac_sf_cnt_snapshot, and then pass the count into this function.
Parameters
[in]pdDevice handle.
[in]sf_regRead from super frame counter register
Returns
uint32_t time transfered from SF counter

◆ hal_ipmac_disable_intr()

int hal_ipmac_disable_intr ( ipmac_dev_t *  pd,
uint32_t  intr_src 
)

Disable Interrupt.

Parameters
[in]pdDevice handle.
[in]intr_srcinterrupt source
Returns
See also
enum ipmac_error.

◆ hal_ipmac_enable_intr()

int hal_ipmac_enable_intr ( ipmac_dev_t *  pd,
uint32_t  intr_src 
)

Enable interrupt.

Parameters
[in]pdDevice handle.
[in]intr_srcinterrupt source
Returns
See also
enum ipmac_error.

◆ hal_ipmac_frame_time()

uint32_t hal_ipmac_frame_time ( ipmac_dev_t *  pd)

Get the real time of the superframe.

Parameters
[in]pdDevice handle.
Returns
the real time in us of the superframe

◆ hal_ipmac_mst_bc_cont_tx()

int hal_ipmac_mst_bc_cont_tx ( ipmac_dev_t *  pd,
uint8_t *  buffer,
uint16_t  buffer_len 
)

update broadcast pdu buffer, and tx in every frame. need firstly call


See also
hal_ipmac_set_bc_buf to set buffer
Parameters
pd
bufferdata's buffer, null will disable cont_tx
buffer_lenlength of the data, 0 will disable cont_tx
Returns
See also
enum ipmac_error.

◆ hal_ipmac_mst_cfg()

int hal_ipmac_mst_cfg ( ipmac_dev_t *  pd,
ipmac_offset_param_t *  offset 
)

Config master device.

Parameters
[in]pdDevice handle.
[in]offsetConfig parameter, ipmac_offset_param_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_mst_dis_queue()

int hal_ipmac_mst_dis_queue ( ipmac_dev_t *  pd,
int  slv_id 
)

Master disable queue.

Parameters
[in]pdDevice handle.
[in]slv_idSlave id
Returns
See also
enum ipmac_error.

◆ hal_ipmac_mst_en_queue()

int hal_ipmac_mst_en_queue ( ipmac_dev_t *  pd,
int  slv_id,
ipmac_queue_t para 
)

Master enable queue.

Parameters
[in]pdDevice handle.
[in]slv_idSlave id
[in]paraipmac_queue_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_mst_ota_tx()

int hal_ipmac_mst_ota_tx ( ipmac_dev_t *  pd,
ipmac_mst_tx_t para 
)

Master send OTA data.

Parameters
[in]pdDevice handle.
[in]paraipmac_mst_tx_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_mst_set_cb()

int hal_ipmac_mst_set_cb ( ipmac_dev_t *  pd,
ipmac_mst_cb_t cb 
)

Set master callback.

Parameters
pdDevice handle.
cbcallback
See also
ipmac_mst_cb_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_mst_start()

int hal_ipmac_mst_start ( ipmac_dev_t *  pd)

Start master device.

Parameters
[in]pdDevice handle.
Returns
See also
enum ipmac_error.

◆ hal_ipmac_mst_stop()

int hal_ipmac_mst_stop ( ipmac_dev_t *  pd)

Stop master device.

Parameters
[in]pdDevice handle.
Returns
See also
enum ipmac_error.

◆ hal_ipmac_mst_tx()

int hal_ipmac_mst_tx ( ipmac_dev_t *  pd,
ipmac_mst_tx_t para 
)

Send packet from master device.

Parameters
[in]pdDevice handle.
[in]paratx parameter. enum ipmac_mst_tx_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_mst_udpate_remote_offset()

int hal_ipmac_mst_udpate_remote_offset ( ipmac_dev_t *  pd,
ipmac_update_remote_t update 
)

Master udpate slave offset parameter.

Parameters
[in]pdDevice handle.
[in]updateenum ipmac_update_remote_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_open()

ipmac_dev_t* hal_ipmac_open ( ipmac_init_t para)

Open HAL IPMAC driver.

Note
Open HAL IPMAC driver
Parameters
[in]paraOpen parameter, ipmac_init_t
Returns
IMPAC device handle, NULL if has error

◆ hal_ipmac_resp_sync_sel()

int hal_ipmac_resp_sync_sel ( ipmac_dev_t *  pd,
uint8_t  addr_idx,
uint8_t  sf_idx 
)

Select the response SYNC word for the superframe.

Parameters
[in]pdDevice handle.
[in]addr_idxone of the 4 response SYNC words (0 - 3)
[in]sf_idxindex in the superframes (0-63)
Returns
See also
enum ipmac_error.

◆ hal_ipmac_resp_sync_sel_clear()

int hal_ipmac_resp_sync_sel_clear ( ipmac_dev_t *  pd)

The default response SYNC word is used for all superframes.

Parameters
[in]pdDevice handle.
Returns
See also
enum ipmac_error.

◆ hal_ipmac_set_bc_buf()

int hal_ipmac_set_bc_buf ( ipmac_dev_t *  pd,
uint8_t *  buf,
uint16_t  max_len 
)

set bc buffer and maximum length


Parameters
pdDevice handle.
bufbuffer data
max_lenmax buffer length
Returns
See also
enum ipmac_error.

◆ hal_ipmac_set_freq_table()

int hal_ipmac_set_freq_table ( ipmac_dev_t *  pd,
ipmac_freq_tab_t tab 
)

Set frequency table.

Note
This table use for frequency hopping.
Parameters
[in]pdDevice handle.
[in]tabipmac_freq_tab_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_set_resp_sync()

int hal_ipmac_set_resp_sync ( ipmac_dev_t *  pd,
uint8_t  addr_idx,
uint32_t  address 
)

set response SYNC word

Parameters
[in]pdDevice handle.
[in]addr_idxone of the 4 response SYNC words (0 - 3)
[in]addressa 32-bit number
Returns
See also
enum ipmac_error.

◆ hal_ipmac_set_sync()

int hal_ipmac_set_sync ( ipmac_dev_t *  pd,
uint8_t  addr_idx,
uint32_t  address 
)

set SYNC word, 4 different SYNC words can be configured.

Parameters
[in]pdDevice handle.
[in]addr_idxone of the 4 SYNC words (0 - 3)
[in]addressa 32-bit number
Returns
See also
enum ipmac_error.

◆ hal_ipmac_slv_cfg()

int hal_ipmac_slv_cfg ( ipmac_dev_t *  pd,
int  slv_id,
ipmac_offset_param_t *  offset 
)

Config slave device.

Parameters
[in]pdDevice handle.
[in]slv_idSlave id
[in]offsetConfig parameter, ipmac_offset_param_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_slv_dis_queue()

int hal_ipmac_slv_dis_queue ( ipmac_dev_t *  pd)

Slave disable queue.

Parameters
[in]pdDevice handle.
Returns
See also
enum ipmac_error.

◆ hal_ipmac_slv_en_queue()

int hal_ipmac_slv_en_queue ( ipmac_dev_t *  pd,
ipmac_queue_t para 
)

Slave enable queue.

Parameters
[in]pdDevice handle.
[in]paraipmac_queue_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_slv_set_cb()

int hal_ipmac_slv_set_cb ( ipmac_dev_t *  pd,
ipmac_slv_cb_t cb 
)

Set slave callback.

Parameters
pdDevice handle.
cbcallback
See also
ipmac_mst_cb_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_slv_start()

int hal_ipmac_slv_start ( ipmac_dev_t *  pd)

Start slave device.

Parameters
[in]pdDevice handle.
Returns
See also
enum ipmac_error.

◆ hal_ipmac_slv_status()

int hal_ipmac_slv_status ( ipmac_dev_t *  pd)

Get current status of the slave.

Parameters
[in]pdDevice handle.
Returns
slave's status

◆ hal_ipmac_slv_stop()

int hal_ipmac_slv_stop ( ipmac_dev_t *  pd)

Stop slave device.

Parameters
[in]pdDevice handle.
Returns
See also
enum ipmac_error.

◆ hal_ipmac_slv_tx()

int hal_ipmac_slv_tx ( ipmac_dev_t *  pd,
ipmac_slv_tx_t para 
)

Send packet from slave device.

Parameters
[in]pdDevice handle.
[in]paraenum ipmac_slv_tx_t
Returns
See also
enum ipmac_error.

◆ hal_ipmac_sync_sel()

int hal_ipmac_sync_sel ( ipmac_dev_t *  pd,
uint8_t  addr_idx,
uint8_t  sf_idx 
)

Select the SYNC word for the superframe.

Parameters
[in]pdDevice handle.
[in]addr_idxone of the 4 SYNC words (0 - 3)
[in]sf_idxindex in the superframes (0-63)
Returns
See also
enum ipmac_error.

◆ hal_ipmac_sync_sel_clear()

int hal_ipmac_sync_sel_clear ( ipmac_dev_t *  pd)

The default SYNC word is used for all superframes.

Parameters
[in]pdDevice handle.
Returns
See also
enum ipmac_error.