Small changes to SPI init defaults
This commit is contained in:
parent
f4737ad3e9
commit
b61273ba14
|
@ -140,7 +140,7 @@ public:
|
|||
unsigned long delay) {
|
||||
init_i2c_sw(&u8g2, gpio_chip, scl, sda, res, delay);
|
||||
}
|
||||
void initSpiHwAdvanced(uint8_t gpio_chip, uint8_t bus, uint8_t dc, uint8_t res,
|
||||
void initSpiHw(uint8_t gpio_chip, uint8_t bus, uint8_t dc, uint8_t res,
|
||||
uint8_t cs, unsigned int spi_mode, uint32_t max_speed) {
|
||||
init_spi_hw_advanced(&u8g2, gpio_chip, bus, dc, res, cs, spi_mode, max_speed);
|
||||
}
|
||||
|
|
|
@ -79,8 +79,9 @@ void init_i2c_sw(u8g2_t *u8g2, uint8_t gpio_chip, uint8_t scl, uint8_t sda,
|
|||
/*
|
||||
* Allocate user_data_struct for hardware SPI advanced.
|
||||
*/
|
||||
void init_spi_hw_advanced(u8g2_t *u8g2, uint8_t gpio_chip, uint8_t bus, uint8_t dc,
|
||||
uint8_t res, uint8_t cs, unsigned int spi_mode, uint32_t max_speed) {
|
||||
void init_spi_hw_advanced(u8g2_t *u8g2, uint8_t gpio_chip, uint8_t bus,
|
||||
uint8_t dc, uint8_t res, uint8_t cs, unsigned int spi_mode,
|
||||
uint32_t max_speed) {
|
||||
user_data_t *user_data = init_user_data(u8g2);
|
||||
user_data->gpio_chip = gpio_chip;
|
||||
user_data->bus = bus;
|
||||
|
@ -96,7 +97,8 @@ void init_spi_hw_advanced(u8g2_t *u8g2, uint8_t gpio_chip, uint8_t bus, uint8_t
|
|||
*/
|
||||
void init_spi_hw(u8g2_t *u8g2, uint8_t gpio_chip, uint8_t bus, uint8_t dc,
|
||||
uint8_t res, uint8_t cs) {
|
||||
init_spi_hw_advanced(u8g2, gpio_chip, bus, dc, res, cs, 0, 500000);
|
||||
init_spi_hw_advanced(u8g2, gpio_chip, bus, dc, res, cs,
|
||||
u8g2_GetU8x8(u8g2)->display_info->spi_mode, 500000);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue