Dialog DA16200, UM-WI-002 User Manual

User Manual
SDK Programmer Guide
UM-WI-002

Abstract

The DA16200 is a highly integrated ultra-low power Wi-Fi system on a chip (SoC) and allows users to develop the Wi-Fi solution on a single chip. This document is an SDK guide document intended for developers who want to program using the DA16200 chipset and describes the SDK API and peripheral device drivers and interfaces.
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
2 of 102
© 2021 Dialog Semiconductor

Contents

Abstract ................................................................................................................................................ 1
Contents ............................................................................................................................................... 2
Figures .................................................................................................................................................. 5
Tables ................................................................................................................................................... 6
1 References ..................................................................................................................................... 7
2 Introduction.................................................................................................................................... 8
2.1 Overview ............................................................................................................................... 8
Development Environment .............................................................................................................. 8
2.2 Startup Main() ....................................................................................................................... 9
2.3 Startup System Applications ............................................................................................... 11
2.4 Startup User Applications.................................................................................................... 13
2.5 Write User Application ......................................................................................................... 15
2.6 SDK Compilation ................................................................................................................. 18
2.7 Make 4 MB SFLASH Images .............................................................................................. 19
2.8 Make fcCSP Low-Power SLIB Image ................................................................................. 19
3 Memory Map................................................................................................................................. 20
3.1 System Memory Map .......................................................................................................... 20
3.2 Memory Types .................................................................................................................... 20
3.3 Serial Flash Memory Map ................................................................................................... 21
4 Peripheral Driver ......................................................................................................................... 23
4.1 SPI Slave ............................................................................................................................ 23
4.1.1 Introduction .......................................................................................................... 23
4.1.2 Application Programming Interface ..................................................................... 24
4.1.3 Sample Code ....................................................................................................... 24
4.2 SDIO Master ....................................................................................................................... 24
4.2.1 SDIO Introduction ................................................................................................ 24
4.2.2 Application Programming Interface ..................................................................... 24
4.2.3 Sample Code ....................................................................................................... 26
4.3 SDIO Slave ......................................................................................................................... 26
4.3.1 Introduction .......................................................................................................... 26
4.3.2 Application Programmer Interface ....................................................................... 26
4.3.3 Sample Code ....................................................................................................... 27
4.4 I2C ....................................................................................................................................... 27
4.4.1 I2C Master ........................................................................................................... 27
4.4.2 I2C Slave ............................................................................................................. 27
4.4.3 Application Programming Interface ..................................................................... 29
4.4.4 Sample Code ....................................................................................................... 30
4.5 SD/eMMC ............................................................................................................................ 30
4.5.1 Introduction .......................................................................................................... 30
4.5.2 Application Programming Interface ..................................................................... 31
4.5.3 Sample Code ....................................................................................................... 32
4.6 PWM.................................................................................................................................... 33
4.6.1 Introduction .......................................................................................................... 33
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
3 of 102
© 2021 Dialog Semiconductor
4.6.2 Application Programming Interface ..................................................................... 33
4.6.3 Sample Code ....................................................................................................... 34
4.7 ADC ..................................................................................................................................... 35
4.7.1 Introduction .......................................................................................................... 35
4.7.2 Application Programming Interface ..................................................................... 36
4.7.3 Interrupt Description ............................................................................................ 39
4.7.4 Sample Code ....................................................................................................... 40
4.8 GPIO ................................................................................................................................... 41
4.8.1 Introduction .......................................................................................................... 41
4.8.2 Application Programming Interface ..................................................................... 43
4.8.3 Sample Code ....................................................................................................... 45
4.9 UART................................................................................................................................... 45
4.9.1 Introduction .......................................................................................................... 45
4.9.2 Application Programming Interface ..................................................................... 46
4.9.3 Sample Code ....................................................................................................... 48
4.10 SPI Master .......................................................................................................................... 49
4.10.1 Introduction .......................................................................................................... 49
4.10.2 Application Programming Interface ..................................................................... 49
4.10.3 Sample Code ....................................................................................................... 51
4.11 Pulse Counter ..................................................................................................................... 51
4.11.1 Introduction .......................................................................................................... 51
4.11.2 Application Programming Interface ..................................................................... 52
5 NVRAM ......................................................................................................................................... 54
5.1 Application Programming Interface ..................................................................................... 54
6 HW Accelerators .......................................................................................................................... 55
6.1 Set SRAM to Zero ............................................................................................................... 55
6.1.1 Application Programming Interface ..................................................................... 55
6.1.2 Sample Code ....................................................................................................... 55
6.2 CRC Calculation .................................................................................................................. 55
6.2.1 Application Programming Interface ..................................................................... 55
6.2.2 Sample Code ....................................................................................................... 55
6.3 Pseudo Random Number Generator (PRNG) .................................................................... 56
6.3.1 Application Programming Interface ..................................................................... 56
6.3.2 Sample Code ....................................................................................................... 56
6.4 Memory Copy Using DMA................................................................................................... 56
6.4.1 Application Programming Interface ..................................................................... 56
6.4.2 Sample Code ....................................................................................................... 56
7 Wi-Fi Interface Configuration ..................................................................................................... 57
7.1 Application Programming Interface ..................................................................................... 57
7.1.1 Integer Type Parameters ..................................................................................... 59
7.1.2 String Type Parameters ....................................................................................... 60
7.1.3 Sample Code ....................................................................................................... 61
7.2 Soft-AP Configuration by Factory Reset ............................................................................. 62
7.2.1 Configuration Data Structure Integer Type Parameters ...................................... 63
7.2.2 How to Configure ................................................................................................. 64
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
4 of 102
© 2021 Dialog Semiconductor
7.3 Soft-AP Provisioning Protocol ............................................................................................. 65
7.3.1 Provisioning Specification .................................................................................... 65
7.3.2 User Soft-AP Provisioning Application ................................................................ 67
7.3.2.1 Example User Soft-AP Provisioning Thread ................................... 67
7.3.2.2 Example Peer (Mobile) Application ................................................. 68
8 Tx Power Table Edit .................................................................................................................... 72
8.1 Tune Tx Power .................................................................................................................... 72
8.2 Apply Tuned Tx Power to Main Image ................................................................................ 73
9 Tips ............................................................................................................................................... 74
9.1 Find/Optimize Stack Size for Your Application ................................................................... 74
9.2 Debug Stack Overflow ........................................................................................................ 75
Appendix A Open-Source License .................................................................................................. 78
Appendix B Country Code and Tx Power ....................................................................................... 79
B.1 Country Code and Channels ............................................................................................... 79
B.2 Programming ....................................................................................................................... 84
Appendix C Doxygen Documents .................................................................................................... 85
Appendix D How to use I-Jet debugger .......................................................................................... 88
D.1 Notice to Use Debugger on IAR Workbench ...................................................................... 88
D.2 I-Jet Debug Setting ............................................................................................................. 88
D.3 J-Link Debug Setting ........................................................................................................... 95
D.4 IAR build Setting ............................................................................................................... 100
Revision History .............................................................................................................................. 101
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
5 of 102
© 2021 Dialog Semiconductor

