![]() |
LibDriver LD3320
|
driver ld3320 header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | ld3320_handle_s |
| ld3320 handle structure definition More... | |
| struct | ld3320_info_s |
| ld3320 information structure definition More... | |
Macros | |
| #define | LD3320_CYSTAL_MHZ 22.1184f /* 22.1184 MHz */ |
| ld3320 crystal frequency definition | |
| #define | DRIVER_LD3320_LINK_INIT(HANDLE, STRUCTURE) |
| initialize ld3320_handle_t structure | |
| #define | DRIVER_LD3320_LINK_SPI_INIT(HANDLE, FUC) |
| link spi_init function | |
| #define | DRIVER_LD3320_LINK_SPI_DEINIT(HANDLE, FUC) |
| link spi_deinit function | |
| #define | DRIVER_LD3320_LINK_SPI_READ_ADDRESS16(HANDLE, FUC) |
| link spi_read_address16 function | |
| #define | DRIVER_LD3320_LINK_SPI_WRITE_COMMAND(HANDLE, FUC) |
| link spi_write_cmd function | |
| #define | DRIVER_LD3320_LINK_RESET_GPIO_INIT(HANDLE, FUC) |
| link reset_gpio_init function | |
| #define | DRIVER_LD3320_LINK_RESET_GPIO_DEINIT(HANDLE, FUC) |
| link reset_gpio_deinit function | |
| #define | DRIVER_LD3320_LINK_RESET_GPIO_WRITE(HANDLE, FUC) |
| link reset_gpio_write function | |
| #define | DRIVER_LD3320_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_LD3320_LINK_DELAY_US(HANDLE, FUC) |
| link delay_us function | |
| #define | DRIVER_LD3320_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
| #define | DRIVER_LD3320_LINK_DEBUG_RECEIVE_CALLBACK(HANDLE, FUC) |
| link receive_callback function | |
| #define | DRIVER_LD3320_LINK_MP3_READ_INT(HANDLE, FUC) |
| link mp3_read_init function | |
| #define | DRIVER_LD3320_LINK_MP3_READ_DEINT(HANDLE, FUC) |
| link mp3_read_deinit function | |
| #define | DRIVER_LD3320_LINK_MP3_READ(HANDLE, FUC) |
| link mp3_read function | |
Typedefs | |
| typedef struct ld3320_handle_s | ld3320_handle_t |
| ld3320 handle structure definition | |
| typedef struct ld3320_info_s | ld3320_info_t |
| ld3320 information structure definition | |
Enumerations | |
| enum | ld3320_mode_t { LD3320_MODE_ASR = 0x01 , LD3320_MODE_MP3 = 0x02 } |
| ld3320 mode enumeration definition More... | |
| enum | ld3320_mic_gain_t { LD3320_MIC_GAIN_COMMON = 0x43 , LD3320_MIC_GAIN_NOISE = 0x2F } |
| ld3320 mic gain enumeration definition More... | |
| enum | ld3320_vad_t { LD3320_VAD_COMMON = 0x12 , LD3320_VAD_FAR = 0x0A } |
| ld3320 vad enumeration definition More... | |
| enum | ld3320_status_t { LD3320_STATUS_NONE = 0x00 , LD3320_STATUS_ASR_RUNNING = 0x01 , LD3320_STATUS_ASR_FOUND_OK = 0x02 , LD3320_STATUS_ASR_FOUND_ZERO = 0x03 , LD3320_STATUS_ASR_ERROR = 0x04 , LD3320_STATUS_MP3_RUNNING = 0x05 , LD3320_STATUS_MP3_LOAD = 0x06 , LD3320_STATUS_MP3_END = 0x07 , LD3320_STATUS_MP3_ERROR = 0x08 } |
| ld3320 asr status enumeration definition More... | |
Functions | |
| uint8_t | ld3320_info (ld3320_info_t *info) |
| get chip's information | |
| uint8_t | ld3320_irq_handler (ld3320_handle_t *handle) |
| irq handler | |
| uint8_t | ld3320_init (ld3320_handle_t *handle) |
| initialize the chip | |
| uint8_t | ld3320_deinit (ld3320_handle_t *handle) |
| deinit the chip | |
| uint8_t | ld3320_start (ld3320_handle_t *handle) |
| start the process | |
| uint8_t | ld3320_stop (ld3320_handle_t *handle) |
| stop the process | |
| uint8_t | ld3320_configure_mp3 (ld3320_handle_t *handle, char *name) |
| configure the mp3 | |
| uint8_t | ld3320_set_mode (ld3320_handle_t *handle, ld3320_mode_t mode) |
| set the chip mode | |
| uint8_t | ld3320_get_mode (ld3320_handle_t *handle, ld3320_mode_t *mode) |
| get the chip mode | |
| uint8_t | ld3320_set_key_words (ld3320_handle_t *handle, char text[50][50], uint8_t len) |
| set the key words | |
| uint8_t | ld3320_get_key_words (ld3320_handle_t *handle, char text[50][50], uint8_t *len) |
| get the key words | |
| uint8_t | ld3320_set_mic_gain (ld3320_handle_t *handle, ld3320_mic_gain_t gain) |
| set the microphone gain | |
| uint8_t | ld3320_get_mic_gain (ld3320_handle_t *handle, ld3320_mic_gain_t *gain) |
| get the microphone gain | |
| uint8_t | ld3320_set_vad (ld3320_handle_t *handle, ld3320_vad_t vad) |
| set the vad | |
| uint8_t | ld3320_get_vad (ld3320_handle_t *handle, ld3320_vad_t *vad) |
| get the vad | |
| uint8_t | ld3320_get_status (ld3320_handle_t *handle, ld3320_status_t *status) |
| get the status | |
| uint8_t | ld3320_set_speaker_volume (ld3320_handle_t *handle, uint8_t volume) |
| set the speaker volume | |
| uint8_t | ld3320_get_speaker_volume (ld3320_handle_t *handle, uint8_t *volume) |
| get the speaker volume | |
| uint8_t | ld3320_set_headset_volume (ld3320_handle_t *handle, uint8_t volume_left, uint8_t volume_right) |
| set the headset volume | |
| uint8_t | ld3320_get_headset_volume (ld3320_handle_t *handle, uint8_t *volume_left, uint8_t *volume_right) |
| get the headset volume | |
| uint8_t | ld3320_set_reg (ld3320_handle_t *handle, uint8_t reg, uint8_t data) |
| set the chip register | |
| uint8_t | ld3320_get_reg (ld3320_handle_t *handle, uint8_t reg, uint8_t *data) |
| get the chip register | |
driver ld3320 header file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2021/05/12 | 1.0 | Shifeng Li | first upload |
Definition in file driver_ld3320.h.