| | |
| | | #ifndef __MISCDEV_H |
| | | #define __MISCDEV_H |
| | | |
| | | #include <stdio.h> |
| | | |
| | | /* 定义ON/OFF两个宏,这样在代码中使用比 1/0 更具有可读性 */ |
| | | #define OFF 0 |
| | | #define ON 1 |
| | |
| | | /* Get $which led current status */ |
| | | extern int status_led(int which); |
| | | |
| | | /* |
| | | *+----------------------------+ |
| | | *| ADC noisy & lux sensor API | |
| | | *+----------------------------+ |
| | | */ |
| | | |
| | | enum |
| | | { |
| | | ADCCHN_NOISY, |
| | | ADCCHN_LUX, |
| | | ADCCHN_MAX, |
| | | }; |
| | | |
| | | extern int adc_sample_lux_noisy(uint32_t *lux, uint32_t *noisy); |
| | | |
| | | /* |
| | | *+----------------------------+ |
| | | *| Timer Buzzer/delay API | |
| | | *+----------------------------+ |
| | | */ |
| | | |
| | | /* Max to 60000 us */ |
| | | extern void udelay(uint16_t us); |
| | | |
| | | /* Turn buzzer on for $times */ |
| | | extern void beep_start(uint16_t times, uint16_t interval); |
| | | |
| | | #endif /* __MISCDEV_H */ |