1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-19 09:42:11 +03:00

[sam] fixing analog on Due, normally

This commit is contained in:
Thibaut VIARD
2011-11-21 12:16:54 +01:00
parent 062278262d
commit 7cbb284eb4
11 changed files with 146 additions and 27 deletions

View File

@ -153,7 +153,8 @@ create_output:
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# "$(CC)" -v -c $(CFLAGS) -Wa,aln=$(subst .o,.s,$@) $< -o $@
@"$(CC)" -c $(CFLAGS) $< -o $@
# @"$(CC)" -c $(CFLAGS) $< -o $@
"$(CC)" -c $(CFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
@"$(AS)" -c $(ASFLAGS) $< -o $@

View File

@ -223,7 +223,16 @@ extern void adc_disable_channel(Adc *p_adc, adc_channel_num_t adc_ch);
* \retval 1 means the specified channel is enabled.
* 0 means the specified channel is disabled.
*/
extern uint32_t adc_get_status(Adc *p_adc, adc_channel_num_t adc_ch);
extern uint32_t adc_get_channel_status(Adc *p_adc, adc_channel_num_t adc_ch);
/**
* \brief Reads the ADC status.
*
* \param p_adc Pointer to an ADC instance.
*
* \retval ADC status register content.
*/
extern uint32_t adc_get_status(Adc *p_adc);
/**
* \brief Reads the ADC result data of the specified channel.

View File

@ -126,7 +126,16 @@ extern void adc12_disable_channel(Adc12b *p_adc, adc_channel_num_t adc_ch);
* \retval 1 means the specified channel is enabled.
* 0 means the specified channel is disabled.
*/
extern uint32_t adc12_get_status(Adc12b *p_adc, adc_channel_num_t adc_ch);
extern uint32_t adc12_get_channel_status(Adc12b *p_adc, adc_channel_num_t adc_ch);
/**
* \brief Reads the ADC status.
*
* \param p_adc Pointer to an ADC instance.
*
* \retval ADC status register content.
*/
extern uint32_t adc12_get_status(Adc12b *p_adc);
/**
* \brief Reads the ADC result data of the specified channel.

View File

@ -194,7 +194,25 @@ extern void adc_disable_channel( Adc *p_adc, adc_channel_num_t adc_ch ) ;
* \retval 1 means the specified channel is enabled.
* 0 means the specified channel is disabled.
*/
extern uint32_t adc_get_status(Adc *p_adc, adc_channel_num_t adc_ch);
extern uint32_t adc_get_channel_status(Adc *p_adc, adc_channel_num_t adc_ch);
/**
* \brief Reads the ADC status.
*
* \param p_adc Pointer to an ADC instance.
*
* \retval ADC status register content.
*/
extern uint32_t adc_get_status(Adc *p_adc);
/**
* \brief Reads the ADC overrun status.
*
* \param p_adc Pointer to an ADC instance.
*
* \retval ADC ovverrun status register content.
*/
extern uint32_t adc_get_overrun_status(Adc *p_adc);
/**
* \brief Reads the ADC result data of the specified channel.

View File

@ -179,11 +179,23 @@ void adc_disable_channel(Adc *p_adc, adc_channel_num_t adc_ch)
* \retval 1 means the specified channel is enabled.
* 0 means the specified channel is disabled.
*/
uint32_t adc_get_status(Adc *p_adc, adc_channel_num_t adc_ch)
uint32_t adc_get_channel_status(Adc *p_adc, adc_channel_num_t adc_ch)
{
return p_adc->ADC_CHSR & (1 << adc_ch);
}
/**
* \brief Reads the ADC status.
*
* \param p_adc Pointer to an ADC instance.
*
* \retval ADC status register content.
*/
uint32_t adc_get_status(Adc *p_adc)
{
return p_adc->ADC_SR;
}
/**
* \brief Reads the ADC result data of the specified channel.
*

View File

@ -179,11 +179,23 @@ void adc12_disable_channel(Adc12b *p_adc, adc_channel_num_t adc_ch)
* \retval 1 means the specified channel is enabled.
* 0 means the specified channel is disabled.
*/
uint32_t adc12_get_status(Adc12b *p_adc, adc_channel_num_t adc_ch)
uint32_t adc12_get_channel_status(Adc12b *p_adc, adc_channel_num_t adc_ch)
{
return p_adc->ADC12B_CHSR & (1 << adc_ch);
}
/**
* \brief Reads the ADC status.
*
* \param p_adc Pointer to an ADC instance.
*
* \retval ADC status register content.
*/
uint32_t adc12_get_status(Adc12b *p_adc)
{
return p_adc->ADC12B_SR;
}
/**
* \brief Reads the ADC result data of the specified channel.
*

View File

@ -270,11 +270,35 @@ void adc_disable_channel(Adc *p_adc, adc_channel_num_t adc_ch)
* \retval 1 means the specified channel is enabled.
* 0 means the specified channel is disabled.
*/
uint32_t adc_get_status(Adc *p_adc, adc_channel_num_t adc_ch)
uint32_t adc_get_channnel_status(Adc *p_adc, adc_channel_num_t adc_ch)
{
return p_adc->ADC_CHSR & (1 << adc_ch);
}
/**
* \brief Reads the ADC status.
*
* \param p_adc Pointer to an ADC instance.
*
* \retval ADC status register content.
*/
uint32_t adc_get_status(Adc *p_adc)
{
return p_adc->ADC_ISR;
}
/**
* \brief Reads the ADC overrun status.
*
* \param p_adc Pointer to an ADC instance.
*
* \retval ADC overrun status register content.
*/
uint32_t adc_get_overrun_status(Adc *p_adc)
{
return p_adc->ADC_OVER;
}
/**
* \brief Reads the ADC result data of the specified channel.
*