Figures

Figure 1: IAR Embedded Workbench Project Configuration ................................................................. 8
Figure 2: Update IAR Embedded Workbench ....................................................................................... 9
Figure 3: Install IAR Embedded Workbench ......................................................................................... 9
Figure 4: Checking Version of IAR Embedded Workbench .................................................................. 9
Figure 5: Startup Files on IAR Project ................................................................................................. 10
Figure 6: Application on IAR Project ................................................................................................... 12
Figure 7: Results of Running the ‘Hello World’ Applications ............................................................... 15
Figure 8: Customer Project in IAR Workbench ................................................................................... 15
Figure 9: Location of User codes ........................................................................................................ 17
Figure 10: Add User Files to the IAR Project ...................................................................................... 17
Figure 11: Compile SDK on IAR Workbench ...................................................................................... 18
Figure 12: Build Success on IAR Embedded Workbench ................................................................... 18
Figure 13: Boot Logo with fcCSP-LP SLIB Image ............................................................................... 19
Figure 14: System Memory Map ......................................................................................................... 20
Figure 15: APB and System Peripherals Memory Map ....................................................................... 21
Figure 16: PWM Block Diagram .......................................................................................................... 33
Figure 17: ADC Control Block Diagram ............................................................................................... 35
Figure 18: TX Power Table.................................................................................................................. 72
Figure 19: Tune Tx Power: Setup ....................................................................................................... 72
Figure 20: Tune Tx Power: Choose Country Code ............................................................................. 72
Figure 21: Tune Tx Power: Check Tx Power Indices .......................................................................... 72
Figure 22: Tune Tx Power: Modify Tx Power Indices ......................................................................... 73
Figure 23: TX power Table Source Code ............................................................................................ 73
Figure 24: Check Stack Size ............................................................................................................... 74
Figure 25: IAR Debug Window for Stack Overflow ............................................................................. 77
Figure 26: Doxygen Document of the DA16200 SDK ......................................................................... 87
Figure 27: Connect I-Jet Debugger to the DA16200 EVB ................................................................... 88
Figure 28: Select Debugger Option ..................................................................................................... 89
Figure 29: Debugger Setup Setting ..................................................................................................... 90
Figure 30: Debugger Download Setting .............................................................................................. 91
Figure 31: I-Jet JTAG/SWD Setting .................................................................................................... 91
Figure 32: Trace Mode Setting ............................................................................................................ 92
Figure 33: Rebuild SDK ....................................................................................................................... 92
Figure 34: Download and Debug ......................................................................................................... 93
Figure 35: Pop-up Message ................................................................................................................ 93
Figure 36: Download and Debug Windows ......................................................................................... 94
Figure 37: Break Point Window ........................................................................................................... 94
Figure 38: Connect J-Link Debugger to the DA16200 EVB ................................................................ 95
Figure 39: Select Debugger Option ..................................................................................................... 95
Figure 40: Debugger Setup Setting ..................................................................................................... 96
Figure 41: Debugger Download Setting .............................................................................................. 97
Figure 42: J-Link/J-Trace JTAG/SWD Setting..................................................................................... 97
Figure 43: Rebuild SDK ....................................................................................................................... 98
Figure 44: Download and Debug ......................................................................................................... 98
Figure 45: Pop-Up Message................................................................................................................ 99
Figure 46: Download and Debug Windows ......................................................................................... 99
Figure 47: Break Point Window ......................................................................................................... 100
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
6 of 102
© 2021 Dialog Semiconductor

Tables

Table 1: 2 MB SFLASH Map ............................................................................................................... 21
Table 2: 4 MB SFLASH Map ............................................................................................................... 22
Table 3: SPI Interface API Elements ................................................................................................... 23
Table 4: SPI Slave Interface API Elements ......................................................................................... 24
Table 5: SDIO Interface API Elements ................................................................................................ 24
Table 6: SDIO Slave Pin Configuration ............................................................................................... 26
Table 7: SDIO Interface API Elements ................................................................................................ 26
Table 8: I2C Master Pin Configuration ................................................................................................ 27
Table 9: I2C Slave Pin Configuration .................................................................................................. 28
Table 10: I2C Interface API Elements ................................................................................................. 29
Table 11: SD/eMMC Master Pin Configuration ................................................................................... 30
Table 12: SD/eMMC Interface API Elements ...................................................................................... 31
Table 13: PWM Pin Configuration ....................................................................................................... 33
Table 14: PWM Interface API Elements .............................................................................................. 33
Table 15: AUX ADC Pin Configuration ................................................................................................ 35
Table 16: ADC Interface API Elements ............................................................................................... 36
Table 17: GPIO Pin Configuration ....................................................................................................... 41
Table 18: The Status of GPIO PIN ...................................................................................................... 42
Table 19: GPIO Interface API Elements .............................................................................................. 43
Table 20: UART Pin Configuration ...................................................................................................... 45
Table 21: UART Interface API Elements ............................................................................................. 46
Table 22: SPI Master Pin Configuration .............................................................................................. 49
Table 23: SPI Interface API Elements ................................................................................................. 49
Table 24: NVRAM API Elements ......................................................................................................... 54
Table 25: Wi-Fi Configuration API ....................................................................................................... 57
Table 26: NVRAM Integer Type .......................................................................................................... 59
Table 27: NVRAM String Type ............................................................................................................ 60
Table 28: NVRAM Sample Code on STA mode.................................................................................. 61
Table 29: NVRAM Sample Code on Soft-AP Mode ............................................................................ 62
Table 30: Soft-AP Interface Code ....................................................................................................... 63
Table 31: Soft-AP Configuration Code ................................................................................................ 64
Table 32: Provisioning Protocol Code ................................................................................................. 65
Table 33: Soft-AP Provisioning Thread Sample Code (TCP Sample) ................................................ 67
Table 34: Soft-AP Provisioning Thread Sample Code for Peer Application (TCP Sample) ............... 68
Table 35: TCP Client Sample Code .................................................................................................... 74
Table 36: Corrupted Stack Overflow ................................................................................................... 75
Table 37: Force Stack Overflow .......................................................................................................... 76
Table 38: Stack Overflow Debug Code ............................................................................................... 76
Table 39: Country Code ...................................................................................................................... 79
Table 40: Programming Example for Country Code ........................................................................... 84
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
7 of 102
© 2021 Dialog Semiconductor

