wirepas 2.1.0.0
|
API for configuring and manipulating Wirepas Click driver. More...
Topics | |
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. | |
err_t | wirepas_init (wirepas_t *ctx, wirepas_cfg_t *cfg) |
Wirepas initialization function. | |
void | wirepas_default_cfg (wirepas_t *ctx) |
Wirepas default configuration function. | |
err_t | wirepas_generic_write (wirepas_t *ctx, uint8_t *data_in, uint16_t len) |
Wirepas data writing function. | |
err_t | wirepas_generic_read (wirepas_t *ctx, uint8_t *data_out, uint16_t len) |
Wirepas data reading function. | |
uint8_t | wirepas_get_din_state (wirepas_t *ctx) |
Wirepas get DIN state function. | |
void | wirepas_set_rst (wirepas_t *ctx, uint8_t pin_state) |
Wirepas set RST pin state function. | |
void | wirepas_hw_reset (wirepas_t *ctx) |
Wirepas hardware reset function. | |
err_t | wirepas_send_command (wirepas_t *ctx, uint8_t primitive_id, uint8_t payload_length, uint8_t *payload) |
Wirepas send command function. | |
err_t | wirepas_send_ack (wirepas_t *ctx, uint8_t primitive_id, uint8_t frame_id, uint8_t result) |
Wirepas send ack function. | |
err_t | wirepas_write_csap_attribute (wirepas_t *ctx, uint16_t attribute_id, uint8_t attribute_len, uint8_t *attribute_val) |
Wirepas write CSAP attribute function. | |
err_t | wirepas_read_csap_attribute (wirepas_t *ctx, uint16_t attribute_id, uint8_t *attribute_len, uint8_t *attribute_val) |
Wirepas read CSAP attribute function. | |
err_t | wirepas_set_node_address (wirepas_t *ctx, uint32_t address) |
Wirepas set node address function. | |
err_t | wirepas_set_net_address (wirepas_t *ctx, uint32_t net_address) |
Wirepas set net address function. | |
err_t | wirepas_read_frame (wirepas_t *ctx, wirepas_frame_t *frame) |
Wirepas read frame function. | |
err_t | wirepas_send_data (wirepas_t *ctx, wirepas_sink_data sink_data, uint8_t tx_op, uint8_t apdu_length, uint8_t *apdu) |
Wirepas send data function. | |
API for configuring and manipulating Wirepas Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
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_read_csap_attribute | ( | wirepas_t * | ctx, |
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] | 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_read_frame | ( | wirepas_t * | ctx, |
wirepas_frame_t * | frame ) |
Wirepas read frame function.
This function is used to read whole frame of the Wirepas click data.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[out] | frame | : Read frame data. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t wirepas_send_ack | ( | wirepas_t * | ctx, |
uint8_t | primitive_id, | ||
uint8_t | frame_id, | ||
uint8_t | result ) |
Wirepas send ack function.
This function is used to send response to sent data.
[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 | : Message frame id. |
[in] | result | : Indication result. |
>=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 | 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] | 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, |
wirepas_sink_data | sink_data, | ||
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] | sink_data | : Sink data object. |
[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, |
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] | net_address | : Net address. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t wirepas_set_node_address | ( | wirepas_t * | ctx, |
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] | 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, |
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] | 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.