Quantcast
Channel: Infineon Forums
Viewing all articles
Browse latest Browse all 9892

How to give the master a random and a short address to my slave device?(DALI Protocol

$
0
0
I absolutely do not understand what is happening in this DALI library.
on the screen went to the breakpoint.
following the steps:
https://ibb.co/nJXyvb

I enter the function:
Code:

uint32_t DALICG02_uiCheckAddr (const DALICG02_ConfigHandleType \
* DALICG02_HandlePtr)

In DALICG02.C
and find out that our request:
Code:

DALICG02_Special_cmd (DALICG02_HandlePtr);
which is logical!
execute the function before our request:
Code:

case DALICG02_QUERY_SHORT_ADDR:
go to the condition:
Code:

if (DALICG02_Special_uiDevice_selection (DALICG02_HandlePtr)) <--- true?
check:
Code:

if ((DALI102_HandlePtr-> uiPhysical_sel_mode == DALICG02_PHYSICAL_ENABLED) || \
****************(DALI102_HandlePtr-> stOther_flags.bCompare_en && \
************************DALICG02_Special_uiCompare_addr (DALICG02_HandlePtr)))

again we check the function inside the condition:
Code:

DALICG02_Special_uiCompare_addr (DALICG02_HandlePtr)
inside this function there is a condition:
Code:

if ((DALI102_HandlePtr-> stDALICG02_search_addr.uiSearch_addr_H == \
********DALI102_HandlePtr-> aucDALICG02_var [DALICG02_RANDOM_ADDR_H]) && \
******(DALI102_HandlePtr-> stDALICG02_search_addr.uiSearch_addr_M == \
********DALI102_HandlePtr-> aucDALICG02_var [DALICG02_RANDOM_ADDR_M]) && \
******(DALI102_HandlePtr-> stDALICG02_search_addr.uiSearch_addr_L == \
********DALI102_HandlePtr-> aucDALICG02_var [DALICG02_RANDOM_ADDR_L]))
**{
****status = 1U;
**}
**else
**{
****status = 0U;
**}
**return status;

Since the RANDOMISE command already existed, then status = 0U.
This status we drag through all previous functions and take off from the function without getting the address:
Code:

/case DALICG02_QUERY_SHORT_ADDR:
******if (DALICG02_Special_uiDevice_selection (DALICG02_HandlePtr))
******{
********if (DALI102_HandlePtr-> stStatus_info.bMissing_short_addr)
********{
**********DALI102_HandlePtr-> uiSlave_TX_data = DALICG02_BYT_MASK;
********}
********else
********{
**********DALI102_HandlePtr-> uiSlave_TX_data = \
**********((DALI102_HandlePtr-> aucDALICG02_var [DALICG02_SHORT_ADDR] << 1) | (0x01U));
********}
********DALI102_HandlePtr-> stDALICG02_flags.bResponse_req = value.bitOne;
******}

the question is: can this be the problem?
Answer at least something, but it's more a monologue than a forum =)

Viewing all articles
Browse latest Browse all 9892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>