1 References

[1] DA16200, Datasheet, Dialog Semiconductor [2] DA16200, EVK User Manual, User Manual, Dialog Semiconductor [3] DA16200, Example Application Manual, User Manual, Dialog Semiconductor
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
8 of 102
© 2021 Dialog Semiconductor

2 Introduction

The DA16200 is a highly integrated ultra-low power Wi-Fi system on a chip (SoC) and allows users to develop a Wi-Fi solution on a single chip. The user implements their application with the DA16200 SDK and the compile environment is the IAR Embedded Workbench IDE of IAR Systems.

2.1 Overview

The DA16200 SDK has eight folders:
build: Build scripts, temporary build artifacts, or environment files
customer: IAR project files and applications for customer.
doc: user documents (user guides, programmer guides, etc.)
img: to which the images built / pre-compiled are copied
lib: to which the pre-compiled lib files (.a) are saved
sample: to demonstrate common use cases of what the DA16200 SDK provides
src: source codes
src_tim: source codes for TIM SDK
version: version files to include when Image created
The DA16200 SDK may be provided with different features per customer or per certain applications so the source code configuration and the system libraries can differ according to the customer / application requirements. Dialog Semiconductor pre-compiles the system libraries with the relevant features enabled before the SDK is packaged. As a result, the customer can modify the pre-compiled libraries. Features are defined in customer\main\inc\config_xxx_sdk.h (the file name may follow its reference type) where users can enable / disable some features.
NOTE
Not all features can be freely enabled / disabled. This depends on the pre-compiled libraries included in the SDK package. Ask Dialog Semiconductor for more details.
The typical IAR project for the DA16200 SDK is shown in Figure 1. There is the possibility to add new user application files to the existing group Customer_Apps under the cusomter_app project. There is also the possibility to create your own group, to which you can add files in the “Customer” folder.
Figure 1: IAR Embedded Workbench Project Configuration

Development Environment

The DA16200 SDK only supports the IAR Embedded Workbench to build a project. Users with an IAR license can download a specific version of IAR Embedded Workbench from the IAR website.
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
9 of 102
© 2021 Dialog Semiconductor
NOTE
Due to compiler compatibility, the DA16200 SDK user should use the exact version of IAR Embedded Workbench, which is version 7.30.4.
1. Open the URL https://www.iar.com/support/customer-care/my-pages.
2. After successful login, click on Find updates. See Figure 2.
Figure 2: Update IAR Embedded Workbench
3. Click on Other Versions to download an old installer version. See Figure 3.
Figure 3: Install IAR Embedded Workbench
4. Click on 7.30 to go to the download page. See Figure 4.
Figure 4: Checking Version of IAR Embedded Workbench
5. Choose version 7.30.4.XXX.

2.2 Startup Main()

After system reboot, the system library invokes function main(). The following steps are run:
Initialize HW resources (PIN_MUX, RTC, Console …)
Start function system_start() to run the DA16200 as Wi-Fi IoT device
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
10 of 102
© 2021 Dialog Semiconductor
Figure 5: Startup Files on IAR Project
[
~/src/main.c
]
int main(char init_state)
{ int status;
/* clear RETMEM_GPIO_PULLUP_INFO */ clear_retmem_gpio_pullup_info();
/* Configure Pin-Mux of the DA16200 */ config_pin_mux();
/* * 1. Restore saved GPIO PINs * 2. RTC PAD connection */ __GPIO_RETAIN_HIGH_RECOVERY();
/* Logo Display */ if (!get_boot_mode()) version_display(0, NULL);
/* Initialize the FC9K's Console */ if (Create_ConsoleThread() == FALSE) return FALSE;
/* Entry point for customer main */ if (init_state == TRUE) { status = system_start(); } else { PRINTF("\nFailed to initialize the RamLIB or pTIM.\n"); }
return status; }
After the basic HW resources are initialized, function system_start() is called to run the Wi-Fi operation. The following happens:
Configure H/W and S/W features
Configure system resources for system clock and TX power
Initialize Wi-Fi function in wlaninit()
Start of system-provided applications in start_sys_apps()
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
11 of 102
© 2021 Dialog Semiconductor
Start of user applications in start_user_apps()
[
~/customer/main/src/system_start.c
]
int system_start(void)
{ /* Config HW wakeup resource */ config_user_wu_hw_resource();
/* Set configuration for H/W button */ config_gpio_button();
/* Set parameters for system running */ set_sys_config();
/* Initialize WLAN interface */ wlaninit();
/* Setup WPS button */ if (check_wps_button(wps_btn, wps_led, wps_btn_chk_time) == TX_TRUE) { wps_setup(TX_NULL); }
/* Start GPIO polling thread */ start_gpio_thread();
set_dpm_abnorm_user_wakeup_interval();
/* Regist User DPM application before start system application */ regist_user_apps_to_DPM_manager();
/* Start system applications for the DA16XXX */ start_sys_apps();
/* * Entry point of user's applications *: defined in user_apps_table.c */ start_user_apps();
return TRUE; }
NOTE
The features supported in the SDK are defined in file config_xxxx_sdk.h (i.e. config_generic_sdk.h) and all features of config_xxx_sdk.h can be enabled / disabled freely.
If the user wants to change more detail features to handle delicate operations, some features in file sys_common_feature.h can be changed, but that requires the support from a support engineer of Dialog Semiconductor.

