recnplay  2.0.0.0
Functions

Functions

void recnplay_cfg_setup (recnplay_cfg_t *cfg)
 Config Object Initialization function. More...
 
RECNPLAY_RETVAL recnplay_init (recnplay_t *ctx, recnplay_cfg_t *cfg)
 Initialization function. More...
 
void recnplay_generic_transfer (recnplay_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function. More...
 
RECNPLAY_RETVAL recplay_play_vp (recnplay_t *ctx, uint16_t index)
 Voice Prompt Play Command. More...
 
RECNPLAY_RETVAL recplay_play_vp_rn (recnplay_t *ctx, uint8_t value_rn)
 Voice Prompt @Rn Play Command. More...
 
RECNPLAY_RETVAL recplay_execute_vm (recnplay_t *ctx, uint16_t index)
 Voice Macro Execute Command. More...
 
RECNPLAY_RETVAL recplay_record_msg (recnplay_t *ctx)
 Message Record Command. More...
 
RECNPLAY_RETVAL recplay_record_msg_addr (recnplay_t *ctx, uint32_t mem_addr)
 Message Record at Address Command. More...
 
RECNPLAY_RETVAL recplay_play_msg (recnplay_t *ctx, uint32_t mem_addr, uint16_t sector_offset)
 Message Play at Address Command. More...
 
RECNPLAY_RETVAL recplay_play_silence (recnplay_t *ctx, uint8_t silence_length)
 Silence Play Command. More...
 
RECNPLAY_RETVAL recplay_stop (recnplay_t *ctx)
 Stop Command. More...
 
RECNPLAY_RETVAL recplay_erase_msg (recnplay_t *ctx, uint32_t mem_addr)
 Message Erase at Address Command. More...
 
RECNPLAY_RETVAL recplay_spi_write_pcm (recnplay_t *ctx, uint16_t *data_pcm, uint8_t num_pcm)
 PCM Data SPI Write Command. More...
 
RECNPLAY_RETVAL recplay_spi_read_pcm (recnplay_t *ctx, uint16_t *data_pcm, uint8_t num_pcm)
 PCM Data SPI Read Command. More...
 
RECNPLAY_RETVAL recplay_spi_send_cmprsd_data (recnplay_t *ctx, uint8_t *cmprsd_data, uint8_t n_data)
 SPI Send Compressed Data to Decode Command. More...
 
RECNPLAY_RETVAL recplay_spi_receive_enc_data (recnplay_t *ctx, uint8_t *encoded_data, uint8_t n_data)
 SPI Receive Encoded Data Command. More...
 
RECNPLAY_RETVAL recplay_read_status (recnplay_t *ctx, uint8_t *interr_status)
 Status Read Command. More...
 
RECNPLAY_RETVAL recplay_read_interr (recnplay_t *ctx, uint8_t *interr_status)
 Interrupt Read Command. More...
 
RECNPLAY_RETVAL recplay_read_msg_addr (recnplay_t *ctx, uint32_t *msg_addr, uint16_t *msg_length)
 Recorded Message Address Read Command. More...
 
RECNPLAY_RETVAL recplay_read_msg_length (recnplay_t *ctx, uint16_t *msg_length)
 Message Length Read Command. More...
 
RECNPLAY_RETVAL recplay_read_id (recnplay_t *ctx, recnplay_dev_id_t *dev_id_data)
 ISD3900 ID Read Command. More...
 
RECNPLAY_RETVAL recplay_dig_read (recnplay_t *ctx, uint32_t mem_addr, uint8_t *data_out, uint8_t n_data)
 Digital Read Command. More...
 
RECNPLAY_RETVAL recplay_dig_write (recnplay_t *ctx, uint32_t mem_addr, uint8_t *data_in, uint8_t n_data)
 Digital Write Command. More...
 
RECNPLAY_RETVAL recplay_erase_mem (recnplay_t *ctx, uint32_t start_addr, uint32_t end_addr)
 Memory Erase Command. More...
 
RECNPLAY_RETVAL recplay_erase_chip (recnplay_t *ctx)
 Chip Erase Command. More...
 
RECNPLAY_RETVAL recplay_pwr_up (recnplay_t *ctx)
 Power Up Command. More...
 
RECNPLAY_RETVAL recplay_pwr_down (recnplay_t *ctx)
 Power Down Command. More...
 
RECNPLAY_RETVAL recplay_set_clk_cnfg (recnplay_t *ctx, uint8_t clk_cnfg)
 Clock Configuration Set Command. More...
 
RECNPLAY_RETVAL recplay_read_clk_cnfg (recnplay_t *ctx, uint8_t *clk_cnfg)
 Clock Configuration Read Command. More...
 
RECNPLAY_RETVAL recplay_write_cnfg_reg (recnplay_t *ctx, uint8_t reg_addr, uint8_t *cnfg_data, uint8_t n_data)
 Configuration Write Command. More...
 
RECNPLAY_RETVAL recplay_read_cnfg_reg (recnplay_t *ctx, uint8_t reg_addr, uint8_t *cnfg_data, uint8_t n_data)
 Configuration Read Command. More...
 
uint8_t recplay_check_rdy (recnplay_t *ctx)
 SPI Data Transfer Status Check Command. More...
 
uint8_t recplay_check_int (recnplay_t *ctx)
 Interrupt Request Pin Check Command. More...
 
void recplay_reset (recnplay_t *ctx)
 ISD3900 Reset Command. More...
 

Detailed Description

Function Documentation

◆ recnplay_cfg_setup()

void recnplay_cfg_setup ( recnplay_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes Click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ recnplay_generic_transfer()

void recnplay_generic_transfer ( recnplay_t ctx,
uint8_t *  wr_buf,
uint16_t  wr_len,
uint8_t *  rd_buf,
uint16_t  rd_len 
)

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ recnplay_init()

RECNPLAY_RETVAL recnplay_init ( recnplay_t ctx,
recnplay_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this Click.

◆ recplay_check_int()

uint8_t recplay_check_int ( recnplay_t ctx)

Interrupt Request Pin Check Command.

Parameters
ctxClick object.
Returns
0 - Interrupt is generated, 1 - Interrupt is not generated

@description Function reports the status of the INT pin, does interrupt generated or not.

◆ recplay_check_rdy()

uint8_t recplay_check_rdy ( recnplay_t ctx)

SPI Data Transfer Status Check Command.

Parameters
ctxClick object.
Returns
1 - ISD3900 is ready for new command, 0 - ISD3900 is busy

@description Function reports the status of data transfer on the SPI interface.

◆ recplay_dig_read()

RECNPLAY_RETVAL recplay_dig_read ( recnplay_t ctx,
uint32_t  mem_addr,
uint8_t *  data_out,
uint8_t  n_data 
)

Digital Read Command.

Parameters
ctxClick object.
mem_addrMemory address
data_outMemory where data be stored
n_dataNumber of data bytes to be read
Returns
Status byte

@description Function initiates a read of flash memory from specified address. Interrupt Generation: ADDR_ERR if memory protected or RDY/BSYB violated, OVF_ERR if read past end of array.

◆ recplay_dig_write()

RECNPLAY_RETVAL recplay_dig_write ( recnplay_t ctx,
uint32_t  mem_addr,
uint8_t *  data_in,
uint8_t  n_data 
)

Digital Write Command.

Parameters
ctxClick object.
mem_addrMemory address
data_inData to be written
n_dataNumber of data bytes to be written
Returns
Status byte

@description Function initiates a write to flash memory from specified address. Interrupt Generation: ADDR_ERR if memory protected or RDY/BSYB violated, OVF_ERR if write past end of array.

◆ recplay_erase_chip()

RECNPLAY_RETVAL recplay_erase_chip ( recnplay_t ctx)

Chip Erase Command.

Parameters
ctxClick object.
Returns
Status byte

@description Function erases the entire contents of the external memory. Interrupt Generation: CMD_ERR if device is busy and cannot accept command, CMD_FIN when erase operation complete.

◆ recplay_erase_mem()

RECNPLAY_RETVAL recplay_erase_mem ( recnplay_t ctx,
uint32_t  start_addr,
uint32_t  end_addr 
)

Memory Erase Command.

Parameters
ctxClick object.
start_addrStart address
end_addrEnd address
Returns
Status byte

@description Function erases memory from sector containing Start address to sector containing End address. Interrupt Generation: ADDR_ERR if memory protected, CMD_ERR if device is busy, CMD_FIN when erase operation complete.

◆ recplay_erase_msg()

RECNPLAY_RETVAL recplay_erase_msg ( recnplay_t ctx,
uint32_t  mem_addr 
)

Message Erase at Address Command.

Parameters
ctxClick object.
mem_addrMemory location
Returns
Status byte

@description Function erases the message starting at the specified address. Interrupt Generation: CMD_ERR if not accepted, CMD_FIN when erase complete, ADDR_ERR if invalid address sent.

◆ recplay_execute_vm()

RECNPLAY_RETVAL recplay_execute_vm ( recnplay_t ctx,
uint16_t  index 
)

Voice Macro Execute Command.

Parameters
ctxClick object.
indexIndex of Voice Macro
Returns
Status byte

@description Function initiates the execution of a pre-recorded voice group. Interrupt Generation: CMD_ERR if not accepted, CMD_FIN when playback is finished.

◆ recplay_play_msg()

RECNPLAY_RETVAL recplay_play_msg ( recnplay_t ctx,
uint32_t  mem_addr,
uint16_t  sector_offset 
)

Message Play at Address Command.

Parameters
ctxClick object.
mem_addrMemory location
sector_offsetSector offset
Returns
Status byte

@description Function initiates a play of a recorded message starting at a specified address, with a specified sector offset. Interrupt Generation: CMD_ERR if not accepted, CMD_FIN when playback complete, ADDR_ERR if invalid address sent.

◆ recplay_play_silence()

RECNPLAY_RETVAL recplay_play_silence ( recnplay_t ctx,
uint8_t  silence_length 
)

Silence Play Command.

Parameters
ctxClick object.
silence_lengthSilence length * 32ms
Returns
Status byte

@description Function plays a period of silence to the signal path. Interrupt Generation: CMD_ERR if not accepted, CMD_FIN when silence playback complete.

◆ recplay_play_vp()

RECNPLAY_RETVAL recplay_play_vp ( recnplay_t ctx,
uint16_t  index 
)

Voice Prompt Play Command.

Parameters
ctxClick object.
indexIndex of Voice Prompt
Returns
Status byte

@description Function initiates a play of a pre-recorded voice prompt.

Note
Interrupt Generation: CMD_ERR if not accepted, CMD_FIN when playback is finished.

◆ recplay_play_vp_rn()

RECNPLAY_RETVAL recplay_play_vp_rn ( recnplay_t ctx,
uint8_t  value_rn 
)

Voice Prompt @Rn Play Command.

Parameters
ctxClick object.
value_rnR(n) selection from 0 to 7
Returns
Status byte

@description Function initiates a play of a pre-recorded voice prompt, but 16bit index is stored in Rn. The 16 bit value of Rn, user can find in Configuration registers from CFG20 to CFG2F. Interrupt Generation: CMD_ERR if not accepted, CMD_FIN when playback is finished.

◆ recplay_pwr_down()

RECNPLAY_RETVAL recplay_pwr_down ( recnplay_t ctx)

Power Down Command.

Parameters
ctxClick object.
Returns
Status byte

@description Function powers down the device. Interrupt Generation: This command does not generate interrupt.

◆ recplay_pwr_up()

RECNPLAY_RETVAL recplay_pwr_up ( recnplay_t ctx)

Power Up Command.

Parameters
ctxClick object.
Returns
Status byte

@description Function powers up the device. Interrupt Generation: This command does not generate interrupt.

◆ recplay_read_clk_cnfg()

RECNPLAY_RETVAL recplay_read_clk_cnfg ( recnplay_t ctx,
uint8_t *  clk_cnfg 
)

Clock Configuration Read Command.

Parameters
ctxClick object.
clk_cnfgMemory where clock configuration byte be stored
Returns
Status byte

@description Function reads the clock configuration register. Interrupt Generation: This command does not generate interrupt.

◆ recplay_read_cnfg_reg()

RECNPLAY_RETVAL recplay_read_cnfg_reg ( recnplay_t ctx,
uint8_t  reg_addr,
uint8_t *  cnfg_data,
uint8_t  n_data 
)

Configuration Read Command.

Parameters
ctxClick object.
reg_addrConfiguration register address (from 0x00 to 0x2F)
cnfg_dataMemory where configuration data be stored
n_dataNumber of data bytes to be read
Returns
Status byte

@description Function reads the configuration registers starting at the specified address. Interrupt Generation: This command does not generate interrupt.

◆ recplay_read_id()

RECNPLAY_RETVAL recplay_read_id ( recnplay_t ctx,
recnplay_dev_id_t dev_id_data 
)

ISD3900 ID Read Command.

Parameters
ctxClick object.
dev_id_dataDevice ID data object
Returns
Status byte

@description Function reads device and memory ID. Interrupt Generation: This command does not generate interrupt.

◆ recplay_read_interr()

RECNPLAY_RETVAL recplay_read_interr ( recnplay_t ctx,
uint8_t *  interr_status 
)

Interrupt Read Command.

Parameters
ctxClick object.
interr_statusMemory where interrupt status byte be stored
Returns
Status byte

@description Function queries the ISD3900 device status and clears any pending interrupts. Interrupt Generation: This command does not generate interrupt.

◆ recplay_read_msg_addr()

RECNPLAY_RETVAL recplay_read_msg_addr ( recnplay_t ctx,
uint32_t *  msg_addr,
uint16_t *  msg_length 
)

Recorded Message Address Read Command.

Parameters
ctxClick object.
msg_addrMemory where recorded message address will be stored
msg_lengthMemory where recorded message length will be stored
Returns
Status byte

@description Function reports the start address of the last or current message and message length. Interrupt Generation: This command does not generate interrupt.

◆ recplay_read_msg_length()

RECNPLAY_RETVAL recplay_read_msg_length ( recnplay_t ctx,
uint16_t *  msg_length 
)

Message Length Read Command.

Parameters
ctxClick object.
msg_lengthMemory where message length be stored
Returns
Status byte

@description Function reads number of sectors played by the last or current PLAY command. Interrupt Generation: This command does not generate interrupt.

◆ recplay_read_status()

RECNPLAY_RETVAL recplay_read_status ( recnplay_t ctx,
uint8_t *  interr_status 
)

Status Read Command.

Parameters
ctxClick object.
interr_statusMemory where interrupt status byte be stored
Returns
Status byte

@description Function queries the ISD3900 device status. Interrupt Generation: This command does not generate interrupt.

◆ recplay_record_msg()

RECNPLAY_RETVAL recplay_record_msg ( recnplay_t ctx)

Message Record Command.

Parameters
ctxClick object.
Returns
Status byte

@description Function initiates a managed record at first available location in memory. Interrupt Generation: CMD_ERR if not accepted, CMD_FIN when recording complete, FULL_ERR when device fills available memory.

◆ recplay_record_msg_addr()

RECNPLAY_RETVAL recplay_record_msg_addr ( recnplay_t ctx,
uint32_t  mem_addr 
)

Message Record at Address Command.

Parameters
ctxClick object.
mem_addrMemory location
Returns
Status byte

@description Function initiates a managed record starting at a specified address. Interrupt Generation: CMD_ERR if not accepted, CMD_FIN when recording complete, FULL_ERR when device fills available memory, ADDR_ERR if invalid address sent.

◆ recplay_reset()

void recplay_reset ( recnplay_t ctx)

ISD3900 Reset Command.

Parameters
ctxClick object.

@description Function performs the device reset and after that puts the device in normal operation mode.

◆ recplay_set_clk_cnfg()

RECNPLAY_RETVAL recplay_set_clk_cnfg ( recnplay_t ctx,
uint8_t  clk_cnfg 
)

Clock Configuration Set Command.

Parameters
clk_cnfgConfiguration byte for clock
Returns
Status byte

@description Function loads the clock configuration register. Interrupt Generation: This command does not generate interrupt.

◆ recplay_spi_read_pcm()

RECNPLAY_RETVAL recplay_spi_read_pcm ( recnplay_t ctx,
uint16_t *  data_pcm,
uint8_t  num_pcm 
)

PCM Data SPI Read Command.

Parameters
ctxClick object.
data_pcmMemory where PCM data be stored
num_pcmNumber of PCM words
Returns
Status byte

@description Function reads audio data in 16bit PCM format via SPI interface. Interrupt Generation: OVF_ERR if RDY/BSY violated.

◆ recplay_spi_receive_enc_data()

RECNPLAY_RETVAL recplay_spi_receive_enc_data ( recnplay_t ctx,
uint8_t *  encoded_data,
uint8_t  n_data 
)

SPI Receive Encoded Data Command.

Parameters
ctxClick object.
encoded_dataMemory where compressed audio data be stored
n_dataNumber of compressed data bytes
Returns
Status byte

@description Function reads compressed audio data via SPI intreface. Interrupt Generation: OVF_ERR if RDY/BSYB violated.

◆ recplay_spi_send_cmprsd_data()

RECNPLAY_RETVAL recplay_spi_send_cmprsd_data ( recnplay_t ctx,
uint8_t *  cmprsd_data,
uint8_t  n_data 
)

SPI Send Compressed Data to Decode Command.

Parameters
ctxClick object.
cmprsd_dataCompressed audio data
n_dataNumber of compressed data bytes
Returns
Status byte

@description Function writes compressed audio data via SPI interface. Interrupt Generation: OVF_ERR if RDY/BSYB violated.

◆ recplay_spi_write_pcm()

RECNPLAY_RETVAL recplay_spi_write_pcm ( recnplay_t ctx,
uint16_t *  data_pcm,
uint8_t  num_pcm 
)

PCM Data SPI Write Command.

Parameters
ctxClick object.
data_pcmAudio data in 16bit PCM format
num_pcmNumber of PCM words
Returns
Status byte

@description Function writes audio data in 16bit PCM format via SPI interface. Interrupt Generation: OVF_ERR if RDY/BSY violated.

◆ recplay_stop()

RECNPLAY_RETVAL recplay_stop ( recnplay_t ctx)

Stop Command.

Parameters
ctxClick object.
Returns
Status byte

@description Function stops any current audio command. Interrupt Generation: Command itself does not generate interrupt, only those commands that it is stopping.

◆ recplay_write_cnfg_reg()

RECNPLAY_RETVAL recplay_write_cnfg_reg ( recnplay_t ctx,
uint8_t  reg_addr,
uint8_t *  cnfg_data,
uint8_t  n_data 
)

Configuration Write Command.

Parameters
ctxClick object.
reg_addrConfiguration register address (from 0x00 to 0x2F)
cnfg_dataConfiguration data to be written
n_dataNumber of data bytes to be written
Returns
Status byte

@description Function loads configuration registers starting at the specified address. Interrupt Generation: This command does not generate interrupt.