smartmic 2.0.0.0
|
API for configuring and manipulating Smart Mic Click driver. More...
Topics | |
Smart Mic Registers List | |
List of registers of Smart Mic Click driver. | |
Smart Mic Registers Settings | |
Settings for registers of Smart Mic Click driver. | |
Smart Mic MikroBUS Map | |
MikroBUS pin mapping of Smart Mic Click driver. | |
Functions | |
void | smartmic_cfg_setup (smartmic_cfg_t *cfg) |
Smart Mic configuration object setup function. | |
err_t | smartmic_init (smartmic_t *ctx, smartmic_cfg_t *cfg) |
Smart Mic initialization function. | |
err_t | smartmic_default_cfg (smartmic_t *ctx) |
Smart Mic default configuration function. | |
err_t | smartmic_write_data (smartmic_t *ctx, uint8_t *data_in, uint16_t len) |
Smart Mic write data function. | |
err_t | smartmic_read_data (smartmic_t *ctx, uint8_t *data_out, uint16_t len) |
Smart Mic read data function. | |
err_t | smartmic_send_command (smartmic_t *ctx, uint16_t cmd, uint16_t data_in, uint16_t *response) |
Smart Mic send command function. | |
err_t | smartmic_download_bin (smartmic_t *ctx, uint8_t *data_in, uint32_t len) |
Smart Mic download bin function. | |
err_t | smartmic_download_config (smartmic_t *ctx) |
Smart Mic download config function. | |
err_t | smartmic_download_firmware (smartmic_t *ctx) |
Smart Mic download firmware function. | |
err_t | smartmic_download_keyword (smartmic_t *ctx, uint16_t *data_in, uint16_t len) |
Smart Mic download keyword function. | |
err_t | smartmic_voice_make (smartmic_t *ctx) |
Smart Mic voice make function. | |
err_t | smartmic_wait_keyword (smartmic_t *ctx) |
Smart Mic wait keyword function. | |
void | smartmic_enable_device (smartmic_t *ctx) |
Smart Mic enable device function. | |
void | smartmic_disable_device (smartmic_t *ctx) |
Smart Mic disable device function. | |
uint8_t | smartmic_get_irq_pin (smartmic_t *ctx) |
Smart Mic get irq pin function. | |
API for configuring and manipulating Smart Mic Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void smartmic_cfg_setup | ( | smartmic_cfg_t * | cfg | ) |
Smart Mic configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See smartmic_cfg_t object definition for detailed explanation. |
err_t smartmic_default_cfg | ( | smartmic_t * | ctx | ) |
Smart Mic default configuration function.
This function executes a default configuration of Smart Mic click board.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void smartmic_disable_device | ( | smartmic_t * | ctx | ) |
Smart Mic disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
err_t smartmic_download_bin | ( | smartmic_t * | ctx, |
uint8_t * | data_in, | ||
uint32_t | len ) |
Smart Mic download bin function.
This function downloads system config or firmware binary to the module.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
2
- Firmware download success (for UART communication only), 0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartmic_download_config | ( | smartmic_t * | ctx | ) |
Smart Mic download config function.
This function downloads system config to the module. The system config image must be named as smartmic_system_config.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartmic_download_firmware | ( | smartmic_t * | ctx | ) |
Smart Mic download firmware function.
This function downloads firmware to the module. The firmware image must be named as smartmic_firmware.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
2
- Firmware download success (for UART communication only), 0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartmic_download_keyword | ( | smartmic_t * | ctx, |
uint16_t * | data_in, | ||
uint16_t | len ) |
Smart Mic download keyword function.
This function downloads keyword models to the module.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
[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. void smartmic_enable_device | ( | smartmic_t * | ctx | ) |
Smart Mic enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
uint8_t smartmic_get_irq_pin | ( | smartmic_t * | ctx | ) |
Smart Mic get irq pin function.
This function returns the IRQ pin logic state.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
err_t smartmic_init | ( | smartmic_t * | ctx, |
smartmic_cfg_t * | cfg ) |
Smart Mic initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See smartmic_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartmic_read_data | ( | smartmic_t * | ctx, |
uint8_t * | data_out, | ||
uint16_t | len ) |
Smart Mic read data function.
This function reads a desired number of data bytes from the module.
[in] | ctx | : Click context object. See smartmic_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 smartmic_send_command | ( | smartmic_t * | ctx, |
uint16_t | cmd, | ||
uint16_t | data_in, | ||
uint16_t * | response ) |
Smart Mic send command function.
This function sends a command word and a data word to the module and waits for a response. If no response is expected from the module then the SMARTMIC_NO_RESPONSE_BIT bit in command word should be set.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
[in] | cmd | : Command word to send to the module. |
[in] | data_in | : Data word to send to the module. |
[out] | response | : Response word from the module in case the SMARTMIC_NO_RESPONSE_BIT is not set. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartmic_voice_make | ( | smartmic_t * | ctx | ) |
Smart Mic voice make function.
This function performs voice make feature. It stops the route, then sets digital gain to 20db, sample rate to 16K, frame size to 16 ms, and finally it selects route 6 and configures algorithm parameters.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t smartmic_wait_keyword | ( | smartmic_t * | ctx | ) |
Smart Mic wait keyword function.
This function waits for a keyword event and then reads it and returns the keyword ID number.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t smartmic_write_data | ( | smartmic_t * | ctx, |
uint8_t * | data_in, | ||
uint16_t | len ) |
Smart Mic write data function.
This function writes the specified number of data bytes to the module.
[in] | ctx | : Click context object. See smartmic_t object definition for detailed explanation. |
[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.