Programme d'utilisation des AX12 avec rajout de l'MX12

Fork of test_carteAToutFaire_PR by CRAC Team

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?

UserRevisionLine numberNew contents of line
ClementBreteau 1:f3f702086a30 1 /* Title: wait
ClementBreteau 1:f3f702086a30 2 * Generic wait functions.
ClementBreteau 1:f3f702086a30 3 *
ClementBreteau 1:f3f702086a30 4 * These provide simple NOP type wait capabilities.
ClementBreteau 1:f3f702086a30 5 *
ClementBreteau 1:f3f702086a30 6 * Example:
ClementBreteau 1:f3f702086a30 7 * > #include "mbed.h"
ClementBreteau 1:f3f702086a30 8 * >
ClementBreteau 1:f3f702086a30 9 * > DigitalOut heartbeat(LED1);
ClementBreteau 1:f3f702086a30 10 * >
ClementBreteau 1:f3f702086a30 11 * > int main() {
ClementBreteau 1:f3f702086a30 12 * > while (1) {
ClementBreteau 1:f3f702086a30 13 * > heartbeat = 1;
ClementBreteau 1:f3f702086a30 14 * > wait(0.5);
ClementBreteau 1:f3f702086a30 15 * > heartbeat = 0;
ClementBreteau 1:f3f702086a30 16 * > wait(0.5);
ClementBreteau 1:f3f702086a30 17 * > }
ClementBreteau 1:f3f702086a30 18 * > }
ClementBreteau 1:f3f702086a30 19 */
ClementBreteau 1:f3f702086a30 20
ClementBreteau 1:f3f702086a30 21 /* mbed Microcontroller Library - wait_api
ClementBreteau 1:f3f702086a30 22 * Copyright (c) 2009 ARM Limited. All rights reserved.
ClementBreteau 1:f3f702086a30 23 */
ClementBreteau 1:f3f702086a30 24
ClementBreteau 1:f3f702086a30 25 #ifndef MBED_WAIT_API_H
ClementBreteau 1:f3f702086a30 26 #define MBED_WAIT_API_H
ClementBreteau 1:f3f702086a30 27
ClementBreteau 1:f3f702086a30 28 #ifdef __cplusplus
ClementBreteau 1:f3f702086a30 29 extern "C" {
ClementBreteau 1:f3f702086a30 30 #endif
ClementBreteau 1:f3f702086a30 31
ClementBreteau 1:f3f702086a30 32 /* Function: wait
ClementBreteau 1:f3f702086a30 33 * Waits for a number of seconds, with microsecond resolution (within
ClementBreteau 1:f3f702086a30 34 * the accuracy of single precision floating point).
ClementBreteau 1:f3f702086a30 35 *
ClementBreteau 1:f3f702086a30 36 * Variables:
ClementBreteau 1:f3f702086a30 37 * s - number of seconds to wait
ClementBreteau 1:f3f702086a30 38 */
ClementBreteau 1:f3f702086a30 39 void wait(float s);
ClementBreteau 1:f3f702086a30 40
ClementBreteau 1:f3f702086a30 41 /* Function: wait_ms
ClementBreteau 1:f3f702086a30 42 * Waits a number of milliseconds.
ClementBreteau 1:f3f702086a30 43 *
ClementBreteau 1:f3f702086a30 44 * Variables:
ClementBreteau 1:f3f702086a30 45 * ms - the whole number of milliseconds to wait
ClementBreteau 1:f3f702086a30 46 */
ClementBreteau 1:f3f702086a30 47 void wait_ms(int ms);
ClementBreteau 1:f3f702086a30 48
ClementBreteau 1:f3f702086a30 49 /* Function: wait_us
ClementBreteau 1:f3f702086a30 50 * Waits a number of microseconds.
ClementBreteau 1:f3f702086a30 51 *
ClementBreteau 1:f3f702086a30 52 * Variables:
ClementBreteau 1:f3f702086a30 53 * us - the whole number of microseconds to wait
ClementBreteau 1:f3f702086a30 54 */
ClementBreteau 1:f3f702086a30 55 void wait_us(int us);
ClementBreteau 1:f3f702086a30 56
ClementBreteau 1:f3f702086a30 57 #ifdef TARGET_LPC11U24
ClementBreteau 1:f3f702086a30 58 /* Function: sleep
ClementBreteau 1:f3f702086a30 59 * Send the microcontroller to sleep
ClementBreteau 1:f3f702086a30 60 *
ClementBreteau 1:f3f702086a30 61 * The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the
ClementBreteau 1:f3f702086a30 62 * system clock to the core is stopped until a reset or an interrupt occurs. This eliminates
ClementBreteau 1:f3f702086a30 63 * dynamic power used by the processor, memory systems and buses. The processor, peripheral and
ClementBreteau 1:f3f702086a30 64 * memory state are maintained, and the peripherals continue to work and can generate interrupts.
ClementBreteau 1:f3f702086a30 65 *
ClementBreteau 1:f3f702086a30 66 * The processor can be woken up by any internal peripheral interrupt or external pin interrupt.
ClementBreteau 1:f3f702086a30 67 *
ClementBreteau 1:f3f702086a30 68 * Note: The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
ClementBreteau 1:f3f702086a30 69 * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
ClementBreteau 1:f3f702086a30 70 * able to access the LocalFileSystem
ClementBreteau 1:f3f702086a30 71 */
ClementBreteau 1:f3f702086a30 72 void sleep(void);
ClementBreteau 1:f3f702086a30 73
ClementBreteau 1:f3f702086a30 74 /* Function: deepsleep
ClementBreteau 1:f3f702086a30 75 * Send the microcontroller to deep sleep
ClementBreteau 1:f3f702086a30 76 *
ClementBreteau 1:f3f702086a30 77 * This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode
ClementBreteau 1:f3f702086a30 78 * has the same sleep features as sleep plus it powers down peripherals and clocks. All state
ClementBreteau 1:f3f702086a30 79 * is still maintained.
ClementBreteau 1:f3f702086a30 80 *
ClementBreteau 1:f3f702086a30 81 * The processor can only be woken up by an external interrupt on a pin or a watchdog timer.
ClementBreteau 1:f3f702086a30 82 *
ClementBreteau 1:f3f702086a30 83 * Note: The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
ClementBreteau 1:f3f702086a30 84 * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
ClementBreteau 1:f3f702086a30 85 * able to access the LocalFileSystem
ClementBreteau 1:f3f702086a30 86 */
ClementBreteau 1:f3f702086a30 87 void deepsleep(void);
ClementBreteau 1:f3f702086a30 88 #endif
ClementBreteau 1:f3f702086a30 89
ClementBreteau 1:f3f702086a30 90 #ifdef __cplusplus
ClementBreteau 1:f3f702086a30 91 }
ClementBreteau 1:f3f702086a30 92 #endif
ClementBreteau 1:f3f702086a30 93
ClementBreteau 1:f3f702086a30 94 #endif