Programme d'utilisation servomotors MX12 V1
Fork of Utilisation_MX12 by
mbed/mbed_interface.h@0:80df663dd15e, 2017-05-19 (annotated)
- Committer:
- R66Y
- Date:
- Fri May 19 14:32:14 2017 +0000
- Revision:
- 0:80df663dd15e
programme pour utiliser les servomoteurs MX12.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
R66Y | 0:80df663dd15e | 1 | /* Title: mbed_interface |
R66Y | 0:80df663dd15e | 2 | * Functions to control the mbed interface |
R66Y | 0:80df663dd15e | 3 | * |
R66Y | 0:80df663dd15e | 4 | * mbed Microcontrollers have a built-in interface to provide functionality such as |
R66Y | 0:80df663dd15e | 5 | * drag-n-drop download, reset, serial-over-usb, and access to the mbed local file |
R66Y | 0:80df663dd15e | 6 | * system. These functions provide means to control the interface suing semihost |
R66Y | 0:80df663dd15e | 7 | * calls it supports. |
R66Y | 0:80df663dd15e | 8 | */ |
R66Y | 0:80df663dd15e | 9 | |
R66Y | 0:80df663dd15e | 10 | /* mbed Microcontroller Library - mbed_interface |
R66Y | 0:80df663dd15e | 11 | * Copyright (c) 2009-2011 ARM Limited. All rights reserved. |
R66Y | 0:80df663dd15e | 12 | */ |
R66Y | 0:80df663dd15e | 13 | |
R66Y | 0:80df663dd15e | 14 | #ifndef MBED_INTERFACE_H |
R66Y | 0:80df663dd15e | 15 | #define MBED_INTERFACE_H |
R66Y | 0:80df663dd15e | 16 | |
R66Y | 0:80df663dd15e | 17 | #ifdef __cplusplus |
R66Y | 0:80df663dd15e | 18 | extern "C" { |
R66Y | 0:80df663dd15e | 19 | #endif |
R66Y | 0:80df663dd15e | 20 | |
R66Y | 0:80df663dd15e | 21 | /* Function: mbed_interface_connected |
R66Y | 0:80df663dd15e | 22 | * Determine whether the mbed interface is connected, based on whether debug is enabled |
R66Y | 0:80df663dd15e | 23 | * |
R66Y | 0:80df663dd15e | 24 | * Variables: |
R66Y | 0:80df663dd15e | 25 | * returns - 1 if interface is connected, else 0 |
R66Y | 0:80df663dd15e | 26 | */ |
R66Y | 0:80df663dd15e | 27 | int mbed_interface_connected(void); |
R66Y | 0:80df663dd15e | 28 | |
R66Y | 0:80df663dd15e | 29 | /* Function: mbed_interface_reset |
R66Y | 0:80df663dd15e | 30 | * Instruct the mbed interface to reset, as if the reset button had been pressed |
R66Y | 0:80df663dd15e | 31 | * |
R66Y | 0:80df663dd15e | 32 | * Variables: |
R66Y | 0:80df663dd15e | 33 | * returns - 1 if successful, else 0 (e.g. interface not present) |
R66Y | 0:80df663dd15e | 34 | */ |
R66Y | 0:80df663dd15e | 35 | int mbed_interface_reset(void); |
R66Y | 0:80df663dd15e | 36 | |
R66Y | 0:80df663dd15e | 37 | /* Function: mbed_interface_disconnect |
R66Y | 0:80df663dd15e | 38 | * This will disconnect the debug aspect of the interface, so semihosting will be disabled. |
R66Y | 0:80df663dd15e | 39 | * The interface will still support the USB serial aspect |
R66Y | 0:80df663dd15e | 40 | * |
R66Y | 0:80df663dd15e | 41 | * Variables: |
R66Y | 0:80df663dd15e | 42 | * returns - 0 if successful, else -1 (e.g. interface not present) |
R66Y | 0:80df663dd15e | 43 | */ |
R66Y | 0:80df663dd15e | 44 | int mbed_interface_disconnect(void); |
R66Y | 0:80df663dd15e | 45 | |
R66Y | 0:80df663dd15e | 46 | /* Function: mbed_interface_powerdown |
R66Y | 0:80df663dd15e | 47 | * This will disconnect the debug aspect of the interface, and if the USB cable is not |
R66Y | 0:80df663dd15e | 48 | * connected, also power down the interface. If the USB cable is connected, the interface |
R66Y | 0:80df663dd15e | 49 | * will remain powered up and visible to the host |
R66Y | 0:80df663dd15e | 50 | * |
R66Y | 0:80df663dd15e | 51 | * Variables: |
R66Y | 0:80df663dd15e | 52 | * returns - 0 if successful, else -1 (e.g. interface not present) |
R66Y | 0:80df663dd15e | 53 | */ |
R66Y | 0:80df663dd15e | 54 | int mbed_interface_powerdown(void); |
R66Y | 0:80df663dd15e | 55 | |
R66Y | 0:80df663dd15e | 56 | /* Function: mbed_interface_uid |
R66Y | 0:80df663dd15e | 57 | * This returns a string containing the 32-character UID of the mbed interface |
R66Y | 0:80df663dd15e | 58 | * |
R66Y | 0:80df663dd15e | 59 | * This is a weak function that can be overwritten if required |
R66Y | 0:80df663dd15e | 60 | * |
R66Y | 0:80df663dd15e | 61 | * Variables: |
R66Y | 0:80df663dd15e | 62 | * uid - A 33-byte array to write the null terminated 32-byte string |
R66Y | 0:80df663dd15e | 63 | * returns - 0 if successful, else -1 (e.g. interface not present) |
R66Y | 0:80df663dd15e | 64 | */ |
R66Y | 0:80df663dd15e | 65 | int mbed_interface_uid(char *uid); |
R66Y | 0:80df663dd15e | 66 | |
R66Y | 0:80df663dd15e | 67 | /* Function: mbed_mac_address |
R66Y | 0:80df663dd15e | 68 | * This returns a unique 6-byte MAC address, based on the interface UID |
R66Y | 0:80df663dd15e | 69 | * |
R66Y | 0:80df663dd15e | 70 | * If the interface is not present, it returns a default fixed MAC address (00:02:F7:F0:00:00) |
R66Y | 0:80df663dd15e | 71 | * |
R66Y | 0:80df663dd15e | 72 | * This is a weak function that can be overwritten if you want to provide your own mechanism to |
R66Y | 0:80df663dd15e | 73 | * provide a MAC address. |
R66Y | 0:80df663dd15e | 74 | |
R66Y | 0:80df663dd15e | 75 | * Variables: |
R66Y | 0:80df663dd15e | 76 | * mac - A 6-byte array to write the MAC address |
R66Y | 0:80df663dd15e | 77 | */ |
R66Y | 0:80df663dd15e | 78 | void mbed_mac_address(char *mac); |
R66Y | 0:80df663dd15e | 79 | |
R66Y | 0:80df663dd15e | 80 | /* Function: mbed_die |
R66Y | 0:80df663dd15e | 81 | * Cause the mbed to flash the BLOD LED sequence |
R66Y | 0:80df663dd15e | 82 | */ |
R66Y | 0:80df663dd15e | 83 | void mbed_die(void); |
R66Y | 0:80df663dd15e | 84 | |
R66Y | 0:80df663dd15e | 85 | #ifdef __cplusplus |
R66Y | 0:80df663dd15e | 86 | } |
R66Y | 0:80df663dd15e | 87 | #endif |
R66Y | 0:80df663dd15e | 88 | |
R66Y | 0:80df663dd15e | 89 | #endif |