fix for mbed lib issue 3 (i2c problem) see also https://mbed.org/users/mbed_official/code/mbed/issues/3 affected implementations: LPC812, LPC11U24, LPC1768, LPC2368, LPC4088

Fork of mbed-src by mbed official

Committer:
Shikaneo
Date:
Mon Aug 05 02:27:27 2013 +0000
Revision:
13:bd9ff402dd42
Parent:
10:3bc89ef62ce7
equipped timeout

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 10:3bc89ef62ce7 1 /****************************************************************************
emilmont 10:3bc89ef62ce7 2 * $Id:: power_api.h 6249 2011-01-25 19:23:47Z usb01267 $
emilmont 10:3bc89ef62ce7 3 * Project: NXP LPC11Uxx software example
emilmont 10:3bc89ef62ce7 4 *
emilmont 10:3bc89ef62ce7 5 * Description:
emilmont 10:3bc89ef62ce7 6 * Power API Header File for NXP LPC11Uxx Device Series
emilmont 10:3bc89ef62ce7 7 *
emilmont 10:3bc89ef62ce7 8 ****************************************************************************
emilmont 10:3bc89ef62ce7 9 * Software that is described herein is for illustrative purposes only
emilmont 10:3bc89ef62ce7 10 * which provides customers with programming information regarding the
emilmont 10:3bc89ef62ce7 11 * products. This software is supplied "AS IS" without any warranties.
emilmont 10:3bc89ef62ce7 12 * NXP Semiconductors assumes no responsibility or liability for the
emilmont 10:3bc89ef62ce7 13 * use of the software, conveys no license or title under any patent,
emilmont 10:3bc89ef62ce7 14 * copyright, or mask work right to the product. NXP Semiconductors
emilmont 10:3bc89ef62ce7 15 * reserves the right to make changes in the software without
emilmont 10:3bc89ef62ce7 16 * notification. NXP Semiconductors also make no representation or
emilmont 10:3bc89ef62ce7 17 * warranty that such application will be suitable for the specified
emilmont 10:3bc89ef62ce7 18 * use without further testing or modification.
emilmont 10:3bc89ef62ce7 19 ****************************************************************************/
emilmont 10:3bc89ef62ce7 20 #ifndef __LPC11UXX_POWER_API_H__
emilmont 10:3bc89ef62ce7 21 #define __LPC11UXX_POWER_API_H__
emilmont 10:3bc89ef62ce7 22
emilmont 10:3bc89ef62ce7 23 #ifdef __cplusplus
emilmont 10:3bc89ef62ce7 24 extern "C" {
emilmont 10:3bc89ef62ce7 25 #endif
emilmont 10:3bc89ef62ce7 26
emilmont 10:3bc89ef62ce7 27 #define PWRROMD_PRESENT
emilmont 10:3bc89ef62ce7 28
emilmont 10:3bc89ef62ce7 29 typedef struct _PWRD {
emilmont 10:3bc89ef62ce7 30 void (*set_pll)(unsigned int cmd[], unsigned int resp[]);
emilmont 10:3bc89ef62ce7 31 void (*set_power)(unsigned int cmd[], unsigned int resp[]);
emilmont 10:3bc89ef62ce7 32 } PWRD;
emilmont 10:3bc89ef62ce7 33
emilmont 10:3bc89ef62ce7 34 typedef struct _ROM {
emilmont 10:3bc89ef62ce7 35 #ifdef USBROMD_PRESENT
emilmont 10:3bc89ef62ce7 36 const USB * pUSBD;
emilmont 10:3bc89ef62ce7 37 #else
emilmont 10:3bc89ef62ce7 38 const unsigned p_usbd;
emilmont 10:3bc89ef62ce7 39 #endif /* USBROMD_PRESENT */
emilmont 10:3bc89ef62ce7 40 const unsigned p_clib;
emilmont 10:3bc89ef62ce7 41 const unsigned p_cand;
emilmont 10:3bc89ef62ce7 42 #ifdef PWRROMD_PRESENT
emilmont 10:3bc89ef62ce7 43 const PWRD * pPWRD;
emilmont 10:3bc89ef62ce7 44 #else
emilmont 10:3bc89ef62ce7 45 const unsigned p_pwrd;
emilmont 10:3bc89ef62ce7 46 #endif /* PWRROMD_PRESENT */
emilmont 10:3bc89ef62ce7 47 const unsigned p_dev1;
emilmont 10:3bc89ef62ce7 48 const unsigned p_dev2;
emilmont 10:3bc89ef62ce7 49 const unsigned p_dev3;
emilmont 10:3bc89ef62ce7 50 const unsigned p_dev4;
emilmont 10:3bc89ef62ce7 51 } ROM;
emilmont 10:3bc89ef62ce7 52
emilmont 10:3bc89ef62ce7 53 //PLL setup related definitions
emilmont 10:3bc89ef62ce7 54 #define CPU_FREQ_EQU 0 //main PLL freq must be equal to the specified
emilmont 10:3bc89ef62ce7 55 #define CPU_FREQ_LTE 1 //main PLL freq must be less than or equal the specified
emilmont 10:3bc89ef62ce7 56 #define CPU_FREQ_GTE 2 //main PLL freq must be greater than or equal the specified
emilmont 10:3bc89ef62ce7 57 #define CPU_FREQ_APPROX 3 //main PLL freq must be as close as possible the specified
emilmont 10:3bc89ef62ce7 58
emilmont 10:3bc89ef62ce7 59 #define PLL_CMD_SUCCESS 0 //PLL setup successfully found
emilmont 10:3bc89ef62ce7 60 #define PLL_INVALID_FREQ 1 //specified freq out of range (either input or output)
emilmont 10:3bc89ef62ce7 61 #define PLL_INVALID_MODE 2 //invalid mode (see above for valid) specified
emilmont 10:3bc89ef62ce7 62 #define PLL_FREQ_NOT_FOUND 3 //specified freq not found under specified conditions
emilmont 10:3bc89ef62ce7 63 #define PLL_NOT_LOCKED 4 //PLL not locked => no changes to the PLL setup
emilmont 10:3bc89ef62ce7 64
emilmont 10:3bc89ef62ce7 65 //power setup elated definitions
emilmont 10:3bc89ef62ce7 66 #define PARAM_DEFAULT 0 //default power settings (voltage regulator, flash interface)
emilmont 10:3bc89ef62ce7 67 #define PARAM_CPU_PERFORMANCE 1 //setup for maximum CPU performance (higher current, more computation)
emilmont 10:3bc89ef62ce7 68 #define PARAM_EFFICIENCY 2 //balanced setting (power vs CPU performance)
emilmont 10:3bc89ef62ce7 69 #define PARAM_LOW_CURRENT 3 //lowest active current, lowest CPU performance
emilmont 10:3bc89ef62ce7 70
emilmont 10:3bc89ef62ce7 71 #define PARAM_CMD_SUCCESS 0 //power setting successfully found
emilmont 10:3bc89ef62ce7 72 #define PARAM_INVALID_FREQ 1 //specified freq out of range (=0 or > 50 MHz)
emilmont 10:3bc89ef62ce7 73 #define PARAM_INVALID_MODE 2 //specified mode not valid (see above for valid)
emilmont 10:3bc89ef62ce7 74
emilmont 10:3bc89ef62ce7 75 #define MAX_CLOCK_KHZ_PARAM 50000
emilmont 10:3bc89ef62ce7 76
emilmont 10:3bc89ef62ce7 77 #ifdef __cplusplus
emilmont 10:3bc89ef62ce7 78 }
emilmont 10:3bc89ef62ce7 79 #endif
emilmont 10:3bc89ef62ce7 80
emilmont 10:3bc89ef62ce7 81 #endif /* __LPC11UXX_POWER_API_H__ */
emilmont 10:3bc89ef62ce7 82