mbed

Dependents:   DHTSensor_Test K64F_eCompass_OneNET_JW

Committer:
mbotkinl
Date:
Wed Feb 25 20:22:22 2015 +0000
Revision:
0:2cc6bb4d7fea
Working code to read Temperature and Humidity readings

Who changed what in which revision?

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