osdep_samD21j18a.c
Go to the documentation of this file.
00001 
00008 #include <stdint.h>
00009 #include "osdep.h"
00010 #include "conf_clocks.h"
00011 
00012 uint32_t msec=0;
00013 
00014 void 
00015 SysTick_Handler(void)
00016 {
00017         msec++;
00018 }
00019 
00020 uint64_t 
00021 tmr_gettime(void)
00022 {
00023         uint32_t ret;
00024         ret=SysTick_Config(SystemCoreClock/1000);                                    /* Configure SysTick to generate an interrupt every millisecond */
00025         if(ret==0)
00026         {
00027                 return msec;
00028         }
00029         return 0;
00030 }
00031 
00032 uint32_t 
00033 tmr_gettime_low()
00034 {
00035         /* Fill in with code that returns the low 32 bits of a millisecond
00036         * counter. The API will not otherwise interpret the counter value.
00037         */
00038         return (tmr_gettime() >>  0) & 0xffffffff;
00039 }
00040 
00041 uint32_t 
00042 tmr_gettime_high()
00043 {
00044         /* Fill in with code that returns the hugh 32 bits of a millisecond
00045         * counter. The API will not otherwise interpret the counter value.
00046         * Returning 0 is acceptable here if you do not have a large enough counter.
00047         */
00048         return (tmr_gettime() >> 32) & 0xffffffff;
00049 }
00050 
00051 void 
00052 tmr_sleep(uint32_t sleepms)
00053 {
00054         /*
00055         * Fill in with code that returns after at least sleepms milliseconds
00056         * have elapsed.
00057         */
00058         while (sleepms--)
00059         {
00060                 SysTick_Config(SystemCoreClock/1000);
00061         }
00062 }
00063 
00064 TMR_TimeStructure
00065 tmr_gettimestructure()
00066 {
00067         TMR_TimeStructure timestructure;
00068         timestructure.tm_year = (uint32_t)0;
00069         timestructure.tm_mon = (uint32_t)0;
00070         timestructure.tm_mday = (uint32_t)0;
00071         timestructure.tm_hour = (uint32_t)0;
00072         timestructure.tm_min = (uint32_t)0;
00073         timestructure.tm_sec = (uint32_t)0;
00074         return timestructure;
00075 }


thingmagic_rfid
Author(s): Brian Bingham
autogenerated on Thu May 16 2019 03:01:23