BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
c2b0401
Branches
Tags
master
mips_sys
fw
switches.c
added file headers
Stefan Schuermans
commited
c2b0401
at 2012-04-08 11:54:40
switches.c
Blame
History
Raw
/* MIPS I system * Copyright 2011-2012 Stefan Schuermans <stefan@schuermans.info> * 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]; }