
DALI low level driver DALI Low Level Driver - Main program 9 von 26
7DALI Low Level Driver - Main program
Example
Explanation The dalill_inithardware() function contains everything needed to
initialize the target hardware. It may be necessary to access an
automatically generated code.
Here the PCIOs and the timer are initialized. The timer is not yet
started!
In this function, the two interrupt routines of the Low Level Driver are
also set on the corresponding vectors.
In the case of the LLT, this means the functions dalill_interruptExt for the
DALI read pin and dalill_timerinterrupt2 for the timer. Both functions
require a parameter of the type dalill_bus_t*. As outlined above, this is
envisaged for the future multi-bus operation.
#include "dali_ll_hal.h"
#include "dali_ll.h"
#include "dali.h"
dalill_bus_t* pDalill_bus_0;
void DALI_ThreadFunc(void *argument) // oder main()
{
// do hardware initialization
dalill_initHardware();
// init dalistack
// init dali_ll
pDalill_bus_0 = dalill_createBusLine(&dalill_getBusState,
&dalill_setBusStateHigh,
&dalill_setBusStateLow);
// init dalilib (API)
dali_init(pDalill_bus_0,NULL);
while (1)
{
// Dieses if nur in Multitaskingumgebungen mit Signallingcallback
// Beispielhaft für Rtos
if (DALI_FLAG == osThreadFlagsWait(DALI_FLAG,osFlagsWaitAny,15))
{
// something to do ?, not necessary if nothing else should be done in
main