2.3 Startup System Applications

After running the main function, the DA16200 SDK runs some system provided applications and user-written applications. Each system application is started by the customer’s define features.
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
12 of 102
© 2021 Dialog Semiconductor
Figure 6: Application on IAR Project
[
~/src/sys_apps/src/sys_apps.c
]
void start_sys_apps(void)
{
/* Start user application functions */ run_sys_apps(); }
The system applications run in two parts:
Applications that should be executed regardless of network settings
Application that should be executed after the network setting is completed
static void run_sys_apps(void)
{
... ...
/* Start network independent applications */ create_sys_apps(sysmode, FALSE);
/* Start user's network independent applications */ create_user_apps(sysmode, FALSE);
... ...
/* wait for network initialization */ while (1) { if (check_net_init(iface) == TX_SUCCESS) { i = 0; break; }
i++; tx_thread_sleep(1); }
... ...
/* Check IP address status */ while (check_net_ip_status(iface)!= NX_SUCCESS) { tx_thread_sleep(1); }
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
13 of 102
© 2021 Dialog Semiconductor
/* Start network dependent applications */ create_sys_apps(sysmode, TRUE);
}
All system applications are provided in the sys_apps_table[] as shown in the example code below:
[
~/src/sys_apps/src/sys_apps.c
]
static const app_thread_info_t sys_apps_table[] =
{ /* name, func, stack_size, pri, net_flag, dpm_flag, port_no, sys_mode */
/****** For function features ***********************************/
… …
#if defined (__SUPPORT_MQTT__) { APP_MQTT_SUB, mqtt_auto_start, 1024, USER_PRI_APP(1),
TRUE, TRUE, UNDEF_PORT, RUN_STA_MODE },
#endif // __SUPPORT_MQTT__
#if defined (__HTTP_SVR_AUTO_START__) { APP_HTTP_SVR, auto_run_http_svr, 1024, USER_PRI_APP(1),
TRUE, FALSE, HTTP_SVR_PORT, RUN_AP_MODE },
#endif // __HTTP_SVR_AUTO_START__
#if defined (__HTTPS_SVR_AUTO_START__) { APP_HTTPS_SVR, auto_run_https_svr 2048, USER_PRI_APP(1),
TRUE, FALSE, HTTP_SVR_PORT, RUN_AP_MODE },
#endif // __HTTPS_SVR_AUTO_START__
#if defined (__DPM_MDNS_AUTO_START__) { APP_MDNS, thd_mdns_service, 1024, USER_PRI_APP(1),
TRUE, TRUE, MULTICAST_PORT, RUN_ALL_MODE },
#endif // __DPM_MDNS_AUTO_START__
… …
/******* End of List ********************************************/ { NULL, NULL, 0, 0, FALSE, FALSE, UNDEF_PORT, 0 }
};
NOTE
The user does not need to modify the system application tables provided in the DA16200 SDK. If the user does want to modify the system application table, then that is possible but only with the support of
a Dialog Semiconductor Engineer.

2.4 Startup User Applications

