28 #define PRINTF(...) printf(__VA_ARGS__)
34 #define COFFEE_AUTO_FORMAT 1
39 PRINTF(
"Initialize xmem and coffee...\n");
41 PRINTF(
"Xmem initialized.\n");
42 #ifdef COFFEE_AUTO_FORMAT
45 PRINTF(
"Coffee not formated\n");
48 PRINTF(
"Failed to format coffee, bail out\n");
53 PRINTF(
"Failed to open file to indicate formated state\n");
56 cfs_write(fd,
"DO NOT REMOVE!", strlen(
"DO NOT REMOVE!"));
60 PRINTF(
"Coffee initialized.\r\n");
63 LLWU_CONTROL(deep_sleep);
85 llwu_enable_wakeup_module(LLWU_WAKEUP_MODULE_LPTMR);
98 power_control_vperiph_set(1);
106 PRINTF(
"CPUID: %08x\n", (
unsigned int)
SCB->CPUID);
107 PRINTF(
"UID: %08x %08x %08x %08x\n", (
unsigned int)
SIM->UIDH, (
unsigned int)
SIM->UIDMH, (
unsigned int)
SIM->UIDML, (
unsigned int)
SIM->UIDL);
125 autostart_start(autostart_processes);
void SystemInit(void)
Initialize the system.
int cfs_open(const char *name, int flags)
Open a file.
Device I/O mappings for the Mulle platform.
#define CFS_WRITE
Specify that cfs_open() should open a file for writing.
Provide udelay routine for MK60DZ10.
void rtimer_init(void)
Initialize the real-time scheduler.
uint32_t SystemFlexBusClock
Current FlexBus clock frequency.
void leds_arch_init(void)
Leds implementation.
uint32_t SystemFlashClock
Current flash clock frequency.
Power control pins for the on board power switches on the Mulle board.
Debug port initialization for the Mulle platform.
#define NULL
The null pointer.
#define SIM
Peripheral SIM base pointer.
#define CFS_READ
Specify that cfs_open() should open a file for reading.
void clock_init(void)
Initialize the clock library.
int main(void)
This is main...
void dbg_uart_init(void)
Initialize debug UART used by printf.
void udelay(uint16_t us)
Microsecond busy wait.
void process_init(void)
Initialize the process module.
void llwu_sleep(void)
Sleep until some process is polled, ie interrupt occurs.
K60 hardware register header wrapper.
void rtc_start(void)
Enable the RTC seconds counter.
void llwu_set_allow(llwu_control_t *c, char allow)
Method for a controller to allow or disallow deep sleep.
void random_init(unsigned short seed)
Seed the cc2430 random number generator.
Provide common UART routines for MK60DZ10.
Header file for module for automatically starting and exiting a list of processes.
void ctimer_init(void)
Initialize the callback timer library.
void rtc_time_set(uint32_t seconds)
Set the time.
uint32_t SystemCoreClock
Current core clock frequency.
void process_start(struct process *p, process_data_t data)
Start a process.
int cfs_coffee_format(void)
Format the storage area assigned to Coffee.
K60 clock configuration functions.
int process_run(void)
Run the system once - call poll handlers and process one event.
Helper functions for reading Mulle platform board voltages.
void llwu_register(llwu_control_t *c)
Register as a controller for llwu.
Header for the Coffee file system.
void SystemCoreClockUpdate(void)
Update internal SystemCoreClock variable.
uint32_t SystemSysClock
Current system clock frequency.
uint32_t SystemBusClock
Current bus clock frequency.
void cfs_close(int fd)
Close an open file.