mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Revision:
619:034e698bc035
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/targets/hal/TARGET_WIZNET/TARGET_W7500x/W7500x_Peripheral_Library/W7500x_adc.c	Fri Sep 04 09:30:10 2015 +0100
@@ -0,0 +1,55 @@
+#include "W7500x.h"
+#include "W7500x_adc.h"
+
+void ADC_PowerDownEnable (FunctionalState NewState)
+{
+	if (NewState != DISABLE)    ADC->ADC_CTR = ADC_CTR_PWD_PD;
+	else                        ADC->ADC_CTR = ADC_CTR_PWD_NRMOP;
+}
+
+void ADC_ChannelSelect (ADC_CH num)
+{
+	assert_param(IS_ADC_CH_NUM(num));
+	ADC->ADC_CHSEL = num;
+}
+
+void ADC_Start (void)
+{
+	ADC->ADC_START = ADC_START_START;
+}
+
+uint16_t ADC_ReadData (void)
+{
+	return ((uint16_t)ADC->ADC_DATA);
+}
+
+void ADC_InterruptMask (FunctionalState NewState)
+{
+	if (NewState != DISABLE)    ADC->ADC_INT = ADC_INT_MASK_ENA;
+	else                        ADC->ADC_INT = ADC_INT_MASK_DIS;
+}
+
+uint8_t ADC_IsInterrupt (void)
+{
+	return (((uint8_t)ADC->ADC_INT && 0x01ul));
+}
+		
+void ADC_InterruptClear (void)
+{
+	ADC->ADC_INT = ADC_INTCLEAR;
+}
+
+void ADC_Init (void)
+{
+	// ADC_CLK on
+	ADC_PowerDownEnable(DISABLE);
+	//ADC_ChannelSelect(num);
+}
+
+void ADC_DeInit (void)
+{
+	// ADC_CLK off
+	ADC_PowerDownEnable(ENABLE);
+	ADC_InterruptMask(DISABLE);
+}
+