BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
902aa40
Branches
Tags
master
mips_sys
fw
switches.c
replace email address in headers with blinkenarea address
Stefan Schuermans
commited
902aa40
at 2012-05-21 17:42:50
switches.c
Blame
History
Raw
/* MIPS I system * Copyright 2011-2012 Stefan Schuermans <stefan@blinkenarea.org> * Copyleft GNU public license V2 or later * http://www.gnu.org/copyleft/gpl.html */ #include "switches.h" static volatile unsigned int *const switches_ptr = (volatile unsigned int *)0x80000200; /** * @brief get state of switch * @param[in] sw swich identifier * @return switch state */ int switches_get_state(t_switch sw) { return switches_ptr[0] >> sw & 1; } /** * @brief get rotation counter of rotary switch * @return rotation counter */ unsigned int switches_get_rot_cnt(void) { return switches_ptr[1]; }