Merge pull request #1700 from sgjava/master

Small changes to SPI init defaults
This commit is contained in:
olikraus 2021-11-18 18:58:38 +01:00 committed by GitHub
commit e0f5bc1af3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -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);
}

View File

@ -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);
}
/*