Contiki 2.5
Functions
key.h File Reference

 This file provides joystick operations.
More...

#include <stdint.h>
#include <avr/io.h>
#include <avr/pgmspace.h>

Go to the source code of this file.

Macros

Port definition for reading the joystick input.
#define KEY_PORT   PINF
 
#define KEY_PUR   PORTF
 
#define KEY_DDR   DDRF
 
#define KEY_PIN   PINF1
 
Port defininition for the joystick Enter button.
#define ENTER_PORT   PINE
 
#define ENTER_PUR   PORTE
 
#define ENTER_DDR   DDRE
 
#define ENTER_PIN   PINE2
 
Valid Key States.
#define KEY_STATE_UP   0x01
 
#define KEY_STATE_DOWN   0x02
 
#define KEY_STATE_LEFT   0x04
 
#define KEY_STATE_RIGHT   0x08
 
#define KEY_STATE_ENTER   0x10
 
#define KEY_STATE_NO_KEY   0x00
 
#define KEY_STATE_DONE   0x20
 

Functions

void key_init (void)
 This will intialize the joystick and the ADC for button readings.
 
void key_deinit (void)
 This will disable the ADC used for button readings.
 
key_state_t key_task (void)
 This will check the joystick state to return the current button status. More...
 
key_state_t key_state_get (void)
 This function will start the ADC conversion and read the current converstion value to determine the button position. More...
 
uint8_t is_button (void)
 This will poll run key_task() to determine if a button has been pressed. More...
 
uint8_t get_button (void)
 This function will wait for a user to press a button. More...
 

Detailed Description

 This file provides joystick operations.

Combined with ADC functions.

Author
Mike Vidales mavid.nosp@m.a404.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

Definition in file key.h.