temp

Dependencies:   mbed SDFileSystem MS5607 ADXL345_I2C FATFileSystem

Committer:
IKobayashi
Date:
Mon Mar 16 23:37:42 2020 +0900
Revision:
0:c88c3b616c00
copy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IKobayashi 0:c88c3b616c00 1
IKobayashi 0:c88c3b616c00 2 /** \addtogroup hal */
IKobayashi 0:c88c3b616c00 3 /** @{*/
IKobayashi 0:c88c3b616c00 4 /* mbed Microcontroller Library
IKobayashi 0:c88c3b616c00 5 * Copyright (c) 2006-2016 ARM Limited
IKobayashi 0:c88c3b616c00 6 *
IKobayashi 0:c88c3b616c00 7 * Licensed under the Apache License, Version 2.0 (the "License");
IKobayashi 0:c88c3b616c00 8 * you may not use this file except in compliance with the License.
IKobayashi 0:c88c3b616c00 9 * You may obtain a copy of the License at
IKobayashi 0:c88c3b616c00 10 *
IKobayashi 0:c88c3b616c00 11 * http://www.apache.org/licenses/LICENSE-2.0
IKobayashi 0:c88c3b616c00 12 *
IKobayashi 0:c88c3b616c00 13 * Unless required by applicable law or agreed to in writing, software
IKobayashi 0:c88c3b616c00 14 * distributed under the License is distributed on an "AS IS" BASIS,
IKobayashi 0:c88c3b616c00 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
IKobayashi 0:c88c3b616c00 16 * See the License for the specific language governing permissions and
IKobayashi 0:c88c3b616c00 17 * limitations under the License.
IKobayashi 0:c88c3b616c00 18 */
IKobayashi 0:c88c3b616c00 19 #ifndef MBED_CAN_API_H
IKobayashi 0:c88c3b616c00 20 #define MBED_CAN_API_H
IKobayashi 0:c88c3b616c00 21
IKobayashi 0:c88c3b616c00 22 #include "device.h"
IKobayashi 0:c88c3b616c00 23
IKobayashi 0:c88c3b616c00 24 #if DEVICE_CAN
IKobayashi 0:c88c3b616c00 25
IKobayashi 0:c88c3b616c00 26 #include "PinNames.h"
IKobayashi 0:c88c3b616c00 27 #include "PeripheralNames.h"
IKobayashi 0:c88c3b616c00 28 #include "hal/can_helper.h"
IKobayashi 0:c88c3b616c00 29
IKobayashi 0:c88c3b616c00 30 #ifdef __cplusplus
IKobayashi 0:c88c3b616c00 31 extern "C" {
IKobayashi 0:c88c3b616c00 32 #endif
IKobayashi 0:c88c3b616c00 33
IKobayashi 0:c88c3b616c00 34 typedef enum {
IKobayashi 0:c88c3b616c00 35 IRQ_RX,
IKobayashi 0:c88c3b616c00 36 IRQ_TX,
IKobayashi 0:c88c3b616c00 37 IRQ_ERROR,
IKobayashi 0:c88c3b616c00 38 IRQ_OVERRUN,
IKobayashi 0:c88c3b616c00 39 IRQ_WAKEUP,
IKobayashi 0:c88c3b616c00 40 IRQ_PASSIVE,
IKobayashi 0:c88c3b616c00 41 IRQ_ARB,
IKobayashi 0:c88c3b616c00 42 IRQ_BUS,
IKobayashi 0:c88c3b616c00 43 IRQ_READY
IKobayashi 0:c88c3b616c00 44 } CanIrqType;
IKobayashi 0:c88c3b616c00 45
IKobayashi 0:c88c3b616c00 46
IKobayashi 0:c88c3b616c00 47 typedef enum {
IKobayashi 0:c88c3b616c00 48 MODE_RESET,
IKobayashi 0:c88c3b616c00 49 MODE_NORMAL,
IKobayashi 0:c88c3b616c00 50 MODE_SILENT,
IKobayashi 0:c88c3b616c00 51 MODE_TEST_LOCAL,
IKobayashi 0:c88c3b616c00 52 MODE_TEST_GLOBAL,
IKobayashi 0:c88c3b616c00 53 MODE_TEST_SILENT
IKobayashi 0:c88c3b616c00 54 } CanMode;
IKobayashi 0:c88c3b616c00 55
IKobayashi 0:c88c3b616c00 56 typedef void (*can_irq_handler)(uint32_t id, CanIrqType type);
IKobayashi 0:c88c3b616c00 57
IKobayashi 0:c88c3b616c00 58 typedef struct can_s can_t;
IKobayashi 0:c88c3b616c00 59
IKobayashi 0:c88c3b616c00 60 void can_init (can_t *obj, PinName rd, PinName td);
IKobayashi 0:c88c3b616c00 61 void can_free (can_t *obj);
IKobayashi 0:c88c3b616c00 62 int can_frequency(can_t *obj, int hz);
IKobayashi 0:c88c3b616c00 63
IKobayashi 0:c88c3b616c00 64 void can_irq_init (can_t *obj, can_irq_handler handler, uint32_t id);
IKobayashi 0:c88c3b616c00 65 void can_irq_free (can_t *obj);
IKobayashi 0:c88c3b616c00 66 void can_irq_set (can_t *obj, CanIrqType irq, uint32_t enable);
IKobayashi 0:c88c3b616c00 67
IKobayashi 0:c88c3b616c00 68 int can_write (can_t *obj, CAN_Message, int cc);
IKobayashi 0:c88c3b616c00 69 int can_read (can_t *obj, CAN_Message *msg, int handle);
IKobayashi 0:c88c3b616c00 70 int can_mode (can_t *obj, CanMode mode);
IKobayashi 0:c88c3b616c00 71 int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle);
IKobayashi 0:c88c3b616c00 72 void can_reset (can_t *obj);
IKobayashi 0:c88c3b616c00 73 unsigned char can_rderror (can_t *obj);
IKobayashi 0:c88c3b616c00 74 unsigned char can_tderror (can_t *obj);
IKobayashi 0:c88c3b616c00 75 void can_monitor (can_t *obj, int silent);
IKobayashi 0:c88c3b616c00 76
IKobayashi 0:c88c3b616c00 77 #ifdef __cplusplus
IKobayashi 0:c88c3b616c00 78 };
IKobayashi 0:c88c3b616c00 79 #endif
IKobayashi 0:c88c3b616c00 80
IKobayashi 0:c88c3b616c00 81 #endif // MBED_CAN_API_H
IKobayashi 0:c88c3b616c00 82
IKobayashi 0:c88c3b616c00 83 #endif
IKobayashi 0:c88c3b616c00 84
IKobayashi 0:c88c3b616c00 85 /** @}*/