wirepas 2.1.0.0
|
API for configuring and manipulating Wirepas Click driver. More...
Modules | |
Wirepas Device Settings | |
Settings for registers of Wirepas Click driver. | |
Wirepas MikroBUS Map | |
MikroBUS pin mapping of Wirepas Click driver. | |
Functions | |
void | wirepas_cfg_setup (wirepas_cfg_t *cfg) |
Wirepas configuration object setup function. More... | |
err_t | wirepas_init (wirepas_t *ctx, wirepas_cfg_t *cfg) |
Wirepas initialization function. More... | |
void | wirepas_default_cfg (wirepas_t *ctx) |
Wirepas default configuration function. More... | |
err_t | wirepas_generic_write (wirepas_t *ctx, uint8_t *data_in, uint16_t len) |
Wirepas data writing function. More... | |
err_t | wirepas_generic_read (wirepas_t *ctx, uint8_t *data_out, uint16_t len) |
Wirepas data reading function. More... | |
uint8_t | wirepas_get_din_state (wirepas_t *ctx) |
Wirepas get DIN state function. More... | |
void | wirepas_set_rst (wirepas_t *ctx, uint8_t pin_state) |
Wirepas set RST pin state function. More... | |
void | wirepas_hw_reset (wirepas_t *ctx) |
Wirepas hardware reset function. More... | |
err_t | wirepas_send_command (wirepas_t *ctx, uint8_t primitive_id, uint8_t frame_id, uint8_t payload_length, uint8_t *payload) |
Wirepas send command function. More... | |
err_t | wirepas_write_csap_attribute (wirepas_t *ctx, uint8_t frame_id, uint16_t attribute_id, uint8_t attribute_len, uint8_t *attribute_val) |
Wirepas write CSAP attribute function. More... | |
err_t | wirepas_read_csap_attribute (wirepas_t *ctx, uint8_t frame_id, uint16_t attribute_id, uint8_t *attribute_len, uint8_t *attribute_val) |
Wirepas read CSAP attribute function. More... | |
err_t | wirepas_set_node_address (wirepas_t *ctx, uint8_t frame_id, uint32_t address) |
Wirepas set node address function. More... | |
err_t | wirepas_set_net_address (wirepas_t *ctx, uint8_t frame_id, uint32_t net_address) |
Wirepas set net address function. More... | |
err_t | wirepas_poll_indication (wirepas_t *ctx, uint8_t frame_id, uint8_t *rx_data, uint8_t *data_rdy) |
Wirepas poll indication function. More... | |
err_t | wirepas_send_data (wirepas_t *ctx, uint8_t frame_id, uint16_t pduid, uint8_t source_endpoint, uint32_t destination_addr, uint8_t destination_endpoint, uint8_t tx_op, uint8_t apdu_length, uint8_t *apdu) |
Wirepas send data function. More... | |
API for configuring and manipulating Wirepas Click driver.
void wirepas_cfg_setup | ( | wirepas_cfg_t * | cfg | ) |
Wirepas configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See wirepas_cfg_t object definition for detailed explanation. |
void wirepas_default_cfg | ( | wirepas_t * | ctx | ) |
Wirepas default configuration function.
This function executes a default configuration of Wirepas click board.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
err_t wirepas_generic_read | ( | wirepas_t * | ctx, |
uint8_t * | data_out, | ||
uint16_t | len | ||
) |
Wirepas data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. err_t wirepas_generic_write | ( | wirepas_t * | ctx, |
uint8_t * | data_in, | ||
uint16_t | len | ||
) |
Wirepas data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | data_in | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. uint8_t wirepas_get_din_state | ( | wirepas_t * | ctx | ) |
Wirepas get DIN state function.
This function reads a state of the din pin.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
void wirepas_hw_reset | ( | wirepas_t * | ctx | ) |
Wirepas hardware reset function.
This function is used to perform a hardware reset.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | pin_state | : State of the RST pin. |
err_t wirepas_init | ( | wirepas_t * | ctx, |
wirepas_cfg_t * | cfg | ||
) |
Wirepas initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See wirepas_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t wirepas_poll_indication | ( | wirepas_t * | ctx, |
uint8_t | frame_id, | ||
uint8_t * | rx_data, | ||
uint8_t * | data_rdy | ||
) |
Wirepas poll indication function.
This function is used to send poll indication command to prepare device to send or receive data, and to get data that was sent.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | frame_id | : Frame identifier. The initiating peer decides the ID and responding peer uses the same value in the response frame. |
[out] | rx_data | : Read data, it is available only if data_rdy is 1. |
[out] | data_rdy | : Data ready indicator. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t wirepas_read_csap_attribute | ( | wirepas_t * | ctx, |
uint8_t | frame_id, | ||
uint16_t | attribute_id, | ||
uint8_t * | attribute_len, | ||
uint8_t * | attribute_val | ||
) |
Wirepas read CSAP attribute function.
This function is used to read value specific CSAP attribute.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | frame_id | : Frame identifier. The initiating peer decides the ID and responding peer uses the same value in the response frame. |
[in] | attribute_id | : The ID of the attribute that is written. |
[out] | attribute_len | : The length (in octets) of the attribute that is read. |
[out] | attribute_val | : The value that is read. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t wirepas_send_command | ( | wirepas_t * | ctx, |
uint8_t | primitive_id, | ||
uint8_t | frame_id, | ||
uint8_t | payload_length, | ||
uint8_t * | payload | ||
) |
Wirepas send command function.
This function is used to send command.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | primitive_id | : The PDU ID can be used to keep track of APDUs processed. |
[in] | frame_id | : Frame identifier. The initiating peer decides the ID and responding peer uses the same value in the response frame. |
[in] | primitive_id | : The PDU ID can be used to keep track of APDUs processed. |
[in] | payload_length | : Payload length in octets, excluding the CRC octets. |
[in] | payload | : The payload of the frame, depends on the primitive in question. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t wirepas_send_data | ( | wirepas_t * | ctx, |
uint8_t | frame_id, | ||
uint16_t | pduid, | ||
uint8_t | source_endpoint, | ||
uint32_t | destination_addr, | ||
uint8_t | destination_endpoint, | ||
uint8_t | tx_op, | ||
uint8_t | apdu_length, | ||
uint8_t * | apdu | ||
) |
Wirepas send data function.
This function is used to send data to the other devices.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | frame_id | : Frame identifier. The initiating peer decides the ID and responding peer uses the same value in the response frame. |
[in] | pduid | : PDU identifier decided by the application. The PDU ID can be used to keep track of APDUs processed by the stack. |
[in] | source_endpoint | : Source endpoint number. |
[in] | destination_addr | : Destination node address. |
[in] | destination_endpoint | : Destination endpoint number. |
[in] | tx_op | : The TX options are indicated as a bit field with individual bits. |
[in] | apdu_length | : The length of the following APDU in octets. |
[in] | apdu | : Application payload. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t wirepas_set_net_address | ( | wirepas_t * | ctx, |
uint8_t | frame_id, | ||
uint32_t | net_address | ||
) |
Wirepas set net address function.
This function is used to set net address.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | frame_id | : Frame identifier. The initiating peer decides the ID and responding peer uses the same value in the response frame. |
[in] | net_address | : Net address. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t wirepas_set_node_address | ( | wirepas_t * | ctx, |
uint8_t | frame_id, | ||
uint32_t | address | ||
) |
Wirepas set node address function.
This function is used to set node address.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | frame_id | : Frame identifier. The initiating peer decides the ID and responding peer uses the same value in the response frame. |
[in] | address | : Node address. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. void wirepas_set_rst | ( | wirepas_t * | ctx, |
uint8_t | pin_state | ||
) |
Wirepas set RST pin state function.
This function is used to set RST pin state.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | pin_state | : State of the RST pin. |
err_t wirepas_write_csap_attribute | ( | wirepas_t * | ctx, |
uint8_t | frame_id, | ||
uint16_t | attribute_id, | ||
uint8_t | attribute_len, | ||
uint8_t * | attribute_val | ||
) |
Wirepas write CSAP attribute function.
This function is used to set specific CSAP attribute.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | frame_id | : Frame identifier. The initiating peer decides the ID and responding peer uses the same value in the response frame. |
[in] | attribute_id | : The ID of the attribute that is written. |
[in] | attribute_len | : The length (in octets) of the attribute that is written. |
[in] | attribute_val | : The value that is written to the attribute specified by the set attribute ID. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation.