0

I'm trying to generate signals using an AD9833 and a raspberry pi 3 model B+ but each time I build my programme I have this error message:

ad9833.c:36:2: warning: implicit declaration of function ‘bcm2835_gpio_fseL’ [-Wimplicit-function-declaration] "

Can somebody help me to solve this problem, please.

This is my code:

void shiftOut(uint8_t dataPin, uint8_t clockPin, char bitOrder, uint8_t value){

    uint8_t i;

    for(i = 0 ; i < 8 ; i++){

        if(bitOrder == 'm')
            bcm2835_gpio_write(dataPin, !!(value & (1 << (7 - i))));

        else if(bitOrder == 'l')
            bcm2835_gpio_write(dataPin, !!(value & (1 << i)));

        bcm2835_gpio_write(clockPin, HIGH);
        bcm2835_gpio_write(clockPin, LOW);
    }
}


int main (int argc, char **argv){

    if(!bcm2835_init())
    return 1;

    bcm2835_gpio_set(FSYNC);
    bcm2835_gpio_set(SCLK);

    //bcm2835_gpio_fsel(uint8_t pin, uint8_t mode);
    bcm2835_gpio_fseL(FSYNC, BCM2835_GPIO_FSEL_OUTP);
    bcm2835_gpio_fseL(SCLK, BCM2835_GPIO_FSEL_OUTP);
    bcm2835_gpio_fseL(SDATA, BCM2835_GPIO_FSEL_OUTP);

    while(1){
        bcm2835_gpio_write(SCLK, HIGH);
        bcm2835_gpio_write(FSYNC, LOW);
        shiftOut(SDATA, SCLK, 'm',0x00);
        shiftOut(SDATA, SCLK, 'm',0x00);
        bcm2835_gpio_write(FSYNC, HIGH);
    }
}
2

The error generally means that you have called a function that does not have a prototype.

In this case I think you mistyped the function, capitalizing the 'L' where you should have lower case 'l'. Note the difference between the one that you commented out and the ones that follow, copying from your code in the question:

//bcm2835_gpio_fsel(uint8_t pin, uint8_t mode);
bcm2835_gpio_fseL(FSYNC, BCM2835_GPIO_FSEL_OUTP);
bcm2835_gpio_fseL(SCLK, BCM2835_GPIO_FSEL_OUTP);
bcm2835_gpio_fseL(SDATA, BCM2835_GPIO_FSEL_OUTP);

The character right before the open parenthesis looks to be the wrong case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.