|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
DALI interface. More...
Files | |
| file | dali.h |
| Digital Addressable Lighting Interface (DALI) driver API. | |
Data Structures | |
| struct | dali_frame |
| DALI frame structure. More... | |
| struct | dali_driver_api |
| @driver_ops{DALI} 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. | |
| typedef int(* | dali_api_set_receive_callback_t) (const struct device *dev, dali_receive_callback_t callback, void *user_data) |
| @def_driverbackendgroup{DALI,dali_interface} | |
| typedef int(* | dali_api_transmit_t) (const struct device *dev, const struct dali_frame *frame, dali_transmit_callback_t callback, void *user_data) |
| API for transmitting DALI frames. | |
DALI interface.
The DALI API provides support for low-level communication according to IEC 62386.
| typedef int(* dali_api_set_receive_callback_t) (const struct device *dev, dali_receive_callback_t callback, void *user_data) |
#include <dali.h>
@def_driverbackendgroup{DALI,dali_interface}
API for receiving DALI frames
| typedef int(* dali_api_transmit_t) (const struct device *dev, const struct dali_frame *frame, dali_transmit_callback_t callback, void *user_data) |
#include <dali.h>
API for transmitting DALI frames.
| typedef void(* dali_receive_callback_t) (const struct device *dev, struct dali_frame frame, void *user_data) |
#include <dali.h>
Defines the application callback handler function signature for receiving a DALI frame.
| dev | Pointer to device structure for the driver instance. |
| frame | Received DALI frame. |
| user_data | User data provided when the callback function was set. |
| typedef void(* dali_transmit_callback_t) (const struct device *dev, int error, void *user_data) |
#include <dali.h>
Defines the application callback handler function signature for transmitting a DALI frame.
| dev | Pointer to device structure for the driver instance. |
| error | Error code for the transaction |
| user_data | User data provided when the frame was sent. |
| enum dali_event_type |
#include <dali.h>
DALI frame types.
| int dali_set_receive_callback | ( | const struct device * | dev, |
| dali_receive_callback_t | callback, | ||
| void * | user_data ) |
#include <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.
| dev | Pointer to the DALI device structure for the driver instance. |
| callback | This function is called by the DALI driver whenever a frame is received or a relevant event detected. |
| user_data | User data to pass to callback function. |
| 0 | on success |
| -ENOSYS | if function not implemented |
| int dali_transmit | ( | const struct device * | dev, |
| const struct dali_frame * | frame, | ||
| dali_transmit_callback_t | callback, | ||
| void * | user_data ) |
#include <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.
| dev | Pointer to the DALI device structure for the driver instance. |
| frame | DALI frame to transmit |
| callback | Optional 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_data | User data to pass to callback function. |
| 0 | on success |
| -EBUSY | if a frame transmission is active |
| -EINVAL | if invalid parameter was passed to function |
| -ECANCELED | if transmission yielded to a dominant frame |
| -ECOMM | if collision occurred during transmission |
| -EAGAIN | if bus is not available |
| -ENOSYS | if function not implemented |