DocID025866 Rev 1 11/31
UM1728 Function description
31
3 Function description
This section describes the most important STM32F1xx DALI slave library functions for the
user.
3.1 I/O pin driver layer functions
The I/O pin driver layer implements hardware dependent functions (designed for use with
STM32F1xx devices and the DALI transceiver board).
3.1.1 STM32F10x_it.c
These files contain two interrupt service routines (ISR):
void SysTick_Handler(void)
This function:
• Generates timer ticks for the DALI bit receive and transmit functions
• Calls, in given intervals, the transmit/receive function (sampling is eight times per DALI
bit).
• Generates timer ticks for the upper DALI layer timing by calling callback functions fr om
the DALI stack layer
• Checks for DALI interface failure such as loss of voltage on the DALI bus for more than
500 ms (disconnection from DALI bus).
Void EXTI0_IRQHandler(void)
This function:
• Calls receiving routines if there is a voltage level change on the DALI RX pin
• Detects the start of the DALI packet. This ISR is inactive during DALI packet
reception.It is activated after DALI packet reception
3.1.2 DALIslave.c
These file contains the reception and transmission routines for building the DALI packet
from received bits according to the DALI specification. It also contains the initialization
functions of the DALI I/O pin driver layer.
The functions of these files are given below in bold.
Void init_DALI (port_out, pin_out, invert_out, port_in, pin_in, invert_in,
DataReceivedFunction, ErrorFunction,RTC_1ms_Function)
This function:
• Initializes the DALI I/O pin driver layer
• Defines the DALI RX and DALI TX pins and their inversion.