53 reg32 &= ~(0x7 << (channel * 3));
54 reg32 |= (time << (channel * 3));
58 reg32 &= ~(0x7 << ((channel - 10) * 3));
59 reg32 |= (time << ((channel - 10) * 3));
77 for (i = 0; i <= 9; i++) {
78 reg32 |= (time << (i * 3));
82 for (i = 10; i <= 17; i++) {
83 reg32 |= (time << ((i - 10) * 3));
102 uint32_t reg32_1 = 0, reg32_2 = 0, reg32_3 = 0, reg32_4 = 0;
110 for (i = 1; i <= length; i++) {
112 reg32_1 |= (channel[i - 1] << (i * 6));
114 if ((i > 4) && (i <= 9)) {
115 reg32_2 |= (channel[i - 1] << ((i - 4 - 1) * 6));
117 if ((i > 9) && (i <= 14)) {
118 reg32_3 |= (channel[i - 1] << ((i - 9 - 1) * 6));
120 if ((i > 14) && (i <= 16)) {
121 reg32_4 |= (channel[i - 1] << ((i - 14 - 1) * 6));
void adc_set_sample_time_on_all_channels(uint32_t adc, uint8_t time)
ADC Set the Sample Time for All Channels.
void adc_set_sample_time(uint32_t adc, uint8_t channel, uint8_t time)
ADC Set the Sample Time for a Single Channel.
void adc_set_regular_sequence(uint32_t adc, uint8_t length, uint8_t channel[])
ADC Set a Regular Channel Conversion Sequence.
#define ADC_SMPR1(adc)
Sample Time Register 1.