Skip to content

Commit

Permalink
boards/xg23-pk6068a: add ADC lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jue89 committed Nov 22, 2022
1 parent 18e9167 commit ab86198
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions boards/xg23-pk6068a/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ config BOARD_XG23_PK6068A
select CPU_MODEL_EFR32ZG23A020F512GM48

# Put defined MCU peripherals here (in alphabetical order)
select HAS_PERIPH_ADC
select HAS_PERIPH_I2C
select HAS_PERIPH_SPI
select HAS_PERIPH_TIMER
Expand Down
1 change: 1 addition & 0 deletions boards/xg23-pk6068a/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CPU_FAM = efr32zg23
CPU_MODEL = efr32zg23a020f512gm48

# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
Expand Down
2 changes: 2 additions & 0 deletions boards/xg23-pk6068a/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ PIN 1 is the bottom-left contact when the header faces you horizontally.
| Timer | 0 | TIMER0 | | Default ztimer backend | EM1 |
| | 1 | LETIMER0 | | | EM3 |
| UART | 0 | EUSART1 | RX: PA9, TX: PA8 | Default STDIO output | EM1 |
| ADC_LINE | 0 | IADC0 | IN+: PA10, IN-: GND | Single-ended, V_ref: 2 * 1.21V | EM1 |
| | 1 | IADC0 | IN+: PA0, IN-:PA5 | Differential, V_ref: 2 * 1.21V | EM1 |

### User interface
| Peripheral | Mapped to | Pin | Comments |
Expand Down
32 changes: 32 additions & 0 deletions boards/xg23-pk6068a/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,38 @@ static const clk_div_t clk_div_config[] = {
#define CLK_DIV_NUMOF ARRAY_SIZE(clk_div_config)
/** @} */

/**
* @name ADC configuration
* @{
*/
static const adc_conf_t adc_config[] = {
{
.dev = IADC0,
.cmu = cmuClock_IADC0,
.reference = iadcCfgReferenceInt1V2,
.reference_mV = 1210,
.gain = iadcCfgAnalogGain0P5x,
.available_res = { ADC_RES_10BIT, ADC_RES_16BIT }
}
};

static const adc_chan_conf_t adc_channel_config[] = {
{
.dev = 0,
.input_pos = GPIO_PIN(PA, 10),
.input_neg = GPIO_UNDEF
},
{
.dev = 0,
.input_pos = GPIO_PIN(PA, 0),
.input_neg = GPIO_PIN(PA, 5)
},
};

#define ADC_DEV_NUMOF ARRAY_SIZE(adc_config)
#define ADC_NUMOF ARRAY_SIZE(adc_channel_config)
/** @} */

/**
* @name I2C configuration
* @{
Expand Down
4 changes: 4 additions & 0 deletions dist/tools/doccheck/exclude_patterns
Original file line number Diff line number Diff line change
Expand Up @@ -13133,3 +13133,7 @@ boards/xg23\-pk6068a/include/periph_conf\.h:[0-9]+: warning: Member timer_config
boards/xg23\-pk6068a/include/periph_conf\.h:[0-9]+: warning: Member UART_0_ISR_RX \(macro definition\) of file periph_conf\.h is not documented\.
boards/xg23\-pk6068a/include/periph_conf\.h:[0-9]+: warning: Member UART_NUMOF \(macro definition\) of file periph_conf\.h is not documented\.
boards/xg23\-pk6068a/include/periph_conf\.h:[0-9]+: warning: Member uart_config\[\] \(variable\) of file periph_conf\.h is not documented\.
boards/xg23\-pk6068a/include/periph_conf\.h:[0-9]+: warning: Member ADC_DEV_NUMOF \(macro definition\) of file periph_conf\.h is not documented\.
boards/xg23\-pk6068a/include/periph_conf\.h:[0-9]+: warning: Member ADC_NUMOF \(macro definition\) of file periph_conf\.h is not documented\.
boards/xg23\-pk6068a/include/periph_conf\.h:[0-9]+: warning: Member adc_config\[\] \(variable\) of file periph_conf\.h is not documented\.
boards/xg23\-pk6068a/include/periph_conf\.h:[0-9]+: warning: Member adc_channel_config\[\] \(variable\) of file periph_conf\.h is not documented\.

0 comments on commit ab86198

Please sign in to comment.