-
Notifications
You must be signed in to change notification settings - Fork 0
/
Can.h
38 lines (29 loc) · 787 Bytes
/
Can.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef CAN_H
#define CAN_H
#include <inttypes.h>
#include "ch.h"
#include "hal.h"
#define USTAW_BIT(array, index) (array[(index) / 8] |= (1 << ((index) % 8)))
#define CZYSC_BIT(array, index) (array[(index) / 8] &= ~(1 << ((index) % 8)))
#define ODCZYTAJ_BIT(array, index) ((array[(index) / 8] & (1 << ((index) % 8))) ? 1 : 0)
extern CANRxFrame canRxMsg;
extern CANTxFrame canTxMsg1;
extern CANTxFrame canTxMsg2;
extern CANTxFrame canTxMsg3;
extern CANTxFrame canTxMsg4;
extern mutex_t digitalOutputsMutex;
extern mutex_t temperatureMutex;
extern mutex_t digitalInputsMutex;
extern mutex_t adcSampleMutex;
void startCanThread(void);
class Can
{
private:
public:
uint16_t rxID;
uint16_t txID1;
uint16_t txID2;
uint16_t txID3;
uint16_t txID4;
};
#endif