Programme d'utilisation des AX12 avec rajout de l'MX12
Fork of test_carteAToutFaire_PR by
mbed/can_helper.h@1:f3f702086a30, 2017-05-11 (annotated)
- Committer:
- ClementBreteau
- Date:
- Thu May 11 11:49:50 2017 +0000
- Revision:
- 1:f3f702086a30
test de la carte ? tout faire du petit robot
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ClementBreteau | 1:f3f702086a30 | 1 | /* mbed Microcontroller Library - can_helper |
ClementBreteau | 1:f3f702086a30 | 2 | * Copyright (c) 2009 ARM Limited. All rights reserved. |
ClementBreteau | 1:f3f702086a30 | 3 | */ |
ClementBreteau | 1:f3f702086a30 | 4 | |
ClementBreteau | 1:f3f702086a30 | 5 | #ifndef MBED_CAN_HELPER_H |
ClementBreteau | 1:f3f702086a30 | 6 | #define MBED_CAN_HELPER_H |
ClementBreteau | 1:f3f702086a30 | 7 | |
ClementBreteau | 1:f3f702086a30 | 8 | #ifdef __cplusplus |
ClementBreteau | 1:f3f702086a30 | 9 | extern "C" { |
ClementBreteau | 1:f3f702086a30 | 10 | #endif |
ClementBreteau | 1:f3f702086a30 | 11 | |
ClementBreteau | 1:f3f702086a30 | 12 | enum CANFormat { |
ClementBreteau | 1:f3f702086a30 | 13 | CANStandard = 0, |
ClementBreteau | 1:f3f702086a30 | 14 | CANExtended = 1 |
ClementBreteau | 1:f3f702086a30 | 15 | }; |
ClementBreteau | 1:f3f702086a30 | 16 | typedef enum CANFormat CANFormat; |
ClementBreteau | 1:f3f702086a30 | 17 | |
ClementBreteau | 1:f3f702086a30 | 18 | enum CANType { |
ClementBreteau | 1:f3f702086a30 | 19 | CANData = 0, |
ClementBreteau | 1:f3f702086a30 | 20 | CANRemote = 1 |
ClementBreteau | 1:f3f702086a30 | 21 | }; |
ClementBreteau | 1:f3f702086a30 | 22 | typedef enum CANType CANType; |
ClementBreteau | 1:f3f702086a30 | 23 | |
ClementBreteau | 1:f3f702086a30 | 24 | struct CAN_Message { |
ClementBreteau | 1:f3f702086a30 | 25 | unsigned int id; // 29 bit identifier |
ClementBreteau | 1:f3f702086a30 | 26 | unsigned char data[8]; // Data field |
ClementBreteau | 1:f3f702086a30 | 27 | unsigned char len; // Length of data field in bytes |
ClementBreteau | 1:f3f702086a30 | 28 | CANFormat format; // 0 - STANDARD, 1- EXTENDED IDENTIFIER |
ClementBreteau | 1:f3f702086a30 | 29 | CANType type; // 0 - DATA FRAME, 1 - REMOTE FRAME |
ClementBreteau | 1:f3f702086a30 | 30 | }; |
ClementBreteau | 1:f3f702086a30 | 31 | typedef struct CAN_Message CAN_Message; |
ClementBreteau | 1:f3f702086a30 | 32 | |
ClementBreteau | 1:f3f702086a30 | 33 | #ifdef __cplusplus |
ClementBreteau | 1:f3f702086a30 | 34 | }; |
ClementBreteau | 1:f3f702086a30 | 35 | #endif |
ClementBreteau | 1:f3f702086a30 | 36 | |
ClementBreteau | 1:f3f702086a30 | 37 | #endif // MBED_CAN_HELPER_H |