gadget-kspconsole/adc.h

36 lines
1.1 KiB
C
Raw Permalink Normal View History

2023-11-27 15:13:55 +01:00
/*
* Copyright (C) 2023 Daniele Lacamera <root@danielinux.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ADC_H_INCLUDED
#define ADC_H_INCLUDED
#define POTL_PIN 0
#define POTL_CHANNEL 0
#define POTR_PIN 6
#define POTR_CHANNEL 4
#define JOYX_PIN 9
#define JOYX_CHANNEL 7
#define JOYY_PIN 8
#define JOYY_CHANNEL 6
int adc_init(void);
int adc_read(void);
void pot_read(uint32_t *potl, uint32_t *potr);
void joy_read(uint32_t *joy_x, uint32_t *joy_y);
#endif