Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

DALI interface. More...

Topics

 DALI Driver Backend API

Files

file  dali.h
 Digital Addressable Lighting Interface (DALI) driver API.

Data Structures

struct  dali_frame
 DALI frame structure. More...

Typedefs

typedef void(* dali_receive_callback_t) (const struct device *dev, struct dali_frame frame, void *user_data)
 Defines the application callback handler function signature for receiving a DALI frame.
typedef void(* dali_transmit_callback_t) (const struct device *dev, int error, void *user_data)
 Defines the application callback handler function signature for transmitting a DALI frame.

Enumerations

enum  dali_event_type {
  DALI_FRAME_CORRUPT , DALI_FRAME_BACKWARD , DALI_FRAME_GEAR , DALI_FRAME_DEVICE ,
  DALI_FRAME_FIRMWARE , DALI_EVENT_BUS_FAILURE , DALI_EVENT_BUS_IDLE
}
 DALI frame types. More...

Functions

int dali_set_receive_callback (const struct device *dev, dali_receive_callback_t callback, void *user_data)
 Set a callback function that receives frames from the DALI bus.
int dali_transmit (const struct device *dev, const struct dali_frame *frame, dali_transmit_callback_t callback, void *user_data)
 Transmit a frame on the DALI bus.

Detailed Description

DALI interface.

Since
4.4
Version
0.1.0

The DALI API provides support for low-level communication according to IEC 62386.

Typedef Documentation

◆ dali_receive_callback_t

typedef void(* dali_receive_callback_t) (const struct device *dev, struct dali_frame frame, void *user_data)

#include <zephyr/drivers/dali.h>

Defines the application callback handler function signature for receiving a DALI frame.

Parameters
devPointer to device structure for the driver instance.
frameReceived DALI frame.
user_dataUser data provided when the callback function was set.

◆ dali_transmit_callback_t

typedef void(* dali_transmit_callback_t) (const struct device *dev, int error, void *user_data)

#include <zephyr/drivers/dali.h>

Defines the application callback handler function signature for transmitting a DALI frame.

Parameters
devPointer to device structure for the driver instance.
errorError code for the transaction
See also
dali_transmit
Parameters
user_dataUser data provided when the frame was sent.

Enumeration Type Documentation

◆ dali_event_type

#include <zephyr/drivers/dali.h>

DALI frame types.

Enumerator
DALI_FRAME_CORRUPT 

corrupt frame (transmit/receive)

DALI_FRAME_BACKWARD 

backward 8bit frame (transmit/receive)

DALI_FRAME_GEAR 

forward 16bit gear frame (transmit/receive)

DALI_FRAME_DEVICE 

forward 24bit device frame (transmit/receive)

DALI_FRAME_FIRMWARE 

forward 32bit firmware frame (transmit/receive)

DALI_EVENT_BUS_FAILURE 

detected a bus failure (receive only)

DALI_EVENT_BUS_IDLE 

detected that bus is idle again after failure (receive only)

Function Documentation

◆ dali_set_receive_callback()

int dali_set_receive_callback ( const struct device * dev,
dali_receive_callback_t callback,
void * user_data )

#include <zephyr/drivers/dali.h>

Set a callback function that receives frames from the DALI bus.

Set a callback function for the DALI driver. Whenever a DALI frame is fully received, or a relevant bus event is detected, the callback function is called in the driver´s workqueue context. Only a single callback function per driver instance is supported.

Note
The callback function is invoked at the end of the stop condition. Interframe timings need to consider this.
Parameters
devPointer to the DALI device structure for the driver instance.
callbackThis function is called by the DALI driver whenever a frame is received or a relevant event detected.
user_dataUser data to pass to callback function.
Return values
0on success
-ENOSYSif function not implemented

◆ dali_transmit()

int dali_transmit ( const struct device * dev,
const struct dali_frame * frame,
dali_transmit_callback_t callback,
void * user_data )

#include <zephyr/drivers/dali.h>

Transmit a frame on the DALI bus.

Immediately start transmitting a DALI frame to the DALI bus. In case of an error, the driver will not automatically attempt to re-transmit the frame.

Parameters
devPointer to the DALI device structure for the driver instance.
frameDALI frame to transmit
callbackOptional callback for when the frame was successfully transmitted or a transmission error is detected. The callback function is called in the driver´s workqueue context. For the meaning of the callback´s err parameter refer to the return codes for dali_transmit.
user_dataUser data to pass to callback function.
Return values
0on success
-EBUSYif a frame transmission is active
-EINVALif invalid parameter was passed to function
-ECANCELEDif transmission yielded to a dominant frame
-ECOMMif collision occurred during transmission
-EAGAINif bus is not available
-ENOSYSif function not implemented