-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 294fd63
Showing
244 changed files
with
75,044 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
![MikroE](http://www.mikroe.com/img/designs/beta/logo_small.png) | ||
|
||
--- | ||
|
||
# DALI_2 Click | ||
|
||
- **CIC Prefix** : DALI2 | ||
- **Author** : MikroE Team | ||
- **Verison** : 1.0.0 | ||
- **Date** : Feb 2018. | ||
|
||
--- | ||
|
||
### Software Support | ||
|
||
We provide a library for the DALI_2 Click on our [LibStock](https://libstock.mikroe.com/projects/view/2333/dali-2-click) | ||
page, as well as a demo application (example), developed using MikroElektronika | ||
[compilers](http://shop.mikroe.com/compilers). The demo can run on all the main | ||
MikroElektronika [development boards](http://shop.mikroe.com/development-boards). | ||
|
||
**Library Description** | ||
|
||
Library implements DALI master functionalities. | ||
|
||
Key functions : | ||
|
||
- ``` void dali2_sendCmd(const uint8_t balAddress, const uint8_t cmd, const uint8_t cmdType, const uint8_t folType) ``` - Executes DALI command | ||
- ``` void dali2_masterInit() ``` - Initializes master functionality | ||
- ``` uint8_t dali2_masterStatus() ``` - Returns master status | ||
|
||
**Examples Description** | ||
|
||
The application is composed of three sections : | ||
|
||
- System Initialization - Initializes GPIO pins for TX and RX | ||
- Application Initialization - Initializes driver, initializes DALI master functionality and configures timer | ||
- Application Task - (code snippet) - Application task is composed of three sequences, first sequence toggling | ||
light twice with delay of one second. Second sequence decreases intensity of light by 8 steps with delay of | ||
half second. Third sequence increases intensity of light by 8 steps with delay of half second. | ||
|
||
|
||
```.c | ||
void applicationTask() | ||
{ | ||
uint8_t counter; | ||
|
||
for (counter = 0; counter < 2; counter++) | ||
{ | ||
dali2_sendCmd(_DALI2_ADDRESS01, _DALI2_OFF, _DALI2_BROADCAST_CMD, _DALI2_FOLLOWING_COMMAND); | ||
Delay_ms( 1000 ); | ||
dali2_sendCmd(_DALI2_ADDRESS01, _DALI2_RECALL_MAX_LEVEL, _DALI2_BROADCAST_CMD, _DALI2_FOLLOWING_COMMAND); | ||
Delay_ms( 1000 ); | ||
} | ||
|
||
for (counter = 0; counter < 8; counter++) | ||
{ | ||
dali2_sendCmd(_DALI2_ADDRESS01, _DALI2_DOWN, _DALI2_BROADCAST_CMD, _DALI2_FOLLOWING_COMMAND); | ||
Delay_ms( 500 ); | ||
} | ||
|
||
for (counter = 0; counter < 8; counter++) | ||
{ | ||
dali2_sendCmd(_DALI2_ADDRESS01, _DALI2_UP, _DALI2_BROADCAST_CMD, _DALI2_FOLLOWING_COMMAND); | ||
Delay_ms( 500 ); | ||
} | ||
|
||
current_state = dali2_masterStatus(); | ||
} | ||
``` | ||
|
||
**Note** | ||
|
||
This implementation of DALI master requires timer with exact 104 uS interrupt time. The MCU used | ||
for example must be cappable to execute ```void dali2_isr()``` function in time less than 104 uS. | ||
In theory it is usable on faster MCUs but before usage you should check does your MCU is cappable to | ||
acomplish dali2_isr function call for less than 104us. | ||
|
||
|
||
The full application code, and ready to use projects can be found on our | ||
[LibStock](https://libstock.mikroe.com/projects/view/2333/dali-2-click) page. | ||
|
||
--- | ||
--- |
Oops, something went wrong.