DALI send/recv library.
DALI send/recv library
lighting control protocol.
設備照明の調光プロトコル DALI を送受信するライブラリです。
DALI インターフェースの回路図などは次を参照。
- http://ww1.microchip.com/downloads/jp/AppNotes/01465A_JP.pdf
- https://www.mouser.com/pdfdocs/AN11174.pdf
DALI.h
- Committer:
- okini3939
- Date:
- 2020-07-22
- Revision:
- 0:6cb7026982fc
- Child:
- 1:319d52b5116b
File content as of revision 0:6cb7026982fc:
/* * DALI send/recv library * Copyright (c) 2020 Hiroshi Suga * Released under the MIT License: http://mbed.org/license/mit */ /** @file * @brief DALI send/recv */ #ifndef _DALI_H_ #define _DALI_H_ #include "CBuffer.h" class DALI { public: enum DALI_FRAME { DALI_FORWARD_SHORT_DAP, DALI_FORWARD_SHORT_IAP, DALI_FORWARD_GROUP_DAP, DALI_FORWARD_GROUP_IAP, DALI_BACKWARD, }; DALI (PinName tx, PinName rx); int read (enum DALI_FRAME *frame, int *addr, int *value); int readable (); int write (enum DALI_FRAME frame, int addr, int value); private: InterruptIn _rx; DigitalOut _tx; Timeout _timer; Ticker _ticker; CircBuffer<int> *recv_buf; CircBuffer<int> *send_buf; int mode; int count; int timeflg; int recv_bit; int recv_data; int send_data; int send_bit; int halfbit; int busy; void isr_rx (); void isr_timer (); void isr_timeout (); void isr_send (); }; #endif