mbed libraries for KL25Z
pwmout_api.h@3:aff886a69715, 2012-10-11 (annotated)
- Committer:
- emilmont
- Date:
- Thu Oct 11 09:43:01 2012 +0000
- Revision:
- 3:aff886a69715
- Parent:
- 2:e9a661555b58
- Child:
- 8:c14af7958ef5
us_ticker and I2C fixes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 2:e9a661555b58 | 1 | /* mbed Microcontroller Library - pwmout_api |
emilmont | 2:e9a661555b58 | 2 | * Copyright (c) 2009-2011 ARM Limited. All rights reserved. |
emilmont | 2:e9a661555b58 | 3 | */ |
emilmont | 2:e9a661555b58 | 4 | |
emilmont | 2:e9a661555b58 | 5 | #ifndef MBED_PWMOUT_API_H |
emilmont | 2:e9a661555b58 | 6 | #define MBED_PWMOUT_API_H |
emilmont | 2:e9a661555b58 | 7 | |
emilmont | 2:e9a661555b58 | 8 | #include "device.h" |
emilmont | 2:e9a661555b58 | 9 | |
emilmont | 2:e9a661555b58 | 10 | #if DEVICE_PWMOUT |
emilmont | 2:e9a661555b58 | 11 | |
emilmont | 2:e9a661555b58 | 12 | #include "PinNames.h" |
emilmont | 2:e9a661555b58 | 13 | #include "PeripheralNames.h" |
emilmont | 2:e9a661555b58 | 14 | |
emilmont | 2:e9a661555b58 | 15 | #ifdef __cplusplus |
emilmont | 2:e9a661555b58 | 16 | extern "C" { |
emilmont | 2:e9a661555b58 | 17 | #endif |
emilmont | 2:e9a661555b58 | 18 | |
emilmont | 2:e9a661555b58 | 19 | // Todo: Remove the lookup tables and add the actual values in the object |
emilmont | 2:e9a661555b58 | 20 | typedef struct { |
emilmont | 2:e9a661555b58 | 21 | #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) |
emilmont | 3:aff886a69715 | 22 | __IO uint32_t *MR; |
emilmont | 2:e9a661555b58 | 23 | PWMName pwm; |
emilmont | 2:e9a661555b58 | 24 | #elif defined(TARGET_LPC11U24) |
emilmont | 2:e9a661555b58 | 25 | PWMName pwm; |
emilmont | 2:e9a661555b58 | 26 | #elif defined(TARGET_KL25Z) |
emilmont | 2:e9a661555b58 | 27 | __IO uint32_t *MOD; |
emilmont | 2:e9a661555b58 | 28 | __IO uint32_t *CNT; |
emilmont | 2:e9a661555b58 | 29 | __IO uint32_t *CnV; |
emilmont | 2:e9a661555b58 | 30 | #endif |
emilmont | 2:e9a661555b58 | 31 | } pwmout_object; |
emilmont | 2:e9a661555b58 | 32 | |
emilmont | 2:e9a661555b58 | 33 | void pwmout_init (pwmout_object* obj, PinName pin); |
emilmont | 2:e9a661555b58 | 34 | void pwmout_free (pwmout_object* obj); |
emilmont | 2:e9a661555b58 | 35 | |
emilmont | 2:e9a661555b58 | 36 | void pwmout_write (pwmout_object* obj, float percent); |
emilmont | 2:e9a661555b58 | 37 | float pwmout_read (pwmout_object* obj); |
emilmont | 2:e9a661555b58 | 38 | |
emilmont | 2:e9a661555b58 | 39 | void pwmout_period (pwmout_object* obj, float seconds); |
emilmont | 2:e9a661555b58 | 40 | void pwmout_period_ms (pwmout_object* obj, int ms); |
emilmont | 2:e9a661555b58 | 41 | void pwmout_period_us (pwmout_object* obj, int us); |
emilmont | 2:e9a661555b58 | 42 | |
emilmont | 2:e9a661555b58 | 43 | void pwmout_pulsewidth (pwmout_object* obj, float seconds); |
emilmont | 2:e9a661555b58 | 44 | void pwmout_pulsewidth_ms(pwmout_object* obj, int ms); |
emilmont | 2:e9a661555b58 | 45 | void pwmout_pulsewidth_us(pwmout_object* obj, int us); |
emilmont | 2:e9a661555b58 | 46 | |
emilmont | 2:e9a661555b58 | 47 | #ifdef __cplusplus |
emilmont | 2:e9a661555b58 | 48 | } |
emilmont | 2:e9a661555b58 | 49 | #endif |
emilmont | 2:e9a661555b58 | 50 | |
emilmont | 2:e9a661555b58 | 51 | #endif |
emilmont | 2:e9a661555b58 | 52 | |
emilmont | 2:e9a661555b58 | 53 | #endif |