ism5 2.1.0.0
|
API for configuring and manipulating ISM 5 Click driver. More...
Topics | |
ISM 5 Commands List | |
List of commands of ISM 5 Click driver. | |
ISM 5 Registers Settings | |
Settings for registers of ISM 5 Click driver. | |
ISM 5 MikroBUS Map | |
MikroBUS pin mapping of ISM 5 Click driver. | |
Functions | |
void | ism5_cfg_setup (ism5_cfg_t *cfg) |
ISM 5 configuration object setup function. | |
err_t | ism5_init (ism5_t *ctx, ism5_cfg_t *cfg) |
ISM 5 initialization function. | |
err_t | ism5_default_cfg (ism5_t *ctx) |
ISM 5 default configuration function. | |
err_t | ism5_send_cmd (ism5_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len) |
ISM 5 send cmd function. | |
err_t | ism5_read_rsp (ism5_t *ctx, uint8_t *data_out, uint8_t len) |
ISM 5 read resp function. | |
err_t | ism5_send_fast_cmd (ism5_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len) |
ISM 5 send fast cmd function. | |
err_t | ism5_read_fast_cmd (ism5_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len) |
ISM 5 read fast cmd function. | |
err_t | ism5_wait_ready (ism5_t *ctx) |
ISM 5 wait ready function. | |
err_t | ism5_check_ready (ism5_t *ctx) |
ISM 5 check ready function. | |
void | ism5_enable_device (ism5_t *ctx) |
ISM 5 enable device function. | |
void | ism5_disable_device (ism5_t *ctx) |
ISM 5 disable device function. | |
uint8_t | ism5_get_int_pin (ism5_t *ctx) |
ISM 5 get int pin function. | |
err_t | ism5_check_communication (ism5_t *ctx) |
ISM 5 check communication function. | |
err_t | ism5_config_init (ism5_t *ctx) |
ISM 5 config init function. | |
err_t | ism5_power_up (ism5_t *ctx) |
ISM 5 power up function. | |
err_t | ism5_get_part_info (ism5_t *ctx, ism5_part_info_t *part_info) |
ISM 5 get part info function. | |
err_t | ism5_set_property (ism5_t *ctx, uint16_t prop_idx, uint8_t *data_in, uint8_t num_props) |
ISM 5 set property function. | |
err_t | ism5_get_property (ism5_t *ctx, uint16_t prop_idx, uint8_t *data_out, uint8_t num_props) |
ISM 5 get property function. | |
err_t | ism5_set_property_byte (ism5_t *ctx, uint16_t prop_idx, uint8_t data_in) |
ISM 5 set property byte function. | |
err_t | ism5_get_property_byte (ism5_t *ctx, uint16_t prop_idx, uint8_t *data_out) |
ISM 5 get property byte function. | |
err_t | ism5_gpio_config (ism5_t *ctx, ism5_gpio_config_t *gpio_cfg) |
ISM 5 gpio config function. | |
err_t | ism5_fifo_info (ism5_t *ctx, uint8_t fifo_reset, uint8_t *rx_fifo_count, uint8_t *tx_fifo_space) |
ISM 5 fifo info function. | |
err_t | ism5_get_int_status (ism5_t *ctx, ism5_int_status_t *status) |
ISM 5 get int status function. | |
err_t | ism5_get_device_state (ism5_t *ctx, uint8_t *state, uint8_t *channel) |
ISM 5 get device state function. | |
err_t | ism5_change_state (ism5_t *ctx, uint8_t state) |
ISM 5 change state function. | |
err_t | ism5_start_tx (ism5_t *ctx, uint8_t channel, uint8_t condition, uint16_t len) |
ISM 5 start tx function. | |
err_t | ism5_write_tx_fifo (ism5_t *ctx, uint8_t *data_in, uint8_t len) |
ISM 5 write tx fifo function. | |
err_t | ism5_start_rx (ism5_t *ctx, uint8_t channel, uint8_t condition, uint16_t len) |
ISM 5 start rx function. | |
err_t | ism5_read_rx_fifo (ism5_t *ctx, uint8_t *data_out, uint8_t len) |
ISM 5 read rx fifo function. | |
err_t | ism5_wait_tx_finish (ism5_t *ctx, uint32_t timeout) |
ISM 5 wait tx finish function. | |
err_t | ism5_transmit_packet (ism5_t *ctx, uint8_t channel, uint8_t *data_in, uint8_t len) |
ISM 5 transmit packet function. | |
err_t | ism5_receive_packet (ism5_t *ctx, uint8_t channel, uint8_t *data_out, uint8_t *len, uint32_t timeout) |
ISM 5 receive packet function. | |
API for configuring and manipulating ISM 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void ism5_cfg_setup | ( | ism5_cfg_t * | cfg | ) |
ISM 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ism5_cfg_t object definition for detailed explanation. |
err_t ism5_change_state | ( | ism5_t * | ctx, |
uint8_t | state ) |
ISM 5 change state function.
This function sets the device state.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | state | : Device operating state. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_check_communication | ( | ism5_t * | ctx | ) |
ISM 5 check communication function.
This function checks the communication by reading and verifying the device part ID.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ism5_check_ready | ( | ism5_t * | ctx | ) |
ISM 5 check ready function.
This function checks the device ready by reading a CTS byte response.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ism5_config_init | ( | ism5_t * | ctx | ) |
ISM 5 config init function.
This function loads all properties and commands from RADIO_CONFIGURATION_DATA_ARRAY macro.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_default_cfg | ( | ism5_t * | ctx | ) |
ISM 5 default configuration function.
This function executes a default configuration of ISM 5 click board.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void ism5_disable_device | ( | ism5_t * | ctx | ) |
ISM 5 disable device function.
This function disables the device by setting the SHD pin to LOW logic state.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
void ism5_enable_device | ( | ism5_t * | ctx | ) |
ISM 5 enable device function.
This function enables the device by setting the SHD pin to HIGH logic state.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
err_t ism5_fifo_info | ( | ism5_t * | ctx, |
uint8_t | fifo_reset, | ||
uint8_t * | rx_fifo_count, | ||
uint8_t * | tx_fifo_space ) |
ISM 5 fifo info function.
This function reads the RX FIFO count and TX FIFO space and clears the FIFO buffers if needed.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | fifo_reset | : FIFO reset bits (Required). |
[out] | rx_fifo_count | : Number of data bytes available in RX FIFO buffer (Optional). |
[out] | tx_fifo_space | : Number of data bytes available in TX FIFO buffer (Optional). |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_get_device_state | ( | ism5_t * | ctx, |
uint8_t * | state, | ||
uint8_t * | channel ) |
ISM 5 get device state function.
This function reads the device current state and tuned channel.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[out] | state | : Device current state (Optional). |
[out] | channel | : Device current tuned channel (Optional). |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. uint8_t ism5_get_int_pin | ( | ism5_t * | ctx | ) |
ISM 5 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
err_t ism5_get_int_status | ( | ism5_t * | ctx, |
ism5_int_status_t * | status ) |
ISM 5 get int status function.
This function reads and clears the interrupt status.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[out] | status | : Interrupt status object read (Optional). See ism5_int_status_t object definition for detailed explanation. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_get_part_info | ( | ism5_t * | ctx, |
ism5_part_info_t * | part_info ) |
ISM 5 get part info function.
This function reads the device part information.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[out] | part_info | : Device part information read. See ism5_part_info_t object definition for detailed explanation. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_get_property | ( | ism5_t * | ctx, |
uint16_t | prop_idx, | ||
uint8_t * | data_out, | ||
uint8_t | num_props ) |
ISM 5 get property function.
This function gets a desired number of properties starting from the selected property index.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | prop_idx | : Starting property index (property group as MSB and sub-property address as LSB). |
[out] | data_out | : Property data read. |
[in] | num_props | : Number of properties to be read [1-16]. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_get_property_byte | ( | ism5_t * | ctx, |
uint16_t | prop_idx, | ||
uint8_t * | data_out ) |
ISM 5 get property byte function.
This function gets the selected property data.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | prop_idx | : Property index (property group as MSB and sub-property address as LSB). |
[out] | data_out | : Property data read. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_gpio_config | ( | ism5_t * | ctx, |
ism5_gpio_config_t * | gpio_cfg ) |
ISM 5 gpio config function.
This function writes the selected gpio config and reads their state as a response.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in,out] | gpio_cfg | : GPIO config structure. See ism5_gpio_config_t object definition for detailed explanation. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_init | ( | ism5_t * | ctx, |
ism5_cfg_t * | cfg ) |
ISM 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ism5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ism5_power_up | ( | ism5_t * | ctx | ) |
ISM 5 power up function.
This function powers up device in normal operation mode with 26 MHz external oscillator.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_read_fast_cmd | ( | ism5_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
ISM 5 read fast cmd function.
This function reads command response which doesn't contain a CTS byte (RX fifo for example).
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | cmd | : Command byte to send. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ism5_read_rsp | ( | ism5_t * | ctx, |
uint8_t * | data_out, | ||
uint8_t | len ) |
ISM 5 read resp function.
This function reads a response to the last command by using SPI serial interface.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ism5_read_rx_fifo | ( | ism5_t * | ctx, |
uint8_t * | data_out, | ||
uint8_t | len ) |
ISM 5 read rx fifo function.
This function reads data from the RX FIFO buffer.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[out] | data_out | : Output data read. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_receive_packet | ( | ism5_t * | ctx, |
uint8_t | channel, | ||
uint8_t * | data_out, | ||
uint8_t * | len, | ||
uint32_t | timeout ) |
ISM 5 receive packet function.
This function waits for a data packet to arrive on the selected channel and reads it.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | channel | : Channel number on which to receive data (Required). |
[out] | data_out | : Received data (Required). |
[out] | len | : Number of data bytes that were available in RX FIFO (Optional). |
[in] | timeout | : Waiting timeout in milliseconds (Required). |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_send_cmd | ( | ism5_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
ISM 5 send cmd function.
This function waits for the device ready and sends a desired command by using SPI serial interface.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | cmd | : Command byte to send (Required). |
[in] | data_in | : Data to be written (Optional). |
[in] | len | : Number of bytes to be written (Optional). |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_send_fast_cmd | ( | ism5_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
ISM 5 send fast cmd function.
This function sends a desired command without waiting for device ready (CTS byte).
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | cmd | : Command byte to send. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ism5_set_property | ( | ism5_t * | ctx, |
uint16_t | prop_idx, | ||
uint8_t * | data_in, | ||
uint8_t | num_props ) |
ISM 5 set property function.
This function sets a desired number of properties starting from the selected property index.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | prop_idx | : Starting property index (property group as MSB and sub-property address as LSB). |
[in] | data_in | : Property data to be written. |
[in] | num_props | : Number of properties to be written [1-12]. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_set_property_byte | ( | ism5_t * | ctx, |
uint16_t | prop_idx, | ||
uint8_t | data_in ) |
ISM 5 set property byte function.
This function sets the selected property data.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | prop_idx | : Property index (property group as MSB and sub-property address as LSB). |
[in] | data_in | : Property data to be written. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_start_rx | ( | ism5_t * | ctx, |
uint8_t | channel, | ||
uint8_t | condition, | ||
uint16_t | len ) |
ISM 5 start rx function.
This function starts the reception on the selected channel.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | channel | : Channel number on which to receive data. |
[in] | condition | : Condition byte (update rx parameters, start delay). |
[in] | len | : Number of data bytes to receive (0 for a fixed packet length). |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_start_tx | ( | ism5_t * | ctx, |
uint8_t | channel, | ||
uint8_t | condition, | ||
uint16_t | len ) |
ISM 5 start tx function.
This function starts the transmission on the selected channel.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | channel | : Channel number on which to transmit data. |
[in] | condition | : Condition byte (tx complete state, update tx parameters, retransmit, start delay). |
[in] | len | : Number of data bytes to transmit (0 for a fixed packet length). |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_transmit_packet | ( | ism5_t * | ctx, |
uint8_t | channel, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
ISM 5 transmit packet function.
This function transmits a desired data packet on the selected channel.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | channel | : Channel number on which to transmit data. |
[in] | data_in | : Data to be transmitted. |
[in] | len | : Number of data bytes to transmit (up to 64 bytes). |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_wait_ready | ( | ism5_t * | ctx | ) |
ISM 5 wait ready function.
This function waits up to 5 seconds for a CTS byte ready response.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
0
- Success, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_wait_tx_finish | ( | ism5_t * | ctx, |
uint32_t | timeout ) |
ISM 5 wait tx finish function.
This function waits for the device to exits TX state after transmission.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | timeout | : Waiting timeout in milliseconds (scaled to 100ms). |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation. err_t ism5_write_tx_fifo | ( | ism5_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t | len ) |
ISM 5 write tx fifo function.
This function writes data to the TX FIFO buffer.
[in] | ctx | : Click context object. See ism5_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of data bytes. |
0
- Success, -1
- Error, -2
- Timeout. See #err_t definition for detailed explanation.