c - Three Delay Pluses -


how make 15ns time delay loop need 3 clock pluses need per image.

picture

{           void adrf6755_lock(void)  {   unsigned int  i;      (i=0;i<3;i--)  {  time_delayns(15);  adrf6755_ce_low;   } 

i guess developping embedded system. if software built under operating system such linux, can use standard functions "int nanosleep(const struct timespec *req, struct timespec *rem);" function suspends execution of calling thread until either @ least time specified in *req has elapsed. must include header "time.h". structure "timespec" defined shown below:

struct timespec {     time_t tv_sec;     time_t tv_nsec; } 

here example of function suspends calling thread 15ns:

void delay_15ns() {       struct timespec ts;       ts.tv_sec = 0;      ts.tv_nsec = 15;       nanosleep(ts, null); } 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -