Contiki-Inga 3.x
Files | Functions
PIC32 Contiki Port

Files

file  pic32.h
 PIC32MX initialization routines.
 
file  slip-uart.c
 PIC32MX Slip interface routines.
 
file  pic32_clock.c
 CLOCK interface for PIC32MX (pic32mx795f512l)
 
file  pic32_clock.h
 CLOCK interface for PIC32MX (pic32mx795f512l)
 
file  pic32_irq.h
 INTERRUPT interface for PIC32MX (pic32mx795f512l)
 
file  pic32_spi.c
 SPI interface for PIC32MX (pic32mx795f512l)
 
file  pic32_spi.h
 SPI interface for PIC32MX (pic32mx795f512l)
 
file  pic32_timer.c
 TIMER interface for PIC32MX (pic32mx795f512l)
 
file  pic32_timer.h
 TIMER interface for PIC32MX (pic32mx795f512l)
 
file  pic32_uart.c
 UART Interface for PIC32MX (pic32mx795f512l)
 
file  pic32_uart.h
 UART Interface for PIC32MX (pic32mx795f512l)
 

Functions

clock_time_t clock_time (void)
 Get the current clock time. More...
 
unsigned long clock_seconds (void)
 Get the current value of the platform seconds. More...
 
void clock_set_seconds (unsigned long sec)
 Set the value of the platform seconds. More...
 
void clock_delay_usec (uint16_t dt)
 Delay a given number of microseconds. More...
 
uint32_t pic32_clock_get_system_clock (void)
 Calculate the system clock. More...
 
uint32_t pic32_clock_get_peripheral_clock (void)
 Calculate the peripheral clock. More...
 

Detailed Description

Function Documentation

void clock_delay_usec ( uint16_t  dt)

Delay a given number of microseconds.

Parameters
dtHow many microseconds to delay.
Note
Interrupts could increase the delay by a variable amount.

Definition at line 126 of file clock.c.

References pic32_clock_get_system_clock().

unsigned long clock_seconds ( void  )

Get the current value of the platform seconds.

Return seconds, default is time since startup.

This could be the number of seconds since startup, or since a standard epoch.

Returns
The value.

The comparison avoids the need to disable clock interrupts for an atomic read of the four-byte variable.

Definition at line 90 of file clock.c.

void clock_set_seconds ( unsigned long  sec)

Set the value of the platform seconds.

Set seconds, e.g.

Parameters
secThe value to set.

to a standard epoch for an absolute date/time.

Definition at line 96 of file clock.c.

clock_time_t clock_time ( void  )

Get the current clock time.

Return the tick counter.

This function returns the current system clock time.

Returns
The current clock time, measured in system ticks.

When 16 bit it typically wraps every 10 minutes. The comparison avoids the need to disable clock interrupts for an atomic read of the multi-byte variable.

Definition at line 84 of file clock.c.

uint32_t pic32_clock_get_peripheral_clock ( void  )

Calculate the peripheral clock.

Returns
the peripheral clock value.

Definition at line 96 of file pic32_clock.c.

References pic32_clock_get_system_clock().

uint32_t pic32_clock_get_system_clock ( void  )

Calculate the system clock.

Returns
the system clock value.

Definition at line 82 of file pic32_clock.c.

Referenced by clock_delay_usec(), and pic32_clock_get_peripheral_clock().