paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] spi call back function


From: Gautier Hattenberger
Subject: Re: [Paparazzi-devel] spi call back function
Date: Wed, 03 Jul 2013 11:08:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

Hi Chris,

It is possible to change the callback function during the execution, but you should be aware that this function is called under interrupt (and before the slave got unselected), so it should really be used only if necessary. If you plan to use it to handle the data, you should use a "normal" event function and look the spi transaction status (Success of Failed).
Have a look at max1168 and ms2100 drivers in sw/airborne/peripherals

Gautier

Le 03/07/2013 10:38, Chris a écrit :
Hi.
Felix can i change the spi "after_cb" function during code execution so i can call different functions or after the spi transaction initialization the call back function should remain fixed
the whole time?
I am writting a module and if i got this right the "after_cb" function is really used as the "event"
function which is commonly used for the modules.

max7456_trans.after_cb  = max7456_trans_cb;

where the function's prototype called back is defined like this:
static void max7456_trans_cb(struct spi_transaction *trans);

and the function definition has the "__attribute__ ((unused))" attribute:
static void max7456_trans_cb(struct spi_transaction *trans __attribute__ ((unused))){

return;
}

Chris


_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]