ism5 2.1.0.0
ISM 5 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ ism5_cfg_setup()

void ism5_cfg_setup ( ism5_cfg_t * cfg)

ISM 5 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ism5_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ism5_change_state()

err_t ism5_change_state ( ism5_t * ctx,
uint8_t state )

ISM 5 change state function.

This function sets the device state.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
[in]state: Device operating state.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_check_communication()

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.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_check_ready()

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.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_config_init()

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.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_default_cfg()

err_t ism5_default_cfg ( ism5_t * ctx)

ISM 5 default configuration function.

This function executes a default configuration of ISM 5 click board.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ ism5_disable_device()

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.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ism5_enable_device()

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.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ism5_fifo_info()

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.

Parameters
[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).
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_get_device_state()

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.

Parameters
[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).
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_get_int_pin()

uint8_t ism5_get_int_pin ( ism5_t * ctx)

ISM 5 get int pin function.

This function returns the INT pin logic state.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ism5_get_int_status()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_get_part_info()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_get_property()

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.

Parameters
[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].
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_get_property_byte()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_gpio_config()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_power_up()

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.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_read_fast_cmd()

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).

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_read_rsp()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_read_rx_fifo()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_receive_packet()

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.

Parameters
[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).
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_send_cmd()

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.

Parameters
[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).
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_send_fast_cmd()

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).

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_set_property()

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.

Parameters
[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].
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_set_property_byte()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_start_rx()

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.

Parameters
[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).
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_start_tx()

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.

Parameters
[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).
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_transmit_packet()

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.

Parameters
[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).
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_wait_ready()

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.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_wait_tx_finish()

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.

Parameters
[in]ctx: Click context object. See ism5_t object definition for detailed explanation.
[in]timeout: Waiting timeout in milliseconds (scaled to 100ms).
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.

◆ ism5_write_tx_fifo()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Timeout. See #err_t definition for detailed explanation.
Note
None.