7. Peripheral Migration
Figure 24 shows peripheral drivers for each device. SDK 6.0.18 includes two new drivers: i2c.c/.h
(generic I2C) and rtc.c/.h
.
7.1. UART
The DA14531 has two instances of this block:
UART1
andUART2
Only UART1 supports hardware flow control signals
There is a new UART driver with DMA support, common for both devices DA14585/586 and DA14531
High-level implementation of the serial console modules remains the same (
arch_printf()
/arch_printf_process()
)
Option to use DMA via
CFG_UART_DMA_SUPPORT
- Low level implementation:
DMA support
uart_initialize(UART_ID, conf) replaces the old UART initialization (UART_ID should be UART1/UART2 and the conf parameter holds the UART configuration)
One-wire UART support (defined in
CFG_UART_ONE_WIRE_SUPPORT
)Implements blocking/non-blocking (interrupt), with or without DMA support
7.2. SPI
A new SPI driver has a separate implementation for DA14585/586 and DA14531:
Removed
spi.c
from all projects – replaced withspi_531.c
andspi_58x.c
DMA support (
#define CFG_SPI_DMA_SUPPORT
)Master and slave support. Master by default. For slave, define
CFG_SPI_SLAVE
(only for DA14531)In the new driver, SPI initialization
spi_init()
is replaced withspi_initialize(spi_config)
,spi_config
. Provides a configuration for the SPI parametersThe transactions - while being master of the bus - are executed via the functions
spi_send()
/spi_receive()
/spi_transfer()
. The operations are either blocking or non-blocking working with interrupts and the DMA
7.3. I2C
The new I2C driver is identical for DA14585/586 and DA14531.
Supports master and slave configuration
Supports DMA transactions (
#define CFG_I2C_DMA_SUPPORT
ini2c.h
)Initialize function for i2c (
I2c_init(i2c_cfg)
,i2c_cfg
) includes all the configuration parameters for the hardware moduleDriver for
i2c_eeprom.c
is changed to fit the new I2C API
7.4. RTC
The DA14531 is equipped with a Real Time Clock, which provides complete clock and calendar information with automatic time unit adjustment and easy configuration.
Features:
Alarm function
Event interrupt on any calendar or time unit
Available during sleep (if
PD_TIM
power domain is kept alive)Granularity of 10 ms
7.5. Other Peripherals
New common wake-up and quadrature drivers
If quadrature is not used at start-up, make sure to define
CFG_DISABLE_QUADEC_ON_START_UP
inda1458x_advanced_config.h
to disable quadrature. Otherwise the application should handle quadratureNew Timer1 driver implementation (new Driver)
Modified common GPIO driver to support the DA14531 device
New ADC functionality to read the temperature from the temperature sensor