42#define CHIP_NAME "Nuvoton ISD17XX"
43#define MANUFACTURER_NAME "Nuvoton"
44#define SUPPLY_VOLTAGE_MIN 2.4f
45#define SUPPLY_VOLTAGE_MAX 5.5f
46#define MAX_CURRENT 20.0f
47#define TEMPERATURE_MIN -40.0f
48#define TEMPERATURE_MAX 85.0f
49#define DRIVER_VERSION 1000
54#define ISD17XX_COMMAND_PU 0x01
55#define ISD17XX_COMMAND_STOP 0x02
56#define ISD17XX_COMMAND_RESET 0x03
57#define ISD17XX_COMMAND_CLR_INT 0x04
58#define ISD17XX_COMMAND_RD_STATUS 0x05
59#define ISD17XX_COMMAND_RD_PLAY_PTR 0x06
60#define ISD17XX_COMMAND_PD 0x07
61#define ISD17XX_COMMAND_RD_REC_PTR 0x08
62#define ISD17XX_COMMAND_DEVID 0x09
63#define ISD17XX_COMMAND_PLAY 0x40
64#define ISD17XX_COMMAND_REC 0x41
65#define ISD17XX_COMMAND_ERASE 0x42
66#define ISD17XX_COMMAND_G_ERASE 0x43
67#define ISD17XX_COMMAND_RD_APC 0x44
68#define ISD17XX_COMMAND_WR_APC1 0x45
69#define ISD17XX_COMMAND_WR_APC2 0x65
70#define ISD17XX_COMMAND_WR_NVCFG 0x46
71#define ISD17XX_COMMAND_LD_NVCFG 0x47
72#define ISD17XX_COMMAND_FWD 0x48
73#define ISD17XX_COMMAND_CHK_MEM 0x49
74#define ISD17XX_COMMAND_EXTCLK 0x4A
75#define ISD17XX_COMMAND_SET_PLAY 0x80
76#define ISD17XX_COMMAND_SET_REC 0x81
77#define ISD17XX_COMMAND_SET_ERASE 0x82
85static uint8_t a_high_low_shift(uint8_t data)
89 output = (data << 4) | (data >> 4);
90 output = ((output << 2) & 0xCC) | ((output >> 2) & 0x33);
91 output = ((output << 1) & 0xAA) | ((output >> 1) & 0x55);
107static uint8_t a_isd17xx_spi_transmit(
isd17xx_handle_t *handle, uint8_t *tx, uint8_t *rx, uint16_t len)
111 for (i = 0; i < len; i++)
113 tx[i] = a_high_low_shift(tx[i]);
121 for (i = 0; i < len; i++)
123 rx[i] = a_high_low_shift(rx[i]);
140static uint8_t a_isd17xx_spi_read(
isd17xx_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
144 if (handle->
spi_read(a_high_low_shift(reg), buf, len) != 0)
149 for (i = 0; i < len; i++)
151 buf[i] = a_high_low_shift(buf[i]);
168static uint8_t a_isd17xx_spi_write(
isd17xx_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
172 for (i = 0; i < len; i++)
174 buf[i] = a_high_low_shift(buf[i]);
177 if (handle->
spi_write(a_high_low_shift(reg), buf, len) != 0)
197static uint8_t a_isd17xx_check_status(
isd17xx_handle_t *handle, uint32_t prev_ms, uint8_t check_status,
198 uint16_t status, uint32_t timeout_ms)
205 uint8_t status_buf[3];
211 if (a_isd17xx_spi_transmit(handle, buf, status_buf, 3) != 0)
213 handle->
debug_print(
"isd17xx: get status failed.\n");
219 status1 = ((uint16_t)status_buf[0]) << 8 | status_buf[1];
233 if (check_status != 0)
235 timeout = timeout_ms / 10;
242 if (a_isd17xx_spi_transmit(handle, buf, status_buf, 3) != 0)
244 handle->
debug_print(
"isd17xx: get status failed.\n");
250 status1 = ((uint16_t)status_buf[0]) << 8 | status_buf[1];
251 status2 = status_buf[2];
259 handle->
debug_print(
"isd17xx: set clear interrupt failed.\n");
265 if ((status2 & status) != 0)
317 handle->
debug_print(
"isd17xx: set power up failed.\n");
323 return a_isd17xx_check_status(handle, 100, 1,
354 handle->
debug_print(
"isd17xx: set stop failed.\n");
360 return a_isd17xx_check_status(handle, 0, 1,
391 handle->
debug_print(
"isd17xx: set reset failed.\n");
397 return a_isd17xx_check_status(handle, 100, 0, 0, 0);
427 handle->
debug_print(
"isd17xx: set clear interrupt failed.\n");
433 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
466 if (a_isd17xx_spi_transmit(handle, buf, status, 3) != 0)
468 handle->
debug_print(
"isd17xx: get status failed.\n");
474 *status1 = ((uint16_t)status[0]) << 8 | status[1];
475 *status2 = status[2];
482 handle->
debug_print(
"isd17xx: set clear interrupt failed.\n");
518 handle->
debug_print(
"isd17xx: set power down failed.\n");
556 if (a_isd17xx_spi_transmit(handle, buf, status, 3) != 0)
558 handle->
debug_print(
"isd17xx: get device id failed.\n");
564 *
id = (status[2] >> 3) & 0xFF;
566 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
596 handle->
debug_print(
"isd17xx: set play failed.\n");
634 handle->
debug_print(
"isd17xx: set record failed.\n");
672 handle->
debug_print(
"isd17xx: set erase failed.\n");
710 handle->
debug_print(
"isd17xx: set global erase failed.\n");
748 handle->
debug_print(
"isd17xx: set next failed.\n");
786 handle->
debug_print(
"isd17xx: set check memory failed.\n");
792 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
825 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
827 handle->
debug_print(
"isd17xx: read play point failed.\n");
833 *point = (uint16_t)(data[3] & 0x7) << 8 | data[2];
835 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
868 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
870 handle->
debug_print(
"isd17xx: read record point failed.\n");
876 *point = (uint16_t)(data[3] & 0x7) << 8 | data[2];
878 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
920 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
922 handle->
debug_print(
"isd17xx: read config failed.\n");
926 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
931 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
942 buf[1] = config & 0xFF;
943 buf[2] = ((uint16_t)config >> 8) & 0xFF;
944 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
946 handle->
debug_print(
"isd17xx: write config failed.\n");
951 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
984 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
986 handle->
debug_print(
"isd17xx: read config failed.\n");
990 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
993 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1026 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1028 handle->
debug_print(
"isd17xx: read config failed.\n");
1032 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1037 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1038 config &= ~(1 << 3);
1039 config |= enable << 3;
1048 buf[1] = config & 0xFF;
1049 buf[2] = (config >> 8) & 0xFF;
1050 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
1052 handle->
debug_print(
"isd17xx: write config failed.\n");
1057 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1090 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1092 handle->
debug_print(
"isd17xx: read config failed.\n");
1096 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1099 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1132 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1134 handle->
debug_print(
"isd17xx: read config failed.\n");
1138 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1143 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1144 config &= ~(1 << 4);
1145 config |= enable << 4;
1154 buf[1] = config & 0xFF;
1155 buf[2] = (config >> 8) & 0xFF;
1156 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
1158 handle->
debug_print(
"isd17xx: write config failed.\n");
1163 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1196 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1198 handle->
debug_print(
"isd17xx: read config failed.\n");
1202 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1205 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1238 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1240 handle->
debug_print(
"isd17xx: read config failed.\n");
1244 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1249 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1250 config &= ~(1 << 5);
1251 config |= (!enable) << 5;
1260 buf[1] = config & 0xFF;
1261 buf[2] = (config >> 8) & 0xFF;
1262 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
1264 handle->
debug_print(
"isd17xx: write config failed.\n");
1269 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1302 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1304 handle->
debug_print(
"isd17xx: read config failed.\n");
1308 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1311 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1344 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1346 handle->
debug_print(
"isd17xx: read config failed.\n");
1350 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1355 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1356 config &= ~(1 << 6);
1357 config |= (!enable) << 6;
1366 buf[1] = config & 0xFF;
1367 buf[2] = (config >> 8) & 0xFF;
1368 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
1370 handle->
debug_print(
"isd17xx: write config failed.\n");
1375 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1408 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1410 handle->
debug_print(
"isd17xx: read config failed.\n");
1414 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1417 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1450 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1452 handle->
debug_print(
"isd17xx: read config failed.\n");
1456 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1461 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1462 config &= ~(1 << 7);
1463 config |= output << 7;
1472 buf[1] = config & 0xFF;
1473 buf[2] = (config >> 8) & 0xFF;
1474 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
1476 handle->
debug_print(
"isd17xx: write config failed.\n");
1481 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1514 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1516 handle->
debug_print(
"isd17xx: read config failed.\n");
1520 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1523 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1556 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1558 handle->
debug_print(
"isd17xx: read config failed.\n");
1562 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1567 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1568 config &= ~((uint16_t)1 << 8);
1569 config |= (!enable) << 8;
1578 buf[1] = config & 0xFF;
1579 buf[2] = (config >> 8) & 0xFF;
1580 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
1582 handle->
debug_print(
"isd17xx: write config failed.\n");
1587 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1620 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1622 handle->
debug_print(
"isd17xx: read config failed.\n");
1626 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1629 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1662 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1664 handle->
debug_print(
"isd17xx: read config failed.\n");
1668 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1673 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1674 config &= ~((uint16_t)1 << 9);
1675 config |= (!enable) << 9;
1684 buf[1] = config & 0xFF;
1685 buf[2] = (config >> 8) & 0xFF;
1686 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
1688 handle->
debug_print(
"isd17xx: write config failed.\n");
1693 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1726 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1728 handle->
debug_print(
"isd17xx: read config failed.\n");
1732 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1735 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1768 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1770 handle->
debug_print(
"isd17xx: read config failed.\n");
1774 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1779 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1780 config &= ~((uint16_t)1 << 10);
1781 config |= (!enable) << 10;
1790 buf[1] = config & 0xFF;
1791 buf[2] = (config >> 8) & 0xFF;
1792 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
1794 handle->
debug_print(
"isd17xx: write config failed.\n");
1799 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1832 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1834 handle->
debug_print(
"isd17xx: read config failed.\n");
1838 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1841 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1874 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1876 handle->
debug_print(
"isd17xx: read config failed.\n");
1880 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1885 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1886 config &= ~((uint16_t)1 << 11);
1887 config |= enable << 11;
1896 buf[1] = config & 0xFF;
1897 buf[2] = (config >> 8) & 0xFF;
1898 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
1900 handle->
debug_print(
"isd17xx: write config failed.\n");
1905 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1938 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1940 handle->
debug_print(
"isd17xx: read config failed.\n");
1944 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
1947 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
1980 if (a_isd17xx_spi_transmit(handle, buf, data, 4) != 0)
1982 handle->
debug_print(
"isd17xx: read config failed.\n");
1986 if (a_isd17xx_check_status(handle, 0, 0, 0, 0) != 0)
1991 config = (uint16_t)(data[3] & 0xF) << 8 | data[2];
2001 buf[1] = config & 0xFF;
2002 buf[2] = (config >> 8) & 0xFF;
2003 if (a_isd17xx_spi_transmit(handle, buf, data, 3) != 0)
2005 handle->
debug_print(
"isd17xx: write config failed.\n");
2010 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
2036 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
2065 handle->
debug_print(
"isd17xx: set write to nvc failed.\n");
2070 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
2099 handle->
debug_print(
"isd17xx: set load from nvc failed.\n");
2104 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
2133 if (start_addr >= end_addr)
2135 handle->
debug_print(
"isd17xx: start_addr >= end_addr.\n");
2141 handle->
debug_print(
"isd17xx: address is invalid.\n");
2147 buf[1] = start_addr & 0xFF;
2148 buf[2] = (start_addr >> 8) & 0x07;
2149 buf[3] = end_addr & 0xFF;
2150 buf[4] = (end_addr >> 8) & 0x07;
2154 handle->
debug_print(
"isd17xx: set play failed.\n");
2189 if (start_addr >= end_addr)
2191 handle->
debug_print(
"isd17xx: start_addr >= end_addr.\n");
2197 handle->
debug_print(
"isd17xx: address is invalid.\n");
2203 buf[1] = start_addr & 0xFF;
2204 buf[2] = (start_addr >> 8) & 0x07;
2205 buf[3] = end_addr & 0xFF;
2206 buf[4] = (end_addr >> 8) & 0x07;
2210 handle->
debug_print(
"isd17xx: set record failed.\n");
2245 if (start_addr >= end_addr)
2247 handle->
debug_print(
"isd17xx: start_addr >= end_addr.\n");
2253 handle->
debug_print(
"isd17xx: address is invalid.\n");
2259 buf[1] = start_addr & 0xFF;
2260 buf[2] = (start_addr >> 8) & 0x07;
2261 buf[3] = end_addr & 0xFF;
2262 buf[4] = (end_addr >> 8) & 0x07;
2266 handle->
debug_print(
"isd17xx: set erase failed.\n");
2301 handle->
debug_print(
"isd17xx: set toggle failed.\n");
2306 return a_isd17xx_check_status(handle, 0, 0, 0, 0);
2341 handle->
debug_print(
"isd17xx: spi_init is null.\n");
2347 handle->
debug_print(
"isd17xx: spi_deinit is null.\n");
2353 handle->
debug_print(
"isd17xx: spi_read is null.\n");
2359 handle->
debug_print(
"isd17xx: spi_write is null.\n");
2365 handle->
debug_print(
"isd17xx: spi_transmit is null.\n");
2371 handle->
debug_print(
"isd17xx: gpio_reset_init is null.\n");
2377 handle->
debug_print(
"isd17xx: gpio_reset_deinit is null.\n");
2383 handle->
debug_print(
"isd17xx: gpio_reset_write is null.\n");
2389 handle->
debug_print(
"isd17xx: delay_ms is null.\n");
2396 handle->
debug_print(
"isd17xx: spi init failed.\n");
2402 handle->
debug_print(
"isd17xx: gpio init failed.\n");
2417 handle->
debug_print(
"isd17xx: set power up failed.\n");
2423 if (a_isd17xx_check_status(handle, 100, 1,
2435 if (a_isd17xx_spi_transmit(handle, buf, status, 3) != 0)
2437 handle->
debug_print(
"isd17xx: get device id failed.\n");
2443 id = (status[2] >> 3) & 0xFF;
2444 if (
id != handle->
type)
2446 handle->
debug_print(
"isd17xx: chip type is invalid.\n");
2453 switch (handle->
type)
2533 handle->
debug_print(
"isd17xx: set reset failed.\n");
2539 if (a_isd17xx_check_status(handle, 100, 0, 0, 0) != 0)
2579 handle->
debug_print(
"isd17xx: set power down failed.\n");
2585 handle->
debug_print(
"isd17xx: spi deinit failed.\n");
2591 handle->
debug_print(
"isd17xx: gpio deinit failed.\n");
2658 handle->
debug_print(
"isd17xx: get status failed.\n");
2665 handle->
debug_print(
"isd17xx: set clear interrupt failed.\n");
2704 handle->
type = type;
2754 return a_isd17xx_spi_write(handle, cmd, buf, len);
2781 return a_isd17xx_spi_read(handle, cmd, buf, len);
#define ISD17XX_COMMAND_RD_REC_PTR
#define ISD17XX_COMMAND_G_ERASE
#define ISD17XX_COMMAND_RD_STATUS
#define ISD17XX_COMMAND_ERASE
#define ISD17XX_COMMAND_PU
chip command definition
#define ISD17XX_COMMAND_RESET
#define ISD17XX_COMMAND_WR_NVCFG
#define ISD17XX_COMMAND_RD_PLAY_PTR
#define ISD17XX_COMMAND_SET_ERASE
#define ISD17XX_COMMAND_SET_PLAY
#define SUPPLY_VOLTAGE_MAX
#define ISD17XX_COMMAND_LD_NVCFG
#define ISD17XX_COMMAND_CHK_MEM
#define ISD17XX_COMMAND_FWD
#define ISD17XX_COMMAND_DEVID
#define ISD17XX_COMMAND_CLR_INT
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define ISD17XX_COMMAND_PLAY
#define ISD17XX_COMMAND_EXTCLK
#define ISD17XX_COMMAND_PD
#define ISD17XX_COMMAND_WR_APC1
#define CHIP_NAME
chip information definition
#define ISD17XX_COMMAND_STOP
#define ISD17XX_COMMAND_REC
#define ISD17XX_COMMAND_SET_REC
#define ISD17XX_COMMAND_RD_APC
#define ISD17XX_COMMAND_WR_APC2
driver isd17xx header file
uint8_t isd17xx_global_erase(isd17xx_handle_t *handle)
global erase
uint8_t isd17xx_reset(isd17xx_handle_t *handle)
reset
uint8_t isd17xx_set_record(isd17xx_handle_t *handle, uint16_t start_addr, uint16_t end_addr)
set the record point
uint8_t isd17xx_info(isd17xx_info_t *info)
get chip's information
isd17xx_bool_t
isd17xx bool enumeration definition
uint8_t isd17xx_toggle_extern_clock(isd17xx_handle_t *handle)
toggle the enable and disable of the external clock
uint8_t isd17xx_set_mix_input(isd17xx_handle_t *handle, isd17xx_bool_t enable)
enable or disable the mix input
uint8_t isd17xx_set_spi_ft(isd17xx_handle_t *handle, isd17xx_bool_t enable)
enable or disable spi ft
uint8_t isd17xx_power_up(isd17xx_handle_t *handle)
power up
uint8_t isd17xx_read_play_point(isd17xx_handle_t *handle, uint16_t *point)
read the play point
uint8_t isd17xx_irq_handler(isd17xx_handle_t *handle)
irq handler
uint8_t isd17xx_get_sound_effect_editing(isd17xx_handle_t *handle, isd17xx_bool_t *enable)
get the sound effect editing status
uint8_t isd17xx_set_volume(isd17xx_handle_t *handle, uint8_t vol)
set the volume
uint8_t isd17xx_get_volume(isd17xx_handle_t *handle, uint8_t *vol)
get the volume
uint8_t isd17xx_set_type(isd17xx_handle_t *handle, isd17xx_type_t type)
set the chip type
uint8_t isd17xx_get_mix_input(isd17xx_handle_t *handle, isd17xx_bool_t *enable)
get the mix input status
uint8_t isd17xx_get_power_up_analog_output(isd17xx_handle_t *handle, isd17xx_bool_t *enable)
get the power up analog output status
uint8_t isd17xx_get_spi_ft(isd17xx_handle_t *handle, isd17xx_bool_t *enable)
get the spi ft status
uint8_t isd17xx_set_sound_effect_editing(isd17xx_handle_t *handle, isd17xx_bool_t enable)
enable or disable sound effect editing
uint8_t isd17xx_next(isd17xx_handle_t *handle)
next
uint8_t isd17xx_get_status(isd17xx_handle_t *handle, uint16_t *status1, uint8_t *status2)
get the status
uint8_t isd17xx_get_v_alert(isd17xx_handle_t *handle, isd17xx_bool_t *enable)
get the v alert status
uint8_t isd17xx_get_type(isd17xx_handle_t *handle, isd17xx_type_t *type)
get the chip type
uint8_t isd17xx_set_erase(isd17xx_handle_t *handle, uint16_t start_addr, uint16_t end_addr)
set the erase point
uint8_t isd17xx_hardware_reset(isd17xx_handle_t *handle)
hardware reset
uint8_t isd17xx_set_play(isd17xx_handle_t *handle, uint16_t start_addr, uint16_t end_addr)
set the play point
uint8_t isd17xx_clear_interrupt(isd17xx_handle_t *handle)
clear interrupt
uint8_t isd17xx_stop(isd17xx_handle_t *handle)
stop
uint8_t isd17xx_record(isd17xx_handle_t *handle)
record
uint8_t isd17xx_power_down(isd17xx_handle_t *handle)
power down
isd17xx_vol_control_t
isd17xx vol control enumeration definition
uint8_t isd17xx_write_to_nv(isd17xx_handle_t *handle)
write config to non volatile memory
uint8_t isd17xx_set_power_up_analog_output(isd17xx_handle_t *handle, isd17xx_bool_t enable)
enable or disable power up analog output
uint8_t isd17xx_get_analog_output(isd17xx_handle_t *handle, isd17xx_analog_output_t *output)
get the analog output type
uint8_t isd17xx_get_device_id(isd17xx_handle_t *handle, uint8_t *id)
get the device id
uint8_t isd17xx_init(isd17xx_handle_t *handle)
initialize the chip
uint8_t isd17xx_read_record_point(isd17xx_handle_t *handle, uint16_t *point)
read the record point
uint8_t isd17xx_check_memory(isd17xx_handle_t *handle)
check memory
uint8_t isd17xx_set_analog_output(isd17xx_handle_t *handle, isd17xx_analog_output_t output)
set the analog output type
struct isd17xx_info_s isd17xx_info_t
isd17xx information structure definition
uint8_t isd17xx_set_v_alert(isd17xx_handle_t *handle, isd17xx_bool_t enable)
enable or disable v alert
uint8_t isd17xx_erase(isd17xx_handle_t *handle)
erase
uint8_t isd17xx_set_monitor_input(isd17xx_handle_t *handle, isd17xx_bool_t enable)
enable or disable the monitor input
uint8_t isd17xx_get_pwm_speaker(isd17xx_handle_t *handle, isd17xx_bool_t *enable)
get the pwm speaker status
uint8_t isd17xx_load_from_nv(isd17xx_handle_t *handle)
load config from non volatile memory
uint8_t isd17xx_get_eom(isd17xx_handle_t *handle, isd17xx_bool_t *enable)
get the eom status
uint8_t isd17xx_set_pwm_speaker(isd17xx_handle_t *handle, isd17xx_bool_t enable)
enable or disable pwm speaker
uint8_t isd17xx_get_volume_control(isd17xx_handle_t *handle, isd17xx_vol_control_t *control)
get the volume control type
struct isd17xx_handle_s isd17xx_handle_t
isd17xx handle structure definition
uint8_t isd17xx_set_eom(isd17xx_handle_t *handle, isd17xx_bool_t enable)
enable or disable eom stop playing
uint8_t isd17xx_set_volume_control(isd17xx_handle_t *handle, isd17xx_vol_control_t control)
set the volume control type
isd17xx_type_t
isd17xx type enumeration definition
uint8_t isd17xx_get_monitor_input(isd17xx_handle_t *handle, isd17xx_bool_t *enable)
get the monitor input status
isd17xx_analog_output_t
isd17xx analog output enumeration definition
uint8_t isd17xx_deinit(isd17xx_handle_t *handle)
close the chip
uint8_t isd17xx_play(isd17xx_handle_t *handle)
play
@ ISD17XX_VOL_CONTROL_REG
@ ISD17XX_VOL_CONTROL_BUTTON
@ ISD17XX_STATUS1_CMD_ERR
uint8_t isd17xx_get_reg(isd17xx_handle_t *handle, uint8_t cmd, uint8_t *buf, uint16_t len)
get the chip register
uint8_t isd17xx_set_reg(isd17xx_handle_t *handle, uint8_t cmd, uint8_t *buf, uint16_t len)
set the chip register
uint8_t(* gpio_reset_deinit)(void)
uint8_t(* spi_init)(void)
void(* delay_ms)(uint32_t ms)
uint8_t(* spi_read)(uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* spi_write)(uint8_t reg, uint8_t *buf, uint16_t len)
void(* debug_print)(const char *const fmt,...)
void(* receive_callback)(uint16_t type)
uint8_t(* spi_transmit)(uint8_t *tx, uint8_t *rx, uint16_t len)
uint8_t(* spi_deinit)(void)
uint8_t(* gpio_reset_write)(uint8_t level)
uint8_t(* gpio_reset_init)(void)
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v