Rationalize board header pin defines, and add partner board headers (#192)
* Board definition header files for the iniital set of SparkFun rp2040 boards * Add default PICO_DEFAULT_I2C*, allow no PICO_DEFAULT_LED_PIN, no PICO_DEFAULT_UART* (instead of -1) Fixup SparkFun headers * Pimoroni board headers * Add LED related board defines PICO_CONFIGs (to pico_stdlib for now) * more board config changes * add Adafruit feather, itsybitsy, qtpy board headers * add PICO_DEFAULT_WS2812_POWER_PIN define * MOSI/MISO -> TX/RX, some UART cleanup.. make vgaboard.h defines take preference over pico.h ones * local change to tinyusb to cope with no default LED or UART * fix review issues Co-authored-by: Kirk Benell <github-stuff@accvec.com> Co-authored-by: ZodiusInfuser <christopher.parrott2@gmail.com> Co-authored-by: hathach <thach@tinyusb.org>
This commit is contained in:
committed by
graham sanderson
parent
839224c2a3
commit
7ee36e3328
@ -48,6 +48,10 @@ extern "C" {
|
||||
|
||||
typedef struct i2c_inst i2c_inst_t;
|
||||
|
||||
// PICO_CONFIG: PICO_DEFAULT_I2C, Define the default I2C for a board, default=undefined, group=hardware_i2c
|
||||
// PICO_CONFIG: PICO_DEFAULT_I2C_SDA_PIN, Define the default I2C SDA, min=0, max=29, default=undefined, group=hardware_i2c
|
||||
// PICO_CONFIG: PICO_DEFAULT_I2C_SCL_PIN, Define the default I2C SCL pin, min=0, max=29, default=undefined, group=hardware_i2c
|
||||
|
||||
/** The I2C identifiers for use in I2C functions.
|
||||
*
|
||||
* e.g. i2c_init(i2c0, 48000)
|
||||
@ -61,6 +65,14 @@ extern i2c_inst_t i2c1_inst;
|
||||
#define i2c0 (&i2c0_inst) ///< Identifier for I2C HW Block 0
|
||||
#define i2c1 (&i2c1_inst) ///< Identifier for I2C HW Block 1
|
||||
|
||||
#if !defined(PICO_DEFAULT_I2C_INSTANCE) && defined(PICO_DEFAULT_I2C)
|
||||
#define PICO_DEFAULT_I2C_INSTANCE (__CONCAT(i2c,PICO_DEFAULT_I2C))
|
||||
#endif
|
||||
|
||||
#ifdef PICO_DEFAULT_I2C_INSTANCE
|
||||
#define i2c_default PICO_DEFAULT_I2C_INSTANCE
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -126,7 +138,7 @@ struct i2c_inst {
|
||||
* \ingroup hardware_i2c
|
||||
*
|
||||
* \param i2c I2C instance
|
||||
* \return Number of UART, 0 or 1.
|
||||
* \return Number of I2C, 0 or 1.
|
||||
*/
|
||||
static inline uint i2c_hw_index(i2c_inst_t *i2c) {
|
||||
invalid_params_if(I2C, i2c != i2c0 && i2c != i2c1);
|
||||
|
Reference in New Issue
Block a user