aboutsummaryrefslogtreecommitdiffstats
path: root/touchpad.h
blob: 88e397a8771510fb3db9917f8fc23a332ebfcfa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef TOUCHPAD_H
#define TOUCHPAD_H

#include "ch.h"
#include "hal.h"

#define CONVERSIONS 3

#define SET_CS(a)		(TP_PORT->BSRR = 1 << (TP_CS + (a ? 0 : 16)))

void tpInit(void);
void tpWriteData(uint8_t data);
void tpDrawCross(uint16_t x, uint16_t y);
uint16_t tpReadData(void);
uint16_t tpReadX(void);
uint16_t tpReadY(void);

#endif