Skip to main content
Graduate
January 9, 2024
Question

ST_Dalislave

  • January 9, 2024
  • 1 reply
  • 796 views

Hi people,

    I just work on a Dali project and trying to learn from the demo library I am getting some error can anyone PLEASE help me how to proceed.

I am trying in STM32G0

I am getting error as EXTI.Instruture undeclared i tried EXTI.Instruct but still its showing error  'NVIC_InitStructure' undeclared 

hOW CAN I DECLARE THAT FUNCTIONS

 

 

void receive_tick(void)
{
 // Because of the structure of current amplifier, input has
 // to be negated
 actual_val = get_DALIIN();
 tick_count++;

 // edge detected
 if(actual_val != former_val)
 {
 switch(bit_count)
 {
 case 0:
 if (tick_count > 2)
 {
 tick_count = 0;
 bit_count = 1; // start bit
 }
 break;
 case 17: // 1st stop bit
 if(tick_count > 6) // stop bit error, no edge should exist
 flag = ERR;
 break;
 default: // other bits
 if(tick_count > 6)
 {
 if(bit_count < 9) // store bit in address byte
 {
 address |= (actual_val << (8-bit_count));
 }
 else // store bit in data byte
 {
 dataByte |= (actual_val << (16-bit_count));
 }
 bit_count++;
 tick_count = 0;
 }
 break;
 }
 }else // voltage level stable
 {
 switch(bit_count)
 {
 case 0:
 if(tick_count==8) // too long start bit
 flag = ERR;
 break;
 case 17:
 // First stop bit
 if (tick_count==8)
 {
 if (actual_val==0) // wrong level of stop bit
 {
 flag = ERR;
 }
 else
 {
 bit_count++;
 tick_count = 0;
 }
 }
 break;
 case 18:
 // Second stop bit
 if (tick_count==8)
 {
 flag = NO_ACTION;

 //enable EXTI
 EXTI_InitStructure.EXTI_Line = EXTI_LINE_6;
 EXTI_InitStructure.EXTI_Mode = EXTI_MODE_INTERRUPT;
 EXTI_InitStructure.EXTI_Trigger = EXTI_TRIGGER_FALLING;
 EXTI_InitStructure.EXTI_LineCmd = ENABLE;
 EXTI_Init(&EXTI_InitStructure);

 DataReceivedCallback(address,dataByte);
 }
 break;
 default: // normal bits
 if(tick_count==10)
 { // too long delay before edge
 flag = ERR;
 }
 break;
 }
 }
 former_val = actual_val;
 if(flag==ERR)
 {
 flag = NO_ACTION;
 //enable EXTI
 EXTI_InitStructure.EXTI_Line = EXTI_LINE_6;
 EXTI_InitStructure.EXTI_Mode = 'EXTI_MODE_INTERRUPT';
 EXTI_InitStructure.EXTI_Trigger = EXTI_TRIGGER_FALLING;
 EXTI_InitStructure.EXTI_LineCmd = ENABLE;
 EXTI_Init(&EXTI_InitStructure);
 }
}

 

 

    This topic has been closed for replies.

    1 reply

    Super User
    January 9, 2024