Add some extra defines to platform_defs.h (#227)
This commit is contained in:
parent
62b2d33e8f
commit
dff0633c20
@ -25,6 +25,11 @@
|
|||||||
#define NUM_PWM_SLICES _u(8)
|
#define NUM_PWM_SLICES _u(8)
|
||||||
#define NUM_SPIN_LOCKS _u(32)
|
#define NUM_SPIN_LOCKS _u(32)
|
||||||
#define NUM_UARTS _u(2)
|
#define NUM_UARTS _u(2)
|
||||||
|
#define NUM_I2CS _u(2)
|
||||||
|
#define NUM_SPIS _u(2)
|
||||||
|
|
||||||
|
#define NUM_ADC_CHANNELS _u(5)
|
||||||
|
|
||||||
#define NUM_BANK0_GPIOS _u(30)
|
#define NUM_BANK0_GPIOS _u(30)
|
||||||
|
|
||||||
#define PIO_INSTRUCTION_COUNT _u(32)
|
#define PIO_INSTRUCTION_COUNT _u(32)
|
||||||
|
@ -84,7 +84,7 @@ static inline void adc_gpio_init(uint gpio) {
|
|||||||
* \param input Input to select.
|
* \param input Input to select.
|
||||||
*/
|
*/
|
||||||
static inline void adc_select_input(uint input) {
|
static inline void adc_select_input(uint input) {
|
||||||
invalid_params_if(ADC, input > 4);
|
valid_params_if(ADC, input < NUM_ADC_CHANNELS);
|
||||||
hw_write_masked(&adc_hw->cs, input << ADC_CS_AINSEL_LSB, ADC_CS_AINSEL_BITS);
|
hw_write_masked(&adc_hw->cs, input << ADC_CS_AINSEL_LSB, ADC_CS_AINSEL_BITS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user