After running the main function, the DA16200 SDK can run user-written applications. The user applications also run in two parts:
Applications that should be executed regardless of network settings
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
14 of 102
© 2021 Dialog Semiconductor
[
~/src/sys_apps/src/sys_apps.c
]
static void run_sys_apps(void)
{
... ...
/* Start user's network independent applications */
create_user_apps(sysmode, FALSE);
... ...
Applications that should be executed after the network settings are completed
[
~/src/sys_apps/src/sys_apps.c
]
void start_user_apps(void)
{ int sysmode;
… …
/* Run user's network dependent apps */ create_user_apps(sysmode, TRUE);
}
All user applications can be written in the user_apps_table[] as shown in the example code below. The DA16200 SDK provides a “hello_world” application by default.
[
~/customer/apps/src/user_apps.c
]
const app_thread_info_t user_apps_table[] = {
/* name, func, stack_size, pri, net_flag, dpm_flag, port_no, sys_mode */
#if defined (__SUPPORT_HELLO_WORLD__) { HELLO_WORLD_1, customer_hello_world_1, 1024, USER_PRI_APP(0), FALSE, FALSE, UNDEF_PORT, RUN_ALL_MODE }, { HELLO_WORLD_2, customer_hello_world_2, 1024, USER_PRI_APP(0), TRUE, FALSE, UNDEF_PORT, RUN_ALL_MODE }, #endif // __SUPPORT_HELLO_WORLD__
{ NULL, NULL, 0, 0, FALSE, FALSE, UNDEF_PORT, 0 }
};
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
15 of 102
© 2021 Dialog Semiconductor
HELLO_WORLD_1 Not network-dependent, this application starts after system start
HELLO_WORLD_2 Network-dependent, this application starts after the Wi-Fi interface is up and
running
Figure 7: Results of Running the ‘Hello World Applications

2.5 Write User Application

The DA16200 SDK provides an independent customer project named as customer_app. See Figure
8. And in the SDK, the user can add new application code in the folder ~/ customer/apps/src and can
add a newly written application file in the project customer_app such as user_app.c.
Figure 8: Customer Project in IAR Workbench
If the user needs to change to a new SDK, copy the contents of the ~/ customer/apps/src folder to a new SDK and ~/build/customer_apps.ewp which is the build compile configuration file for the
customer_app project.
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
16 of 102
© 2021 Dialog Semiconductor
The DA16200 SDK provides an interface to add a user application. The interface is designed to create a user thread. For this purpose, define your application with this interface and then a user thread is automatically created and run when the DA16200 starts.
The structure of the application thread information is as shown in the example code below:
[ ~/src/sys_apps/inc/application.h ]
typedef struct _app_thread_info { /// Thread Name char *name;
/// Funtion Entry_point VOID (*entry_func)(ULONG);
/// Thread Stack Size USHORT stksize;
/// Thread Priority USHORT priority;
/// Flag to check network initializing UCHAR net_chk_flag;
/// Usage flag for DPM running UCHAR dpm_flag;
/// Port number for network communitation USHORT port_no;
/// Running mode of the DA16200 int run_sys_mode;
} app_thread_info_t;
name [ThreadX feature] Unique thread name
This name is also used to register to DPM sub-system
entry_function [ThreadX feature] Thread entry point
stksize [ThreadX feature] Stack size of thread
priority [ThreadX feature] Thread running priority
net_chk_flag [DA16200 feature] Indicate if the software must wait until the network
interface is up and running before the user thread runs. If set to 1, the user thread waits until the network interface is up and running. You must set the value to 1 if your program is a network application
dpm_flag [DA16200 feature] Indicate if the user thread uses the DPM function
port_no [DA16200 feature] Data transfer port number for DPM mode. When a user
thread has UDP/TCP operation with a specific port number, this port number should be registered to distinguish the data in DPM mode. This port number should be unique in the user thread table.
run_sys_mode [DA16200 feature] Runs a Wi-Fi mode (STA / Soft-AP). The application runs
only the specified Wi-Fi mode
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
17 of 102
© 2021 Dialog Semiconductor
To add user application code in the DA16200 SDK:
Figure 9: Location of User codes
Write new user code files and put the files in the customer folder. For example, user_apps.c.
1. Add the written user code files to the IAR project. See Figure 10.
Figure 10: Add User Files to the IAR Project
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
18 of 102
© 2021 Dialog Semiconductor

2.6 SDK Compilation

After an application is written, right-click on the project name in the IAR Embedded Workbench workspace and run command Make or Rebuild All. If you compile for the first time, then the advice is to run command Clean first. See Figure 11.
Figure 11: Compile SDK on IAR Workbench
Figure 12: Build Success on IAR Embedded Workbench
If the build is successful, then there are three binary images created in folder “~/SDK/img. The names of the image files are:
RTOS : DA16200_RTOS_GEN01-01-XXXXX-000000.img
System Library : DA16200_SLIB_GEN01-01-YYYYY-000000.img
2nd Bootloader : DA16200_BOOT-GEN01-01-ZZZZZ-000000_W25Q32JW.img
For more information about the firmware download, see document DA16200 EVK User Manual [2].
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
19 of 102
© 2021 Dialog Semiconductor

2.7 Make 4 MB SFLASH Images

The DA16200 SDK basically supports 2 MB SFLASH memory map. To create an image for a 4 MB SFLASH memory map using the DA16200 SDK, change some files for 4 MB memory map as follows, and then execute SDK Compilation from Section 2.6.
2
nd
Bootloader file : ~/SDK/build/SBOOT/image/DA16xxx_ueboot.bin.4MB
~/ SDK/build/SBOOT/image/DA16xxx_ueboot.bin
Config file : ~/SDK/build/SBOOT/cmconfig/fc9ktpmconfig.cfg.W25Q32JW(4MB)
~/SDK/build/SBOOT/cmconfig/fc9ktpmconfig.cfg
Load script file : ~/SDK/build/ldscripts/DA16xxx_rtos_cache.icf.4MB
~/SDK/build/ldscripts/DA16xxx_rtos_cache.icf
Macro file : ~/SDK/build/macro/da16200_asic_cache.mac.4MB
~/SDK/build/macro/da16200_asic_cache.mac
Compile feature : ~/SDK/customer/main/inc/config_generic_sdk.h
#undef __FOR_4MB_SFLASH__ #define __FOR_4MB_SFLASH__

2.8 Make fcCSP Low-Power SLIB Image

The DA16200 SDK provides a QFN-type Ram Library SFLASH image file. After a compilation is made with the DA16200 SDK, the QFN-type SLIB image with filename DA16200_SLIB-GEN01-01- XXXXX-000000.img is created in folder ~/SDK/img/.
To create a RAM Library image for the fcCSP Low-Power chipset with the DA16200 SDK, change the files mentioned below, and then do the SDK Compilation instructions given in Section 2.6.
binary file : ~/SDK/build/SBOOT/image/DA16xxx_slib_ramlib.bin.fcCSP_LP
~/SDK/build/SBOOT/image/DA16xxx_slib_ramlib.bin : ~/SDK/build/SBOOT/image/DA16xxx_slib_ramlib.rtm.fcCSP_LP ~/SDK/build/SBOOT/image/DA16xxx_slib_ramlib.rtm
NOTE
To make fcCSP image in the DA16200 Generic SDK, Customer/Developer have to remove the RamLib binary files if exist in ~/SDK/build/asic/Release/Exe folder.
~/SDK/build/asic/Release/Exe/DA16xxx_slib_ramlib.bin ~/SDK/build/asic/Release/Exe/DA16xxx_slib_ramlib.out
Compile feature : ~/SDK/customer/main/inc/sys_common_features.h
#undef __FOR_FCCSP_SDK__ #define __FOR_FCCSP_SDK__
After the compilation is finished, load the SLIB image and RTOS image into the SFLASH and boot the system. To distinguish it from the QFN type, it shows SDK Version information as "V2.3.X.0 CSP LP" as below when booting. See Figure 13.
Figure 13: Boot Logo with fcCSP-LP SLIB Image
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
20 of 102
© 2021 Dialog Semiconductor

3 Memory Map

3.1 System Memory Map

Address Map of Memories for Masters
Mask ROM
0x0000_0000
0x0004_0000
0x0008_0000
0x0010_0000
0x0020_0000
0x0030_0000
Not used
0x2000_0000
Memories
0x0000_0000
0x2000_0000
0x3000_0000
Not used
0x4000_0000
System Peripherals
0x5000_0000
Not used
0x6000_0000
APB Peripherals
0xE000_0000
System Control
Space(for CM4F)
Not used
0xF000_0000
0xFFFF_FFFF
Address Map of DA16200
Reserved
PHY
0x7000_0000
Not used
Int. SRAM
I-Cache
Not used
0x00F8_0000
Retention Memory
0x00FC_0000
Figure 14: System Memory Map

3.2 Memory Types

The DA16200 supports Mask ROM, Retention memory, SRAM, OTP, and Serial Flash memory. Mask ROM boots the system and starts the Main image. Retention memory is a special memory to preserve the contents when in power save mode. The DA16200 SoC contains 512 kB SRAM. OTP is used to store some permanent information and its size is 8 kB. A separate document is provided to use the OTP memory.
PHY is a region for 802.11 MAC HW. The APB and System peripherals region is detailed in
Figure15. In addition to these memory regions, there is an external Serial Flash memory region
provided on the EVB. Since Serial Flash memory is connected to an internal SPI (Serial to Peripheral
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
21 of 102
© 2021 Dialog Semiconductor
Interface) Master Controller, which has a separate DMA controller, it is not shown in the memory map of Figure 15. See Section 3.3 for more information about the serial flash memory map.
Timer0
Timer1
Dual Timer
Reserved
0x4000_0000
0x4000_1000
0x4000_2000
0x4000_3000
0x4000_8000
WatchDog Timer
Reserved
0x4000_9000
0x4000_F000
0x4001_0000
PWM
0x4000_A000
0x4000_B000
GPIO0
UART0
Reserved
0x4001_0000
0x4001_1000
0x4001_2000
0x4001_3000
0x4001_5000
I2C Master
Aux. ADC
0x4001_6000
0x4001_7000
0x4002_0000
CC312_APBS
CC312_APBC
0x4010_0000
0x4011_0000
0x4011_8000
Not used
0x4020_0000
System Controller
Security
SD/eMMC
(SDIO Host)
0x5000_0000
0x5001_0000
0x5002_0000
0x5003_0000
SDIO Device
0x500F_0000
0x5004_0000
Fast HW
0x5005_0000
0x5006_0000
DMA2
0x5007_0000
0x5008_0000
Slave Interface
0x5009_0000
RTC Interface
0x500A_0000
TA2SYNC
0x500B_0000
Flash Host Ctrl.
0x500C_0000
HSU
0x500D_0000
I-Cache Ctrl.
0x500E_0000
Reserved
Reserved
DMA1
0x4000_E000
GPIO1
Reserved
Not used
PSK_SHA1
0x5010_0000
Reserved
GPIO2
0x4001_8000
UART2
UART1
0x4000_7000
System Peripherals
APB Peripherals
Figure 15: APB and System Peripherals Memory Map

3.3 Serial Flash Memory Map

The DA16200 supports two types of SFLASH sizes: 2 MB and 4 MB. The default size of the DA16200 SDK is 2 MB SFLASH.
Table 1: 2 MB SFLASH Map
DA16200 2 MB SFLASH Map - Standard
0x0000_0000
2nd Bootloader
36 kB
0x0000_9000
Boot Index
4 kB
0x0000_A000
RTOS #0
924 kB
0x000F_1000
SLIB #0 (RamLib + TIM)
52 kB
0x000F_E000
RTOS #1
924 kB
0x001E_5000
SLIB #1 (RamLib + TIM)
52 kB
0x001F_2000
User Area
12 kB
0x001F_5000
Debug/RMA Certificate
4 kB
0x001F_6000
TLS Certificate key #0
16 kB
0x001F_A000
TLS Certificate key #1
16 kB
0x001F_E000
NVRAM#0
4 kB
0x001F_F000
NVRAM#1
4 kB
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
22 of 102
© 2021 Dialog Semiconductor
Table 2: 4 MB SFLASH Map
DA16200 4 MB SFLASH Map - Standard
0x0000_0000
2nd Bootloader
36 kB
0x0000_9000
Boot Index
4 kB
0x0000_A000
RTOS #0
1536 kB
0x0018_A000
SLIB #0 (RamLib + TIM)
64 kB
0x0019_A000
User Area #0
364 kB
0x001F_5000
Debug/RMA Certificate
4 kB
0x001F_6000
TLS Certificate key #0
16 kB
0x001F_A000
TLS Certificate key #1
16 kB
0x001F_E000
NVRAM#0
4 kB
0x001F_F000
NVRAM#1
4 kB
0x0020_0000
RTOS #1
1536 kB
0x0038_0000
SLIB #1 (RamLib + TIM)
64 kB
0x0039_0000
User Area #1
448 kB
NOTE
The size of the RTOS # 0 and # 1 images are the size of RTOS images size plus the interrupt vector table (5 kB size). So, the size of the actual RTOS image is the size excluding 5 kB from the total size.
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
23 of 102
© 2021 Dialog Semiconductor

4 Peripheral Driver

NOTE
This document may be further updated with more detailed descriptions later when the DA16200 SLR SoC is available.

4.1 SPI Slave

4.1.1 Introduction

The SPI slave interface gives support to control the DA16200 from an external host. The range of the SPI clock speed is the same as that of the internal bus clock speed. The SPI slave supports both burst mode and non-burst mode. In the burst mode, SPI_CSB remains active from the start to the end of communication. In the non-burst mode, SPI_CLK remains active at every 8-bit.
The communication protocols of the SPI slave interface use either 4-byte or 8-byte control signals. Between the two available communication protocols, the CPU chooses one before initiating the control.
Table 3: SPI Interface API Elements
Pin Name
Pin Number
I/O
Function Name
QFN
fcCSP
GPIOA2
37
B2
I
SPI_CSB
GPIOA6
32
E3 I F_CSN
18
J5
I
GPIOA3
36
D4
I
SPI_CLK
GPIOA7
31
E1
I
F_CLK
19
K4
I
GPIOA1
38
C3
I
SPI_MOSI
GPIOA9
29
H2 I GPIOA11
27
G1
I
F_IO0
14
K8
I
GPIOA0
39
A3
O
SPI_MISO
GPIOA8
30
G3
O
GPIOA10
28
F2
O
F_IO1
15
L7
O
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
24 of 102
© 2021 Dialog Semiconductor

4.1.2 Application Programming Interface

Table 4: SPI Slave Interface API Elements
void host_spi_slave_init(void)
Change Slave I/F to SPI protocol. Enable clock to SPI slave device and GPIO Interrupt Set
void host_i2c_slave_init(void)
Change Slave I/F to I2C protocol. Enable clock to I2C slave device and GPIO Interrupt Set

4.1.3 Sample Code

See the DA16200 Example Application Guide [3].

4.2 SDIO Master

4.2.1 SDIO Introduction

Secure Digital Input Output (SDIO) is a full / high speed card suitable for memory card and I/O card applications with low power consumption. The full / high speed card supports SPI, 1-bit SD and 4-bit SD transfer modes at the full clock range of 0~50 MHz. To be compatible with the serviceable SDIO clock, the internal BUS clock should be set to a minimum of 50 MHz. The CIS and CSA area are inside the internal memory and the SDIO registers (CCCR and FBR) are programmed by the SD host.
For more details, see the DA16200 Datasheet [1].

4.2.2 Application Programming Interface

Table 5: SDIO Interface API Elements
HANDLE EMMC_CREATE(void);
Parameter
void
Void
Return
If succeeded return handle for such device, if failed return NULL
Function create handle. If memory allocation failed, return NULL
int EMMC_INIT(HANDLE handler)
Parameter
handler
Device handle
Return
If succeeded return ERR_NONE, if failed return ERR_MMC_INIT
Initialize the SD/eMMC or SDIO card If the function returns ERR_NONE, the card information is saved in the handle
int EMMC_CLOSE(HANDLE handler)
Parameter
handler
Device handle
Return
If succeeded return ERR_NONE
int SDIO_ENABLE_FUNC(HANDLE handler, UINT32 func_num)
Parameter
handler
Device handle
func_num
Function number to enable
Return
If succeeded return ERR_NONE
int SDIO_DISABLE_FUNC(HANDLE handler, UINT32 func_num)
Parameter
handler
Device handle
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
25 of 102
© 2021 Dialog Semiconductor
HANDLE EMMC_CREATE(void);
func_num
Function number to disable
Return
If succeeded return ERR_NONE
int SDIO_SET_BLOCK_SIZE(HANDLE handler, UINT32 func_num, UINT32 blk_size)
Parameter
handler
Device handle
func_num
Function number
blk_size
Block size
Return
If succeeded return ERR_NONE
int SDIO_READ_BYTE(HANDLE handler, UINT32 func_num, UINT32 addr, UINT8 *data)
Parameter
handler
Device handle
func_num
Function number
addr
Address in the function
data
Data pointer
Return
If succeeded return ERR_NONE. And byte data is stored in data
int SDIO_WRITE_BYTE(HANDLE handler, UINT32 func_num, UINT32 addr, UINT8 *data)
Parameter
handler
Device handle
func_num
Function number
addr
Address in the function
data
Data pointer
Return
If succeeded return ERR_NONE
int SDIO_READ_BURST(HANDLE handler, UINT32 func_num, UINT32 addr, UINT32 incr_addr, UINT8 *data, UINT32 count, UINT32 blksz)
Parameter
handler
Device handle
func_num
Function number
addr
Function address
Incr_addr
Increase address option (1: address increase, 0: address fix)
data
Data pointer
count
Count of blocks
blksz
Block size
Return
If succeeded return ERR_NONE. If failed, Error Code return, see also EMMC.h
int SDIO_WRITE_BURST(HANDLE handler, UINT32 func_num, UINT32 addr, UINT32 incr_addr, UINT8 *data, UINT32 count, UINT32 blksz)
Parameter
handler
Device handle
func_num
Function number
addr
Function address
Incr_addr
Increase address option (1: address increase, 0: address fix)
data
Data pointer
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
26 of 102
© 2021 Dialog Semiconductor
int SDIO_READ_BYTE(HANDLE handler, UINT32 func_num, UINT32 addr, UINT8 *data)
count
Count of blocks
blksz
Block size
Return
If succeeded return ERR_NONE

4.2.3 Sample Code

See the DA16200 Example Application Guide [3].

4.3 SDIO Slave

4.3.1 Introduction

The GPIO4 and GPIO5 pins are set to SDIO CMD and CLK by default. If SDIO initialization is done and SDIO communication is enabled, then the SDIO data pin setting is done automatically. In other words, when the SDIO communication is detected, the pin used as the SDIO data among the GPIO pins is automatically activated in the SDIO use mode. However, the auto setting function is not supported for the F_xx pin used as the flash function.
Table 6: SDIO Slave Pin Configuration
Pin Name
Pin Number
I/O
Function Name
QFN
fcCSP
GPIOA4
34
F4
I/O
SDIO_CMD
F_CSN
18
J5
I/O
GPIOA5
33
D2
I
SDIO_CLK
F_CLK
19
K4
I
GPIOA9
29
H2
I/O
SDIO_D0
F_IO0
14
K8
I/O
GPIOA8
30
G3
I/O
SDIO_D1
F_IO1
15
L7
I/O
GPIOA7
31
E1
I/O
SDIO_D2
F_IO2
16
J7
I/O
GPIOA6
32
E3
I/O
SDIO_D3
F_IO3
17
K6
I/O
For more details, see the DA16200 Datasheet [1].

4.3.2 Application Programmer Interface

Table 7: SDIO Interface API Elements
UINT32 SDIO_SLAVE_INIT(void)
Parameter
Void
Void
Return
return 0
Description
SDIO Slave Initialization
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
27 of 102
© 2021 Dialog Semiconductor
UINT32 SDIO_SLAVE_INIT(void)
void SDIO_SLAVE_CALLBACK_REGISTER(void (* p_rx_callback_func)(UINT32 status))
Parameter
p_rx_callback_func
The callback function to use the offload protocol
Return
void
Description
SDIO Slave callback registration
void SDIO_SLAVE_CALLBACK_DEREGISTER(void)
Parameter
void
void
Return
void
Description
SDIO Slave callback de-registration
void SDIO_SLAVE_DEINIT (void)
Parameter
void
void
Return
void
Description
SDIO Slave de-initialization

4.3.3 Sample Code

See the DA16200 Example Application Guide [3].

4.4 I2C

4.4.1 I2C Master

The DA16200 includes an I2C master module. There are two supportable clock speeds for I2C in the DA16200; standard is 100 kbps and fast mode is 400 kbps.
Table 8 shows the pin definition of the I2C master interface in GPIO Pin Configuration.
Table 8: I2C Master Pin Configuration
Pin Name Pin Number
I/O
Function Name QFN
fcCSP
GPIOA1
38
C3 O I2C_CLK
GPIOA5
33
D2
O
GPIOA9
29
H2 O GPIOA0
39
A3
I/O
I2C_SDA GPIOA4
34
F4
I/O
GPIOA8
32
G3
I/O
For more details, see the DA16200 Datasheet [1].

4.4.2 I2C Slave

The I2C slave interface gives support to control the DA16200 from an external host. The pin mux condition is defined in Table 9. The I2C slave interface also supports the standard (100
kbps) or fast (400 kbps) transmission speeds.
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
28 of 102
© 2021 Dialog Semiconductor
Table 9: I2C Slave Pin Configuration
Pin Name
Pin Number
I/O
Function Name
QFN
fcCSP
GPIOA1
38
C3
I
I2C_CLK
GPIOA3
36
D4
I
GPIOA5
33
D2
I
GPIOA7
31
E1 I GPIOA0
39
A3
I/O
I2C_SDA
GPIOA2
37
B2
I/O
GPIOA4
34
F4
I/O
GPIOA6
32
E3
I/O
For more details, see the DA16200 Datasheet [1].
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
29 of 102
© 2021 Dialog Semiconductor

4.4.3 Application Programming Interface

Table 10: I2C Interface API Elements
HANDLE DRV_I2C_CREATE(UINT32 dev_id)
Parameter
dev_id
Device ID number to create a handle
Return
If succeeded return handle for the device, if failed return NULL
Description
Create a handle with parameter "dev_id" designated
Int DRV_I2C_INIT(HANDLE handler)
Parameter
handler
Device handle to initialize
Return
If succeeded return TRUE, if failed return FALSE
Description
int DRV_I2C_IOCTL(HANDLE handler, UINT32 cmd, VOID *data)
Parameter
handler
Device handle to control
cmd
See <sys_i2c.h> in our SDK
*data
Data pointer when there is any. If not, NULL
Return
If succeeded return TRUE, if failed return FALSE
Description
int DRV_I2C_IOCTL(HANDLE handler, UINT32 cmd, VOID *data)
I2C_GET_CONFIG
Get "i2c_cr0" Register Value. See Register Map
Read
I2C_GET_STATUS
Get "i2c_sr" Register Value. See Register Map
Read
I2C_SET_DMA_WR
I2C Write via uDMA Tx Enable / Disable
[TRUE / FALSE]
I2C_SET_DMA_RD
I2C READ via uDMA Rx Enable / Disable
[TRUE / FALSE]
I2C_GET_DMA_WR
Get uDMA Tx Enabled
[0x2 / FALSE]
I2C_GET_DMA_RD
Get uDMA Rx Enabled
[TRUE / FALSE]
I2C_SET_RESET
Set I2C Device Reset / set
[TRUE / FALSE]
I2C_SET_CHIPADDR
Set I2C Slave Device Address (8 bits)
Write
I2C_GET_CHIPADDR
Get I2C Slave Device Address (8 bits)
Read
I2C_SET_CLOCK
Set I2C Clock [KHz] (Max = 1200)
Write
int DRV_I2C_WRITE_DMA(HANDLE handler, VOID *p_data, UINT32 p_dlen, UINT32 dummy)
Parameter
handler
Device handle to write with DMA
*p_data
Buffer pointer to write
p_dlen
Length to write
dummy
Reserved (set to ‘0’)
Return
If succeeded return TRUE, if failed return FALSE
Description
I2C write function through DMA
int DRV_I2C_WRITE(HANDLE handler, VOID *p_data, UINT32 p_dlen, UINT32 stopen, UINT32 dummy)
Parameter
handler
Device handle to write
*p_data
Buffer pointer to write
UM-WI-002
SDK Programmer Guide
User Manual
Revision 2.3
18-Mar-2021
CFR0012
30 of 102
© 2021 Dialog Semiconductor
int DRV_I2C_IOCTL(HANDLE handler, UINT32 cmd, VOID *data)
p_dlen
Length to read
stopen
Flag stop bit enable
dummy
Reserved (set to ‘0’)
Return
If succeeded return TRUE, if failed return FALSE
Description
I2C write function
int DRV_I2C_READ(HANDLE handler, VOID *p_data, UINT32 p_dlen, UINT32 addr_len,UINT32 dummy)
Parameter
handler
Device handle to read
*p_data
Buffer pointer to read
p_dlen
Length to read
addr_len
Length of register address inside of slave device. if 0, Read only operation
dummy
Reserved (set to ‘0’)
Return
If succeeded return TRUE, if failed return FALSE
Description
I2C read function
Int DRV_I2C_CLOSE(HANDLE handler);
Parameter
handler
Device handle to close
Return
If succeeded return TRUE, if failed return FALSE
Description
I2C driver close
void DRV_I2C_REGISTER_INTERRUPT (HANDLE handler);
Parameter
handler
Device handle to register Interrupt Handler
Return
NULL
Description
I2C Interrupt Registration

4.4.4 Sample Code

See the DA16200 Example Application Manual [3].

4.5 SD/eMMC

4.5.1 Introduction

The SD/eMMC host IP has a function for the DA16200 to access SD or eMMC cards. The maximum data rate is less than 100 Mbps. So, this SD/eMMC host IP only supports a 4-bit data bus and the maximum clock speed is 50 MHz. The maximum data rate is 25 MB/s (200 Mbps) under 4-bit data bus and 50 MHz clock speed. The SD/eMMC pin mux condition is defined in Table 11.
Table 11: SD/eMMC Master Pin Configuration
Pin Name
Pin Number
I/O
Function Name
QFN
fcCSP
GPIOA4
34
F4
I/O
SD/eMMC_CMD
GPIOA5
33
D2 O SD/eMMC_CLK
GPIOA9
29
H2
I/O
SD/eMMC_D0
Loading...
+ 72 hidden pages