ADC injected sequence register (ADC_JSQR)
Регистр назначения инжектированных каналов АЦП
Смещение (Address offset): 0x38
Reset value: 0x0000'0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 |
| Reserved | |||||||
| --- | --- | --- | --- | --- | --- | --- | --- |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Reserved | JL[1:0] | JSQ4[4:1] | |||||
| --- | rw | rw | |||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 |
| JSQ4[0] | JSQ3[4:0] | JSQ2[4:3] | |||||
| rw | rw | rw | |||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| JSQ2[2:0] | JSQ1[4:0] | ||||||
| rw | rw | ||||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
00 : 1 преобразование;
01 : 2 преобразования;
10 : 3 преобразования;
11 : 4 преобразования;
Номера входных каналов от 0 до 15 (от ADC_IN0 до ADC_IN15) - внешние входы.
ADC1: ADC_IN16 - датчик температуры, ADC_IN17 - опорное напряжение.
ADC2: ADC_IN16, ADC_IN17 - подключены к Vss ("земля").
ADC3: ADC_IN9, ADC_IN14, ADC_IN15, ADC_IN16, ADC_IN17 - подключены к Vss ("земля").
Назначения остальным каналам производятся аналогично.
Примечание:
JL[1:0] = 0 = 0b00 : выполняется преобразование канала JQS4;
JL[1:0] = 1 = 0b01 : выполняется преобразование каналов JSQ3, JQS4;
JL[1:0] = 2 = 0b10 : выполняется преобразование каналов JSQ2, JSQ3, JQS4;
JL[1:0] = 3 = 0b11 : выполняется преобразование каналов JSQ1, JSQ2, JSQ3, JQS4;
//- stm32f10x.h
/******************* Bit definition for ADC_JSQR register *******************/
#define ADC_JSQR_JSQ1 ((uint32_t)0x0000001F) /* JSQ1[4:0] bits (1st conversion in injected sequence) */
#define ADC_JSQR_JSQ1_0 ((uint32_t)0x00000001) /* Bit 0 */
#define ADC_JSQR_JSQ1_1 ((uint32_t)0x00000002) /* Bit 1 */
#define ADC_JSQR_JSQ1_2 ((uint32_t)0x00000004) /* Bit 2 */
#define ADC_JSQR_JSQ1_3 ((uint32_t)0x00000008) /* Bit 3 */
#define ADC_JSQR_JSQ1_4 ((uint32_t)0x00000010) /* Bit 4 */
#define ADC_JSQR_JSQ2 ((uint32_t)0x000003E0) /* JSQ2[4:0] bits (2nd conversion in injected sequence) */
#define ADC_JSQR_JSQ2_0 ((uint32_t)0x00000020) /* Bit 0 */
#define ADC_JSQR_JSQ2_1 ((uint32_t)0x00000040) /* Bit 1 */
#define ADC_JSQR_JSQ2_2 ((uint32_t)0x00000080) /* Bit 2 */
#define ADC_JSQR_JSQ2_3 ((uint32_t)0x00000100) /* Bit 3 */
#define ADC_JSQR_JSQ2_4 ((uint32_t)0x00000200) /* Bit 4 */
#define ADC_JSQR_JSQ3 ((uint32_t)0x00007C00) /* JSQ3[4:0] bits (3rd conversion in injected sequence) */
#define ADC_JSQR_JSQ3_0 ((uint32_t)0x00000400) /* Bit 0 */
#define ADC_JSQR_JSQ3_1 ((uint32_t)0x00000800) /* Bit 1 */
#define ADC_JSQR_JSQ3_2 ((uint32_t)0x00001000) /* Bit 2 */
#define ADC_JSQR_JSQ3_3 ((uint32_t)0x00002000) /* Bit 3 */
#define ADC_JSQR_JSQ3_4 ((uint32_t)0x00004000) /* Bit 4 */
#define ADC_JSQR_JSQ4 ((uint32_t)0x000F8000) /* JSQ4[4:0] bits (4th conversion in injected sequence) */
#define ADC_JSQR_JSQ4_0 ((uint32_t)0x00008000) /* Bit 0 */
#define ADC_JSQR_JSQ4_1 ((uint32_t)0x00010000) /* Bit 1 */
#define ADC_JSQR_JSQ4_2 ((uint32_t)0x00020000) /* Bit 2 */
#define ADC_JSQR_JSQ4_3 ((uint32_t)0x00040000) /* Bit 3 */
#define ADC_JSQR_JSQ4_4 ((uint32_t)0x00080000) /* Bit 4 */
#define ADC_JSQR_JL ((uint32_t)0x00300000) /* JL[1:0] bits (Injected Sequence length) */
#define ADC_JSQR_JL_0 ((uint32_t)0x00100000) /* Bit 0 */
#define ADC_JSQR_JL_1 ((uint32_t)0x00200000) /* Bit 1 */