Initial commit of Sensinode platform files.
This commit is contained in:
parent
0e9220716e
commit
c4ae18e37b
7 changed files with 415 additions and 0 deletions
49
platform/sensinode/dev/leds-arch.c
Normal file
49
platform/sensinode/dev/leds-arch.c
Normal file
|
@ -0,0 +1,49 @@
|
|||
#include "contiki-conf.h"
|
||||
#include "dev/models.h"
|
||||
#include "dev/leds.h"
|
||||
|
||||
#include "cc2430_sfr.h"
|
||||
|
||||
/*
|
||||
* Sensinode v1.0 HW products have 2 red LEDs, LED1 is mapped to the Contiki
|
||||
* LEDS_RED and LED2 is mapped to LEDS_GREEN.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
leds_arch_init(void)
|
||||
{
|
||||
P0DIR |= 0x30;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
unsigned char
|
||||
leds_arch_get(void)
|
||||
{
|
||||
unsigned char l = 0;
|
||||
|
||||
if(LED1_PIN) {
|
||||
l |= LEDS_RED;
|
||||
}
|
||||
if(LED2_PIN) {
|
||||
l |= LEDS_GREEN;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
leds_arch_set(unsigned char leds)
|
||||
{
|
||||
if(leds & LEDS_RED) {
|
||||
LED1_PIN = 1;
|
||||
} else {
|
||||
LED1_PIN = 0;
|
||||
}
|
||||
|
||||
if(leds & LEDS_GREEN) {
|
||||
LED2_PIN = 1;
|
||||
} else {
|
||||
LED2_PIN = 0;
|
||||
}
|
||||
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
Loading…
Add table
Add a link
Reference in a new issue