b15f/firmware/requests.h

63 lines
1.5 KiB
C
Raw Normal View History

2019-03-26 14:02:58 +00:00
#ifndef REQUESTS_H
#define REQUESTS_H
2019-03-27 14:48:36 +00:00
#include <avr/wdt.h>
2019-03-26 14:02:58 +00:00
#include "global_vars.h"
2019-04-03 10:05:08 +00:00
#include "selftest.h"
2019-03-27 14:48:36 +00:00
#include "boardinfo.h"
2019-03-26 14:02:58 +00:00
constexpr static uint8_t RQ_DISC = 0;
constexpr static uint8_t RQ_TEST = 1;
constexpr static uint8_t RQ_INFO = 2;
constexpr static uint8_t RQ_INT = 3;
2019-04-03 10:05:08 +00:00
constexpr static uint8_t RQ_ST = 4;
2019-03-26 15:30:49 +00:00
constexpr static uint8_t RQ_BA0 = 5;
constexpr static uint8_t RQ_BA1 = 6;
constexpr static uint8_t RQ_BE0 = 7;
constexpr static uint8_t RQ_BE1 = 8;
2019-04-03 07:34:22 +00:00
constexpr static uint8_t RQ_DSW = 9;
constexpr static uint8_t RQ_AA0 = 10;
constexpr static uint8_t RQ_AA1 = 11;
constexpr static uint8_t RQ_ADC = 12;
constexpr static uint8_t RQ_ADC_DAC_STROKE = 13;
2019-03-26 14:02:58 +00:00
2019-04-02 13:32:51 +00:00
uint8_t const rq_len[] = {
/* RQ_DISC */ 1,
/* RQ_TEST */ 2,
/* RQ_INFO */ 1,
2019-04-03 10:05:08 +00:00
/* RQ_INT */ 3,
/* RQ_ST */ 1,
/* RQ_BA0 */ 2,
/* RQ_BA1 */ 2,
/* RQ_BE0 */ 1,
/* RQ_BE1 */ 1,
/* RQ_DSW */ 1,
/* RQ_AA0 */ 3,
/* RQ_AA1 */ 3,
/* RQ_ADC */ 2,
2019-04-02 13:32:51 +00:00
/* RQ_ADC_DAC_STROKE */ 9
};
2019-04-03 12:58:50 +00:00
/**
* Hauptfunktion für die Verarbeitung einer neuen empfangen Request
*/
void handleRequest(void);
// spezifische Funktion für jede Request
2019-03-26 14:02:58 +00:00
void rqTestConnection(void);
void rqBoardInfo(void);
void rqTestIntConv(void);
void rqTestLongConv(void);
2019-04-03 10:05:08 +00:00
void rqSelfTest(void);
2019-03-26 15:30:49 +00:00
void rqDigitalWrite0(void);
void rqDigitalWrite1(void);
void rqDigitalRead0(void);
void rqDigitalRead1(void);
2019-04-03 07:34:22 +00:00
void rqReadDipSwitch(void);
2019-03-26 15:30:49 +00:00
void rqAnalogWrite0(void);
void rqAnalogWrite1(void);
void rqAnalogRead(void);
2019-03-27 09:33:26 +00:00
void rqAdcDacStroke(void);
2019-03-26 14:02:58 +00:00
#endif // REQUESTS_H