From 079cf9a8c625086eb9177dddad98f04be23c32aa Mon Sep 17 00:00:00 2001 From: Reed Williams Date: Thu, 11 Jun 2020 10:16:37 -0400 Subject: [PATCH] First attempt to naively update to Master-Follower --- common_features.mk | 2 +- docs/config_options.md | 10 +- docs/eeprom_driver.md | 2 +- docs/feature_ps2_mouse.md | 2 +- docs/feature_rgblight.md | 4 +- docs/feature_split_keyboard.md | 6 +- docs/feature_wpm.md | 2 +- docs/i2c_driver.md | 10 +- docs/serial_driver.md | 2 +- docs/spi_driver.md | 12 +- drivers/avr/{i2c_slave.c => i2c_follower.c} | 30 ++-- drivers/avr/{i2c_slave.h => i2c_follower.h} | 16 +- drivers/avr/i2c_master.c | 4 +- drivers/avr/serial.c | 22 +-- drivers/avr/spi_master.c | 60 +++---- drivers/avr/spi_master.h | 2 +- drivers/chibios/serial.c | 24 +-- drivers/chibios/serial_usart.c | 22 +-- drivers/chibios/spi_master.c | 18 +- drivers/chibios/spi_master.h | 2 +- drivers/chibios/ws2812_spi.c | 2 +- drivers/eeprom/eeprom_spi.c | 2 +- drivers/eeprom/eeprom_spi.h | 6 +- drivers/gpio/pca9555.c | 22 +-- drivers/gpio/pca9555.h | 10 +- keyboards/ai03/orbit/matrix.c | 6 +- keyboards/ai03/orbit/orbit.c | 4 +- keyboards/ai03/orbit/serial.c | 22 +-- keyboards/ai03/orbit/split_util.c | 10 +- keyboards/ai03/orbit/transport.c | 70 ++++---- keyboards/ai03/orbit/transport.h | 6 +- keyboards/butterstick/sten.h | 2 +- keyboards/cannonkeys/bluepill/ws2812.c | 2 +- keyboards/centromere/matrix.c | 2 +- keyboards/chidori/board.c | 44 ++--- keyboards/chimera_ergo/matrix.c | 2 +- keyboards/chimera_ls/matrix.c | 2 +- keyboards/chimera_ortho/matrix.c | 2 +- keyboards/chimera_ortho_plus/matrix.c | 2 +- keyboards/claw44/i2c.c | 54 +++--- keyboards/claw44/i2c.h | 6 +- keyboards/claw44/rev1/matrix.c | 38 ++--- keyboards/claw44/rev1/split_scomm.c | 42 ++--- keyboards/claw44/rev1/split_scomm.h | 10 +- keyboards/claw44/rev1/split_util.c | 8 +- keyboards/claw44/rev1/split_util.h | 6 +- keyboards/claw44/serial.c | 34 ++-- keyboards/claw44/serial.h | 8 +- keyboards/comet46/i2c.c | 54 +++--- keyboards/comet46/i2c.h | 6 +- keyboards/comet46/matrix.c | 2 +- keyboards/converter/ibm_terminal/config.h | 2 +- keyboards/crkbd/i2c.c | 54 +++--- keyboards/crkbd/i2c.h | 6 +- keyboards/crkbd/keymaps/kidbrazil/keymap.c | 6 +- keyboards/crkbd/keymaps/rpbaptist/readme.md | 2 +- keyboards/crkbd/rev1/matrix.c | 38 ++--- .../crkbd/rev1/serial_config_simpleapi.h | 2 +- keyboards/crkbd/rev1/split_scomm.c | 42 ++--- keyboards/crkbd/rev1/split_scomm.h | 10 +- keyboards/crkbd/rev1/split_util.c | 14 +- keyboards/crkbd/rev1/split_util.h | 6 +- keyboards/crkbd/serial.c | 34 ++-- keyboards/crkbd/serial.h | 8 +- keyboards/dc01/arrow/matrix.c | 10 +- keyboards/dc01/arrow/rules.mk | 2 +- keyboards/dc01/left/i2c.c | 54 +++--- keyboards/dc01/left/i2c.h | 6 +- keyboards/dc01/left/matrix.c | 14 +- keyboards/dc01/numpad/matrix.c | 10 +- keyboards/dc01/numpad/rules.mk | 2 +- keyboards/dc01/right/matrix.c | 10 +- keyboards/dc01/right/rules.mk | 2 +- keyboards/dichotomy/dichotomy.c | 2 +- keyboards/dichotomy/matrix.c | 2 +- keyboards/dm9records/ergoinu/matrix.c | 14 +- keyboards/dm9records/ergoinu/serial.c | 64 +++---- keyboards/dm9records/ergoinu/serial.h | 10 +- keyboards/dm9records/ergoinu/serial_config.h | 2 +- keyboards/dm9records/ergoinu/split_util.c | 6 +- keyboards/dm9records/ergoinu/split_util.h | 4 +- keyboards/ergodash/rev1/config.h | 2 +- keyboards/ergodone/i2cmaster.h | 2 +- keyboards/ergodox_infinity/visualizer.c | 8 +- keyboards/ergoslab/rev1/config.h | 2 +- keyboards/fc660c/i2c.c | 54 +++--- keyboards/fc660c/i2c.h | 6 +- keyboards/fc980c/i2c.c | 54 +++--- keyboards/fc980c/i2c.h | 6 +- keyboards/gboards/engine/engine.h | 2 +- keyboards/gboards/g/engine.h | 2 +- keyboards/georgi/sten.h | 2 +- keyboards/hadron/i2c.c | 54 +++--- keyboards/hadron/i2c.h | 6 +- .../handwired/108key_trackpoint/config.h | 2 +- keyboards/handwired/dactyl/i2cmaster.h | 2 +- keyboards/handwired/dactyl_manuform/readme.md | 2 +- keyboards/handwired/dactyl_promicro/readme.md | 2 +- keyboards/handwired/frenchdev/readme.md | 2 +- keyboards/handwired/myskeeb/oled.c | 2 +- keyboards/handwired/not_so_minidox/i2c.c | 54 +++--- keyboards/handwired/not_so_minidox/i2c.h | 6 +- keyboards/handwired/not_so_minidox/matrix.c | 26 +-- keyboards/handwired/not_so_minidox/serial.c | 56 +++--- keyboards/handwired/not_so_minidox/serial.h | 10 +- .../handwired/not_so_minidox/split_util.c | 14 +- .../handwired/not_so_minidox/split_util.h | 8 +- keyboards/handwired/promethium/config.h | 2 +- keyboards/handwired/trackpoint/config.h | 2 +- keyboards/handwired/xealous/readme.md | 2 +- keyboards/helix/local_drivers/i2c.c | 54 +++--- keyboards/helix/local_drivers/i2c.h | 6 +- keyboards/helix/local_drivers/serial.c | 34 ++-- keyboards/helix/local_drivers/serial.h | 8 +- keyboards/helix/pico/config.h | 2 +- keyboards/helix/pico/matrix.c | 32 ++-- keyboards/helix/pico/pico.c | 2 +- keyboards/helix/pico/split_util.c | 14 +- keyboards/helix/pico/split_util.h | 6 +- .../rev1/keymaps/OLED_sample/serial_config.h | 2 +- keyboards/helix/rev1/matrix.c | 26 +-- keyboards/helix/rev1/serial_config.h | 2 +- keyboards/helix/rev1/split_util.c | 14 +- keyboards/helix/rev1/split_util.h | 8 +- keyboards/helix/rev2/matrix.c | 38 ++--- keyboards/helix/rev2/rev2.c | 2 +- .../helix/rev2/serial_config_simpleapi.h | 2 +- keyboards/helix/rev2/split_scomm.c | 44 ++--- keyboards/helix/rev2/split_scomm.h | 10 +- keyboards/helix/rev2/split_util.c | 14 +- keyboards/helix/rev2/split_util.h | 6 +- keyboards/hhkb/rn42/PowerSave.txt | 2 +- keyboards/hhkb/rn42/RN42.txt | 4 +- keyboards/honeycomb/honeycomb.c | 2 +- keyboards/honeycomb/matrix.c | 2 +- .../keymaps/olligranlund_nordic/readme.md | 2 +- .../levinson/keymaps/issmirnov/config.h | 2 +- .../keymaps/bakingpy/Underglow Pinouts.md | 2 +- keyboards/kyria/keymaps/corodiak/config.h | 4 +- keyboards/kyria/keymaps/default/config.h | 2 +- keyboards/kyria/keymaps/drashna/config.h | 2 +- keyboards/kyria/keymaps/ninjonas/config.h | 2 +- .../lets_split/keymaps/tylerwince/keymap.c | 6 +- keyboards/lets_split/readme.md | 2 +- keyboards/lfkeyboards/TWIlib.c | 10 +- keyboards/lfkeyboards/TWIlib.h | 6 +- keyboards/lfkeyboards/issi.c | 2 +- keyboards/lily58/rev1/matrix.c | 38 ++--- keyboards/lily58/rev1/split_util.c | 14 +- keyboards/lily58/serial.c | 34 ++-- keyboards/massdrop/alt/config_led.h | 2 +- keyboards/massdrop/ctrl/config_led.h | 2 +- keyboards/meira/TWIlib.c | 10 +- keyboards/meira/TWIlib.h | 6 +- keyboards/meira/issi.c | 2 +- keyboards/mitosis/matrix.c | 2 +- keyboards/moon/matrix.c | 2 +- keyboards/mxss/rgblight.c | 8 +- keyboards/mxss/rgblight.h | 6 +- keyboards/nek_type_a/mcp23017.c | 12 +- keyboards/orthodox/readme.md | 2 +- keyboards/paladin64/config.h | 2 +- keyboards/redox_w/matrix.c | 2 +- .../rgbkb/sol/keymaps/brianweyer/rules.mk | 2 +- keyboards/rgbkb/sol/keymaps/default/readme.md | 2 +- .../rgbkb/sol/keymaps/kageurufu/rules.mk | 2 +- keyboards/rgbkb/sol/keymaps/xulkal/rules.mk | 2 +- keyboards/rgbkb/sol/keymaps/xyverz/readme.md | 2 +- keyboards/rgbkb/sol/keymaps/xyverz/rules.mk | 2 +- keyboards/rgbkb/sol/rev1/rules.mk | 2 +- keyboards/rgbkb/sol/rev2/rules.mk | 2 +- .../rgbkb/zen/rev2/keymaps/default/keymap.c | 2 +- .../rgbkb/zygomorph/keymaps/default/keymap.c | 2 +- .../zygomorph/keymaps/default_oled/keymap.c | 2 +- .../zygomorph/keymaps/kageurufu/keymap.c | 2 +- keyboards/sirius/uni660/matrix.c | 2 +- keyboards/switchplate/southpaw_65/matrix.c | 2 +- keyboards/sx60/i2cmaster.h | 2 +- keyboards/telophase/matrix.c | 2 +- .../uzu42/rev1/serial_config_simpleapi.h | 2 +- keyboards/xd84/matrix.c | 2 +- keyboards/xd96/matrix.c | 2 +- keyboards/yosino58/i2c.c | 54 +++--- keyboards/yosino58/i2c.h | 6 +- keyboards/yosino58/rev1/matrix.c | 38 ++--- .../yosino58/rev1/serial_config_simpleapi.h | 2 +- keyboards/yosino58/rev1/split_scomm.c | 42 ++--- keyboards/yosino58/rev1/split_scomm.h | 10 +- keyboards/yosino58/rev1/split_util.c | 8 +- keyboards/yosino58/rev1/split_util.h | 6 +- keyboards/yosino58/serial.c | 34 ++-- keyboards/yosino58/serial.h | 8 +- .../SAMD51_DFP/1.0.70/include/component/adc.h | 6 +- .../1.0.70/include/component/hmatrixb.h | 16 +- .../1.0.70/include/component/sercom.h | 52 +++--- .../SAMD51_DFP/1.0.70/include/component/tc.h | 6 +- .../SAMD51_DFP/1.0.70/include/component/tcc.h | 10 +- .../SAMD51_DFP/1.0.70/include/instance/adc0.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/adc1.h | 2 +- .../1.0.70/include/instance/hmatrix.h | 160 +++++++++--------- .../1.0.70/include/instance/sercom0.h | 8 +- .../1.0.70/include/instance/sercom1.h | 8 +- .../1.0.70/include/instance/sercom2.h | 8 +- .../1.0.70/include/instance/sercom3.h | 8 +- .../1.0.70/include/instance/sercom4.h | 8 +- .../1.0.70/include/instance/sercom5.h | 8 +- .../1.0.70/include/instance/sercom6.h | 8 +- .../1.0.70/include/instance/sercom7.h | 8 +- .../SAMD51_DFP/1.0.70/include/instance/tc0.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tc1.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tc2.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tc3.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tc4.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tc5.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tc6.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tc7.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tcc0.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tcc1.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tcc2.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tcc3.h | 2 +- .../SAMD51_DFP/1.0.70/include/instance/tcc4.h | 2 +- quantum/encoder.c | 6 +- quantum/encoder.h | 4 +- quantum/rgblight.c | 8 +- quantum/rgblight.h | 6 +- quantum/serial_link/protocol/transport.c | 20 +-- quantum/serial_link/protocol/transport.h | 44 ++--- quantum/serial_link/system/serial_link.c | 4 +- quantum/serial_link/tests/transport_tests.cpp | 68 ++++---- quantum/split_common/matrix.c | 6 +- quantum/split_common/split_util.c | 8 +- quantum/split_common/transport.c | 58 +++---- quantum/split_common/transport.h | 6 +- quantum/visualizer/visualizer.c | 2 +- quantum/visualizer/visualizer.h | 2 +- tmk_core/common/keyboard.c | 2 +- tmk_core/common/keyboard.h | 2 +- tmk_core/protocol/arm_atsam/i2c_master.c | 2 +- tmk_core/protocol/arm_atsam/issi3733_driver.h | 2 +- tmk_core/protocol/arm_atsam/led_matrix.h | 2 +- .../protocol/arm_atsam/usb/udi_device_conf.h | 4 +- tmk_core/protocol/lufa/adafruit_ble.cpp | 10 +- tmk_core/protocol/usb_descriptor.c | 2 +- .../arduino-1.0.1/cores/arduino/CDC.cpp | 2 +- 244 files changed, 1475 insertions(+), 1475 deletions(-) rename drivers/avr/{i2c_slave.c => i2c_follower.c} (69%) rename drivers/avr/{i2c_slave.h => i2c_follower.h} (73%) diff --git a/common_features.mk b/common_features.mk index bdc6f883eb9c..5f6e664dfcd2 100644 --- a/common_features.mk +++ b/common_features.mk @@ -404,7 +404,7 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) # Unused functions are pruned away, which is why we can add multiple drivers here without bloat. ifeq ($(PLATFORM),AVR) QUANTUM_LIB_SRC += i2c_master.c \ - i2c_slave.c + i2c_follower.c endif SERIAL_DRIVER ?= bitbang diff --git a/docs/config_options.md b/docs/config_options.md index ab26fd46ce1e..936c97b46c01 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -233,7 +233,7 @@ Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in yo ### Setting Handedness -One thing to remember, the side that the USB port is plugged into is always the master half. The side not plugged into USB is the slave. +One thing to remember, the side that the USB port is plugged into is always the master half. The side not plugged into USB is the follower. There are a few different ways to set handedness for split keyboards (listed in order of precedence): @@ -243,7 +243,7 @@ There are a few different ways to set handedness for split keyboards (listed in * For boards with Caterina bootloader (like stock Pro Micros), use `:avrdude-split-left`/`:avrdude-split-right` * For boards with ARM DFU bootloader (like Proton C), use `:dfu-util-split-left`/`:dfu-util-split-right` 3. Set `MASTER_RIGHT`: Half that is plugged into the USB port is determined to be the master and right half (inverse of the default) -4. Default: The side that is plugged into the USB port is the master half and is assumed to be the left half. The slave side is the right half +4. Default: The side that is plugged into the USB port is the master half and is assumed to be the left half. The follower side is the right half #### Defines for handedness @@ -285,15 +285,15 @@ There are a few different ways to set handedness for split keyboards (listed in * 5: about 20kbps * `#define SPLIT_USB_DETECT` - * Detect (with timeout) USB connection when delegating master/slave + * Detect (with timeout) USB connection when delegating master/follower * Default behavior for ARM * Required for AVR Teensy * `#define SPLIT_USB_TIMEOUT 2000` - * Maximum timeout when detecting master/slave when using `SPLIT_USB_DETECT` + * Maximum timeout when detecting master/follower when using `SPLIT_USB_DETECT` * `#define SPLIT_USB_TIMEOUT_POLL 10` - * Poll frequency when detecting master/slave when using `SPLIT_USB_DETECT` + * Poll frequency when detecting master/follower when using `SPLIT_USB_DETECT` # The `rules.mk` File diff --git a/docs/eeprom_driver.md b/docs/eeprom_driver.md index 188b95caa763..a3b6ffadfec6 100644 --- a/docs/eeprom_driver.md +++ b/docs/eeprom_driver.md @@ -52,7 +52,7 @@ Currently QMK supports 25xx-series chips over SPI. As such, requires a working s `config.h` override | Description | Default Value -----------------------------------------------|--------------------------------------------------------------------------------------|-------------- -`#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN` | SPI Slave select pin in order to inform that the EEPROM is currently being addressed | _none_ +`#define EXTERNAL_EEPROM_SPI_follower_SELECT_PIN` | SPI follower select pin in order to inform that the EEPROM is currently being addressed | _none_ `#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR` | Clock divisor used to divide the peripheral clock to derive the SPI frequency | `64` `#define EXTERNAL_EEPROM_BYTE_COUNT` | Total size of the EEPROM in bytes | 8192 `#define EXTERNAL_EEPROM_PAGE_SIZE` | Page size of the EEPROM in bytes, as specified in the datasheet | 32 diff --git a/docs/feature_ps2_mouse.md b/docs/feature_ps2_mouse.md index c1bd8bff50a8..304b4c6dee55 100644 --- a/docs/feature_ps2_mouse.md +++ b/docs/feature_ps2_mouse.md @@ -113,7 +113,7 @@ In your keyboard config.h: #define PS2_DATA_BIT 2 /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ -/* set DDR of CLOCK as input to be slave */ +/* set DDR of CLOCK as input to be follower */ #define PS2_USART_INIT() do { \ PS2_CLOCK_DDR &= ~(1< This setting will stop the ability to demo using battery packs. ```c #define SPLIT_USB_TIMEOUT 2000 ``` -This sets the maximum timeout when detecting master/slave when using `SPLIT_USB_DETECT`. +This sets the maximum timeout when detecting master/follower when using `SPLIT_USB_DETECT`. ```c #define SPLIT_USB_TIMEOUT_POLL 10 ``` -This sets the poll frequency when detecting master/slave when using `SPLIT_USB_DETECT` +This sets the poll frequency when detecting master/follower when using `SPLIT_USB_DETECT` ## Additional Resources diff --git a/docs/feature_wpm.md b/docs/feature_wpm.md index 12dd08057985..6ee7288e31cd 100644 --- a/docs/feature_wpm.md +++ b/docs/feature_wpm.md @@ -8,7 +8,7 @@ Enable the WPM system by adding this to your `rules.mk`: WPM_ENABLE = yes For split keyboards using soft serial, the computed WPM -score will be available on the master AND slave half. +score will be available on the master AND follower half. ## Public Functions diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md index d28a20fa16a5..8c7e6b20a2e9 100644 --- a/docs/i2c_driver.md +++ b/docs/i2c_driver.md @@ -20,11 +20,11 @@ See https://www.robot-electronics.co.uk/i2c-tutorial for more information about |Function |Description | |------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |`void i2c_init(void);` |Initializes the I2C driver. This function should be called once before any transaction is initiated. | -|`i2c_status_t i2c_start(uint8_t address, uint16_t timeout);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. | -|`i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. | -|`i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. | -|`i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. | -|`i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_receive` function but `regaddr` sets from where in the slave the data will be read. | +|`i2c_status_t i2c_start(uint8_t address, uint16_t timeout);` |Starts an I2C transaction. Address is the 7-bit follower address without the direction bit. | +|`i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit follower address without the direction. Returns status of transaction. | +|`i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit follower address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. | +|`i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the follower the data will be written. | +|`i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_receive` function but `regaddr` sets from where in the follower the data will be read. | |`i2c_status_t i2c_stop(void);` |Ends an I2C transaction. | ### Function Return :id=function-return diff --git a/docs/serial_driver.md b/docs/serial_driver.md index bc376b6ddda7..76ba40098200 100644 --- a/docs/serial_driver.md +++ b/docs/serial_driver.md @@ -5,7 +5,7 @@ This driver powers the [Split Keyboard](feature_split_keyboard.md) feature. All drivers in this category have the following characteristics: * Provides data and signaling over a single conductor -* Limited to single master, single slave +* Limited to single master, single follower ## Supported Driver Types diff --git a/docs/spi_driver.md b/docs/spi_driver.md index c170bf1dfc71..6e98127c9d9c 100644 --- a/docs/spi_driver.md +++ b/docs/spi_driver.md @@ -13,7 +13,7 @@ No special setup is required - just connect the `SS`, `SCK`, `MOSI` and `MISO` p |ATmega32A |`B4`|`B7` |`B5` |`B6` | |ATmega328P |`B2`|`B5` |`B3` |`B4` | -You may use more than one slave select pin, not just the `SS` pin. This is useful when you have multiple devices connected and need to communicate with them individually. +You may use more than one follower select pin, not just the `SS` pin. This is useful when you have multiple devices connected and need to communicate with them individually. `SPI_SS_PIN` can be passed to `spi_start()` to refer to `SS`. ## ChibiOS/ARM Configuration @@ -23,7 +23,7 @@ You'll need to determine which pins can be used for SPI -- as an example, STM32 To enable SPI, modify your board's `halconf.h` to enable SPI - both `HAL_USE_SPI` and `SPI_USE_WAIT` should be `TRUE`, and `SPI_SELECT_MODE` should be `SPI_SELECT_MODE_PAD`. Then, modify your board's `mcuconf.h` to enable the SPI peripheral you've chosen -- in the case of using SPI2, modify `STM32_SPI_USE_SPI2` to be `TRUE`. -As per the AVR configuration, you may select any other standard GPIO as a slave select pin, and can be supplied to `spi_start()`. +As per the AVR configuration, you may select any other standard GPIO as a follower select pin, and can be supplied to `spi_start()`. Configuration-wise, you'll need to set up the peripheral as per your MCU's datasheet -- the defaults match the pins for a Proton-C, i.e. STM32F303. @@ -45,14 +45,14 @@ Initialize the SPI driver. This function must be called only once, before any of --- -### `bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor)` +### `bool spi_start(pin_t followerPin, bool lsbFirst, uint8_t mode, uint16_t divisor)` Start an SPI transaction. #### Arguments - - `pin_t slavePin` - The QMK pin to assert as the slave select pin, eg. `B4`. + - `pin_t followerPin` + The QMK pin to assert as the follower select pin, eg. `B4`. - `bool lsbFirst` Determines the endianness of the transmission. If `true`, the least significant bit of each byte is sent first. - `uint8_t mode` @@ -135,4 +135,4 @@ Receive multiple bytes from the selected SPI device. ### `void spi_stop(void)` -End the current SPI transaction. This will deassert the slave select pin and reset the endianness, mode and divisor configured by `spi_start()`. +End the current SPI transaction. This will deassert the follower select pin and reset the endianness, mode and divisor configured by `spi_start()`. diff --git a/drivers/avr/i2c_slave.c b/drivers/avr/i2c_follower.c similarity index 69% rename from drivers/avr/i2c_slave.c rename to drivers/avr/i2c_follower.c index 62a378165af2..3c6a8dec64e9 100644 --- a/drivers/avr/i2c_slave.c +++ b/drivers/avr/i2c_follower.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ /* Library made by: g4lvanix - * GitHub repository: https://github.com/g4lvanix/I2C-slave-lib + * GitHub repository: https://github.com/g4lvanix/I2C-follower-lib */ #include @@ -22,21 +22,21 @@ #include #include -#include "i2c_slave.h" +#include "i2c_follower.h" -volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; +volatile uint8_t i2c_follower_reg[I2C_follower_REG_COUNT]; static volatile uint8_t buffer_address; -static volatile bool slave_has_register_set = false; +static volatile bool follower_has_register_set = false; -void i2c_slave_init(uint8_t address) { +void i2c_follower_init(uint8_t address) { // load address into TWI address register TWAR = address; // set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt TWCR = (1 << TWIE) | (1 << TWEA) | (1 << TWINT) | (1 << TWEN); } -void i2c_slave_stop(void) { +void i2c_follower_stop(void) { // clear acknowledge and enable bits TWCR &= ~((1 << TWEA) | (1 << TWEN)); } @@ -46,31 +46,31 @@ ISR(TWI_vect) { switch (TW_STATUS) { case TW_SR_SLA_ACK: - // The device is now a slave receiver - slave_has_register_set = false; + // The device is now a follower receiver + follower_has_register_set = false; break; case TW_SR_DATA_ACK: - // This device is a slave receiver and has received data + // This device is a follower receiver and has received data // First byte is the location then the bytes will be writen in buffer with auto-incriment - if (!slave_has_register_set) { + if (!follower_has_register_set) { buffer_address = TWDR; - if (buffer_address >= I2C_SLAVE_REG_COUNT) { // address out of bounds dont ack + if (buffer_address >= I2C_follower_REG_COUNT) { // address out of bounds dont ack ack = 0; buffer_address = 0; } - slave_has_register_set = true; // address has been receaved now fill in buffer + follower_has_register_set = true; // address has been receaved now fill in buffer } else { - i2c_slave_reg[buffer_address] = TWDR; + i2c_follower_reg[buffer_address] = TWDR; buffer_address++; } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // This device is a slave transmitter and master has requested data - TWDR = i2c_slave_reg[buffer_address]; + // This device is a follower transmitter and master has requested data + TWDR = i2c_follower_reg[buffer_address]; buffer_address++; break; diff --git a/drivers/avr/i2c_slave.h b/drivers/avr/i2c_follower.h similarity index 73% rename from drivers/avr/i2c_slave.h rename to drivers/avr/i2c_follower.h index 5d92150e6581..5dd99855a3a9 100644 --- a/drivers/avr/i2c_slave.h +++ b/drivers/avr/i2c_follower.h @@ -14,20 +14,20 @@ * along with this program. If not, see . */ /* Library made by: g4lvanix - * GitHub repository: https://github.com/g4lvanix/I2C-slave-lib + * GitHub repository: https://github.com/g4lvanix/I2C-follower-lib Info: Inititate the library by giving the required address. Read or write to the necessary buffer according to the opperation. */ -#ifndef I2C_SLAVE_H -#define I2C_SLAVE_H +#ifndef I2C_follower_H +#define I2C_follower_H -#define I2C_SLAVE_REG_COUNT 30 +#define I2C_follower_REG_COUNT 30 -extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; +extern volatile uint8_t i2c_follower_reg[I2C_follower_REG_COUNT]; -void i2c_slave_init(uint8_t address); -void i2c_slave_stop(void); +void i2c_follower_init(uint8_t address); +void i2c_follower_stop(void); -#endif // I2C_SLAVE_H +#endif // I2C_follower_H diff --git a/drivers/avr/i2c_master.c b/drivers/avr/i2c_master.c index b1e48852984b..1ee857832ca4 100644 --- a/drivers/avr/i2c_master.c +++ b/drivers/avr/i2c_master.c @@ -41,7 +41,7 @@ void i2c_init(void) { // enable TWI (two-wire interface) TWCR |= (1 << TWEN); - // enable TWI interrupt and slave address ACK + // enable TWI interrupt and follower address ACK TWCR |= (1 << TWIE); TWCR |= (1 << TWEA); #endif @@ -65,7 +65,7 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout) { return I2C_STATUS_ERROR; } - // load slave address into data register + // load follower address into data register TWDR = address; // start transmission of address TWCR = (1 << TWINT) | (1 << TWEN); diff --git a/drivers/avr/serial.c b/drivers/avr/serial.c index c27cbfdd0a79..82d635810cf8 100644 --- a/drivers/avr/serial.c +++ b/drivers/avr/serial.c @@ -162,12 +162,12 @@ # define SERIAL_DELAY_HALF1 (SERIAL_DELAY / 2) # define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY / 2) -# define SLAVE_INT_WIDTH_US 1 +# define follower_INT_WIDTH_US 1 # ifndef SERIAL_USE_MULTI_TRANSACTION -# define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +# define follower_INT_RESPONSE_TIME SERIAL_DELAY # else -# define SLAVE_INT_ACK_WIDTH_UNIT 2 -# define SLAVE_INT_ACK_WIDTH 4 +# define follower_INT_ACK_WIDTH_UNIT 2 +# define follower_INT_ACK_WIDTH 4 # endif static SSTD_t *Transaction_table = NULL; @@ -359,7 +359,7 @@ ISR(SERIAL_PIN_INTERRUPT) { serial_high(); // response step1 low->high serial_output(); - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT * SLAVE_INT_ACK_WIDTH); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT * follower_INT_ACK_WIDTH); SSTD_t *trans = &Transaction_table[tid]; serial_low(); // response step2 ack high->low # endif @@ -406,12 +406,12 @@ int soft_serial_transaction(int sstd_index) { // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(SLAVE_INT_WIDTH_US); + _delay_us(follower_INT_WIDTH_US); # ifndef SERIAL_USE_MULTI_TRANSACTION // wait for the target response serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); + _delay_us(follower_INT_RESPONSE_TIME); // check if the target is present if (serial_read_pin()) { @@ -439,15 +439,15 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for (int i = 0; serial_read_pin(); i++) { - if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present + if (i > follower_INT_ACK_WIDTH + 1) { + // follower failed to pull the line low, assume not present serial_output(); serial_high(); *trans->status = TRANSACTION_NO_RESPONSE; sei(); return TRANSACTION_NO_RESPONSE; } - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT); } # endif @@ -495,7 +495,7 @@ int soft_serial_get_and_clean_status(int sstd_index) { // Helix serial.c history // 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) -// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// 2018-6-28 bug fix master to follower comm and speed up (#3255, 1038bbef4) // (adjusted with avr-gcc 4.9.2) // 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) // (adjusted with avr-gcc 4.9.2) diff --git a/drivers/avr/spi_master.c b/drivers/avr/spi_master.c index 32cc55c8361b..5f20d0bb5162 100644 --- a/drivers/avr/spi_master.c +++ b/drivers/avr/spi_master.c @@ -38,9 +38,9 @@ # define SPI_TIMEOUT 100 #endif -static pin_t currentSlavePin = NO_PIN; -static uint8_t currentSlaveConfig = 0; -static bool currentSlave2X = false; +static pin_t currentfollowerPin = NO_PIN; +static uint8_t currentfollowerConfig = 0; +static bool currentfollower2X = false; void spi_init(void) { writePinHigh(SPI_SS_PIN); @@ -51,26 +51,26 @@ void spi_init(void) { SPCR = (_BV(SPE) | _BV(MSTR)); } -bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { - if (currentSlavePin != NO_PIN || slavePin == NO_PIN) { +bool spi_start(pin_t followerPin, bool lsbFirst, uint8_t mode, uint16_t divisor) { + if (currentfollowerPin != NO_PIN || followerPin == NO_PIN) { return false; } - currentSlaveConfig = 0; + currentfollowerConfig = 0; if (lsbFirst) { - currentSlaveConfig |= _BV(DORD); + currentfollowerConfig |= _BV(DORD); } switch (mode) { case 1: - currentSlaveConfig |= _BV(CPHA); + currentfollowerConfig |= _BV(CPHA); break; case 2: - currentSlaveConfig |= _BV(CPOL); + currentfollowerConfig |= _BV(CPOL); break; case 3: - currentSlaveConfig |= (_BV(CPOL) | _BV(CPHA)); + currentfollowerConfig |= (_BV(CPOL) | _BV(CPHA)); break; } @@ -81,34 +81,34 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { switch (roundedDivisor) { case 16: - currentSlaveConfig |= _BV(SPR0); + currentfollowerConfig |= _BV(SPR0); break; case 64: - currentSlaveConfig |= _BV(SPR1); + currentfollowerConfig |= _BV(SPR1); break; case 128: - currentSlaveConfig |= (_BV(SPR1) | _BV(SPR0)); + currentfollowerConfig |= (_BV(SPR1) | _BV(SPR0)); break; case 2: - currentSlave2X = true; + currentfollower2X = true; break; case 8: - currentSlave2X = true; - currentSlaveConfig |= _BV(SPR0); + currentfollower2X = true; + currentfollowerConfig |= _BV(SPR0); break; case 32: - currentSlave2X = true; - currentSlaveConfig |= _BV(SPR1); + currentfollower2X = true; + currentfollowerConfig |= _BV(SPR1); break; } - SPCR |= currentSlaveConfig; - if (currentSlave2X) { + SPCR |= currentfollowerConfig; + if (currentfollower2X) { SPSR |= _BV(SPI2X); } - currentSlavePin = slavePin; - setPinOutput(currentSlavePin); - writePinLow(currentSlavePin); + currentfollowerPin = followerPin; + setPinOutput(currentfollowerPin); + writePinLow(currentfollowerPin); return true; } @@ -164,13 +164,13 @@ spi_status_t spi_receive(uint8_t *data, uint16_t length) { } void spi_stop(void) { - if (currentSlavePin != NO_PIN) { - setPinOutput(currentSlavePin); - writePinHigh(currentSlavePin); - currentSlavePin = NO_PIN; + if (currentfollowerPin != NO_PIN) { + setPinOutput(currentfollowerPin); + writePinHigh(currentfollowerPin); + currentfollowerPin = NO_PIN; SPSR &= ~(_BV(SPI2X)); - SPCR &= ~(currentSlaveConfig); - currentSlaveConfig = 0; - currentSlave2X = false; + SPCR &= ~(currentfollowerConfig); + currentfollowerConfig = 0; + currentfollower2X = false; } } diff --git a/drivers/avr/spi_master.h b/drivers/avr/spi_master.h index b69c1cbd66e3..c932bebe4d31 100644 --- a/drivers/avr/spi_master.h +++ b/drivers/avr/spi_master.h @@ -41,7 +41,7 @@ extern "C" { #endif void spi_init(void); -bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor); +bool spi_start(pin_t followerPin, bool lsbFirst, uint8_t mode, uint16_t divisor); spi_status_t spi_write(uint8_t data); diff --git a/drivers/chibios/serial.c b/drivers/chibios/serial.c index 26c68065321e..b85925a2cd0f 100644 --- a/drivers/chibios/serial.c +++ b/drivers/chibios/serial.c @@ -95,18 +95,18 @@ void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) { chThdCreateStatic(waThread1, sizeof(waThread1), HIGHPRIO, Thread1, NULL); } -// Used by the master to synchronize timing with the slave. +// Used by the master to synchronize timing with the follower. static void __attribute__((noinline)) sync_recv(void) { serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. + // This shouldn't hang if the follower disconnects because the + // serial line will float to high if the follower does disconnect. while (!serial_read_pin()) { } serial_delay(); } -// Used by the slave to send a synchronization signal to the master. +// Used by the follower to send a synchronization signal to the master. static void __attribute__((noinline)) sync_send(void) { serial_output(); @@ -142,7 +142,7 @@ static void __attribute__((noinline)) serial_write_byte(uint8_t data) { } } -// interrupt handle to be used by the slave device +// interrupt handle to be used by the follower device void interrupt_handler(void *arg) { chSysLockFromISR(); @@ -222,28 +222,28 @@ int soft_serial_transaction(int sstd_index) { // this code is very time dependent, so we need to disable interrupts chSysLock(); - // signal to the slave that we want to start a transaction + // signal to the follower that we want to start a transaction serial_output(); serial_low(); serial_delay_blip(); - // wait for the slaves response + // wait for the followers response serial_input(); serial_high(); serial_delay(); - // check if the slave is present + // check if the follower is present if (serial_read_pin()) { - // slave failed to pull the line low, assume not present + // follower failed to pull the line low, assume not present dprintf("serial::NO_RESPONSE\n"); chSysUnlock(); return TRANSACTION_NO_RESPONSE; } - // if the slave is present syncronize with it + // if the follower is present syncronize with it uint8_t checksum = 0; - // send data to the slave + // send data to the follower #ifdef SERIAL_USE_MULTI_TRANSACTION serial_write_byte(sstd_index); // first chunk is transaction id sync_recv(); @@ -259,7 +259,7 @@ int soft_serial_transaction(int sstd_index) { serial_delay(); serial_delay(); // read mid pulses - // receive data from the slave + // receive data from the follower uint8_t checksum_computed = 0; for (int i = 0; i < trans->target2initiator_buffer_size; ++i) { trans->target2initiator_buffer[i] = serial_read_byte(); diff --git a/drivers/chibios/serial_usart.c b/drivers/chibios/serial_usart.c index 62b4913cbfbb..c66ebf168f4b 100644 --- a/drivers/chibios/serial_usart.c +++ b/drivers/chibios/serial_usart.c @@ -98,19 +98,19 @@ static SerialConfig sdcfg = { (SERIAL_USART_CR3) // CR3 }; -void handle_soft_serial_slave(void); +void handle_soft_serial_follower(void); /* - * This thread runs on the slave and responds to transactions initiated + * This thread runs on the follower and responds to transactions initiated * by the master */ -static THD_WORKING_AREA(waSlaveThread, 2048); -static THD_FUNCTION(SlaveThread, arg) { +static THD_WORKING_AREA(wafollowerThread, 2048); +static THD_FUNCTION(followerThread, arg) { (void)arg; - chRegSetThreadName("slave_transport"); + chRegSetThreadName("follower_transport"); while (true) { - handle_soft_serial_slave(); + handle_soft_serial_follower(); } } @@ -129,14 +129,14 @@ void usart_master_init(void) { sdStart(&SERIAL_USART_DRIVER, &sdcfg); } -void usart_slave_init(void) { +void usart_follower_init(void) { usart_init(); sdcfg.cr3 |= USART_CR3_HDSEL; sdStart(&SERIAL_USART_DRIVER, &sdcfg); // Start transport thread - chThdCreateStatic(waSlaveThread, sizeof(waSlaveThread), HIGHPRIO, SlaveThread, NULL); + chThdCreateStatic(wafollowerThread, sizeof(wafollowerThread), HIGHPRIO, followerThread, NULL); } static SSTD_t* Transaction_table = NULL; @@ -153,10 +153,10 @@ void soft_serial_target_init(SSTD_t* sstd_table, int sstd_table_size) { Transaction_table = sstd_table; Transaction_table_size = (uint8_t)sstd_table_size; - usart_slave_init(); + usart_follower_init(); } -void handle_soft_serial_slave(void) { +void handle_soft_serial_follower(void) { uint8_t sstd_index = sdGet(&SERIAL_USART_DRIVER); // first chunk is always transaction id SSTD_t* trans = &Transaction_table[sstd_index]; @@ -207,7 +207,7 @@ int soft_serial_transaction(int index) { // Which we always read back first so that we can error out correctly // - due to the half duplex limitations on return codes, we always have to read *something* - // - without the read, write only transactions *always* succeed, even during the boot process where the slave is not ready + // - without the read, write only transactions *always* succeed, even during the boot process where the follower is not ready res = sdReadTimeout(&SERIAL_USART_DRIVER, &sstd_index_shake, sizeof(sstd_index_shake), TIME_MS2I(TIMEOUT)); if (res < 0 || (sstd_index_shake != (sstd_index ^ HANDSHAKE_MAGIC))) { dprintf("serial::usart_shake NO_RESPONSE\n"); diff --git a/drivers/chibios/spi_master.c b/drivers/chibios/spi_master.c index 552ac663c1e9..c493ca0aaef9 100644 --- a/drivers/chibios/spi_master.c +++ b/drivers/chibios/spi_master.c @@ -18,7 +18,7 @@ #include "quantum.h" #include "timer.h" -static pin_t currentSlavePin = NO_PIN; +static pin_t currentfollowerPin = NO_PIN; static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0}; __attribute__((weak)) void spi_init(void) { @@ -39,8 +39,8 @@ __attribute__((weak)) void spi_init(void) { #endif } -bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { - if (currentSlavePin != NO_PIN || slavePin == NO_PIN) { +bool spi_start(pin_t followerPin, bool lsbFirst, uint8_t mode, uint16_t divisor) { + if (currentfollowerPin != NO_PIN || followerPin == NO_PIN) { return false; } @@ -99,11 +99,11 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { break; } - currentSlavePin = slavePin; - spiConfig.ssport = PAL_PORT(slavePin); - spiConfig.sspad = PAL_PAD(slavePin); + currentfollowerPin = followerPin; + spiConfig.ssport = PAL_PORT(followerPin); + spiConfig.sspad = PAL_PAD(followerPin); - setPinOutput(slavePin); + setPinOutput(followerPin); spiStart(&SPI_DRIVER, &spiConfig); spiSelect(&SPI_DRIVER); @@ -129,9 +129,9 @@ spi_status_t spi_receive(uint8_t *data, uint16_t length) { } void spi_stop(void) { - if (currentSlavePin != NO_PIN) { + if (currentfollowerPin != NO_PIN) { spiUnselect(&SPI_DRIVER); spiStop(&SPI_DRIVER); - currentSlavePin = NO_PIN; + currentfollowerPin = NO_PIN; } } diff --git a/drivers/chibios/spi_master.h b/drivers/chibios/spi_master.h index 0c18587c9536..8a9c937b0c0b 100644 --- a/drivers/chibios/spi_master.h +++ b/drivers/chibios/spi_master.h @@ -62,7 +62,7 @@ extern "C" { #endif void spi_init(void); -bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor); +bool spi_start(pin_t followerPin, bool lsbFirst, uint8_t mode, uint16_t divisor); spi_status_t spi_write(uint8_t data); diff --git a/drivers/chibios/ws2812_spi.c b/drivers/chibios/ws2812_spi.c index 36e08e39ed37..88a8309272e6 100644 --- a/drivers/chibios/ws2812_spi.c +++ b/drivers/chibios/ws2812_spi.c @@ -66,7 +66,7 @@ void ws2812_init(void) { spiAcquireBus(&WS2812_SPI); /* Acquire ownership of the bus. */ spiStart(&WS2812_SPI, &spicfg); /* Setup transfer parameters. */ - spiSelect(&WS2812_SPI); /* Slave Select assertion. */ + spiSelect(&WS2812_SPI); /* follower Select assertion. */ } void ws2812_setleds(LED_TYPE* ledarray, uint16_t leds) { diff --git a/drivers/eeprom/eeprom_spi.c b/drivers/eeprom/eeprom_spi.c index 7b6416eafbf4..844baafb3020 100644 --- a/drivers/eeprom/eeprom_spi.c +++ b/drivers/eeprom/eeprom_spi.c @@ -63,7 +63,7 @@ static void init_spi_if_required(void) { } } -static bool spi_eeprom_start(void) { return spi_start(EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN, EXTERNAL_EEPROM_SPI_LSBFIRST, EXTERNAL_EEPROM_SPI_MODE, EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR); } +static bool spi_eeprom_start(void) { return spi_start(EXTERNAL_EEPROM_SPI_follower_SELECT_PIN, EXTERNAL_EEPROM_SPI_LSBFIRST, EXTERNAL_EEPROM_SPI_MODE, EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR); } static spi_status_t spi_eeprom_wait_while_busy(int timeout) { uint32_t deadline = timer_read32() + timeout; diff --git a/drivers/eeprom/eeprom_spi.h b/drivers/eeprom/eeprom_spi.h index 282c603565f6..46861373c503 100644 --- a/drivers/eeprom/eeprom_spi.h +++ b/drivers/eeprom/eeprom_spi.h @@ -17,11 +17,11 @@ #pragma once /* - The slave select pin of the EEPROM. + The follower select pin of the EEPROM. This needs to be a normal GPIO pin_t value, such as A7. */ -#ifndef EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN -# error "No chip select pin defined -- missing EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN" +#ifndef EXTERNAL_EEPROM_SPI_follower_SELECT_PIN +# error "No chip select pin defined -- missing EXTERNAL_EEPROM_SPI_follower_SELECT_PIN" #endif /* diff --git a/drivers/gpio/pca9555.c b/drivers/gpio/pca9555.c index 02b5abbddef2..5a5f2212a7c4 100644 --- a/drivers/gpio/pca9555.c +++ b/drivers/gpio/pca9555.c @@ -18,7 +18,7 @@ #include "debug.h" -#define SLAVE_TO_ADDR(n) (n << 1) +#define follower_TO_ADDR(n) (n << 1) #define TIMEOUT 100 enum { @@ -32,7 +32,7 @@ enum { CMD_CONFIG_1, }; -void pca9555_init(uint8_t slave_addr) { +void pca9555_init(uint8_t follower_addr) { static uint8_t s_init = 0; if (!s_init) { i2c_init(); @@ -41,12 +41,12 @@ void pca9555_init(uint8_t slave_addr) { } // TODO: could check device connected - // i2c_start(SLAVE_TO_ADDR(slave) | I2C_WRITE); + // i2c_start(follower_TO_ADDR(follower) | I2C_WRITE); // i2c_stop(); } -void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) { - uint8_t addr = SLAVE_TO_ADDR(slave_addr); +void pca9555_set_config(uint8_t follower_addr, uint8_t port, uint8_t conf) { + uint8_t addr = follower_TO_ADDR(follower_addr); uint8_t cmd = port ? CMD_CONFIG_1 : CMD_CONFIG_0; i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); @@ -55,8 +55,8 @@ void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) { } } -void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf) { - uint8_t addr = SLAVE_TO_ADDR(slave_addr); +void pca9555_set_output(uint8_t follower_addr, uint8_t port, uint8_t conf) { + uint8_t addr = follower_TO_ADDR(follower_addr); uint8_t cmd = port ? CMD_OUTPUT_1 : CMD_OUTPUT_0; i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT); @@ -65,8 +65,8 @@ void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf) { } } -uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port) { - uint8_t addr = SLAVE_TO_ADDR(slave_addr); +uint8_t pca9555_readPins(uint8_t follower_addr, uint8_t port) { + uint8_t addr = follower_TO_ADDR(follower_addr); uint8_t cmd = port ? CMD_INPUT_1 : CMD_INPUT_0; uint8_t data = 0; @@ -77,8 +77,8 @@ uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port) { return data; } -uint16_t pca9555_readAllPins(uint8_t slave_addr) { - uint8_t addr = SLAVE_TO_ADDR(slave_addr); +uint16_t pca9555_readAllPins(uint8_t follower_addr) { + uint8_t addr = follower_TO_ADDR(follower_addr); typedef union { uint8_t u8[2]; diff --git a/drivers/gpio/pca9555.h b/drivers/gpio/pca9555.h index 3341ec3eb53f..0067c614e132 100644 --- a/drivers/gpio/pca9555.h +++ b/drivers/gpio/pca9555.h @@ -46,12 +46,12 @@ #define ALL_LOW 0 #define ALL_HIGH 0xFF -void pca9555_init(uint8_t slave_addr); +void pca9555_init(uint8_t follower_addr); -void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf); +void pca9555_set_config(uint8_t follower_addr, uint8_t port, uint8_t conf); -void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf); +void pca9555_set_output(uint8_t follower_addr, uint8_t port, uint8_t conf); -uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port); +uint8_t pca9555_readPins(uint8_t follower_addr, uint8_t port); -uint16_t pca9555_readAllPins(uint8_t slave_addr); +uint16_t pca9555_readAllPins(uint8_t follower_addr); diff --git a/keyboards/ai03/orbit/matrix.c b/keyboards/ai03/orbit/matrix.c index a1509666cd5b..4dec2672f4d9 100644 --- a/keyboards/ai03/orbit/matrix.c +++ b/keyboards/ai03/orbit/matrix.c @@ -75,7 +75,7 @@ __attribute__((weak)) void matrix_init_user(void) {} __attribute__((weak)) void matrix_scan_user(void) {} -__attribute__((weak)) void matrix_slave_scan_user(void) {} +__attribute__((weak)) void matrix_follower_scan_user(void) {} // helper functions @@ -320,8 +320,8 @@ uint8_t matrix_scan(void) { matrix_scan_quantum(); } else { - transport_slave(matrix + thisHand); - matrix_slave_scan_user(); + transport_follower(matrix + thisHand); + matrix_follower_scan_user(); } return ret; diff --git a/keyboards/ai03/orbit/orbit.c b/keyboards/ai03/orbit/orbit.c index 2f149875b1cb..a0e3e3ba6cd0 100644 --- a/keyboards/ai03/orbit/orbit.c +++ b/keyboards/ai03/orbit/orbit.c @@ -219,8 +219,8 @@ uint32_t layer_state_set_kb(uint32_t state) { } } - // NOTE: Do not set slave LEDs here. - // This is not called on slave + // NOTE: Do not set follower LEDs here. + // This is not called on follower return layer_state_set_user(state); } diff --git a/keyboards/ai03/orbit/serial.c b/keyboards/ai03/orbit/serial.c index 636dfa090677..8e3125eeeba8 100644 --- a/keyboards/ai03/orbit/serial.c +++ b/keyboards/ai03/orbit/serial.c @@ -167,12 +167,12 @@ #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) -#define SLAVE_INT_WIDTH_US 1 +#define follower_INT_WIDTH_US 1 #ifndef SERIAL_USE_MULTI_TRANSACTION - #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY + #define follower_INT_RESPONSE_TIME SERIAL_DELAY #else - #define SLAVE_INT_ACK_WIDTH_UNIT 2 - #define SLAVE_INT_ACK_WIDTH 4 + #define follower_INT_ACK_WIDTH_UNIT 2 + #define follower_INT_ACK_WIDTH 4 #endif static SSTD_t *Transaction_table = NULL; @@ -391,7 +391,7 @@ ISR(SERIAL_PIN_INTERRUPT) { serial_high(); // response step1 low->high serial_output(); - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT*follower_INT_ACK_WIDTH); SSTD_t *trans = &Transaction_table[tid]; serial_low(); // response step2 ack high->low #endif @@ -442,12 +442,12 @@ int soft_serial_transaction(int sstd_index) { // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(SLAVE_INT_WIDTH_US); + _delay_us(follower_INT_WIDTH_US); #ifndef SERIAL_USE_MULTI_TRANSACTION // wait for the target response serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); + _delay_us(follower_INT_RESPONSE_TIME); // check if the target is present if (serial_read_pin()) { @@ -475,15 +475,15 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { - if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present + if (i > follower_INT_ACK_WIDTH + 1) { + // follower failed to pull the line low, assume not present serial_output(); serial_high(); *trans->status = TRANSACTION_NO_RESPONSE; sei(); return TRANSACTION_NO_RESPONSE; } - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT); } #endif @@ -532,7 +532,7 @@ int soft_serial_get_and_clean_status(int sstd_index) { // Helix serial.c history // 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) -// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// 2018-6-28 bug fix master to follower comm and speed up (#3255, 1038bbef4) // (adjusted with avr-gcc 4.9.2) // 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) // (adjusted with avr-gcc 4.9.2) diff --git a/keyboards/ai03/orbit/split_util.c b/keyboards/ai03/orbit/split_util.c index a83ff5bc67ec..e45f86048a4a 100644 --- a/keyboards/ai03/orbit/split_util.c +++ b/keyboards/ai03/orbit/split_util.c @@ -36,7 +36,7 @@ bool is_keyboard_left(void) { bool is_keyboard_master(void) { #ifdef __AVR__ - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; + static enum { UNKNOWN, MASTER, follower } usbstate = UNKNOWN; // only check once, as this is called often if (usbstate == UNKNOWN) @@ -44,7 +44,7 @@ bool is_keyboard_master(void) USBCON |= (1 << OTGPADE); // enables VBUS pad wait_us(5); - usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS + usbstate = (USBSTA & (1 << VBUS)) ? MASTER : follower; // checks state of VBUS } return (usbstate == MASTER); @@ -66,9 +66,9 @@ static void keyboard_master_setup(void) { BACKLIT_DIRTY = true; } -static void keyboard_slave_setup(void) +static void keyboard_follower_setup(void) { - transport_slave_init(); + transport_follower_init(); } // this code runs before the usb and keyboard is initialized @@ -82,6 +82,6 @@ void matrix_setup(void) } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } } diff --git a/keyboards/ai03/orbit/transport.c b/keyboards/ai03/orbit/transport.c index 447fafed1442..15b1b0b71e81 100644 --- a/keyboards/ai03/orbit/transport.c +++ b/keyboards/ai03/orbit/transport.c @@ -22,8 +22,8 @@ #include "i2c.h" -#ifndef SLAVE_I2C_ADDRESS -# define SLAVE_I2C_ADDRESS 0x32 +#ifndef follower_I2C_ADDRESS +# define follower_I2C_ADDRESS 0x32 #endif #if (MATRIX_COLS > 8) @@ -37,7 +37,7 @@ bool transport_master(matrix_row_t matrix[]) { // write backlight info #ifdef BACKLIGHT_ENABLE if (BACKLIT_DIRTY) { - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) { goto i2c_error; } // Backlight location @@ -51,7 +51,7 @@ bool transport_master(matrix_row_t matrix[]) { } #endif - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) { goto i2c_error; } // start of matrix stored at I2C_KEYMAP_START @@ -59,7 +59,7 @@ bool transport_master(matrix_row_t matrix[]) { if (err) { goto i2c_error; } // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_READ); if (err) { goto i2c_error; } if (!err) { @@ -77,7 +77,7 @@ bool transport_master(matrix_row_t matrix[]) { #ifdef RGBLIGHT_ENABLE if (RGB_DIRTY) { - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) { goto i2c_error; } // RGB Location @@ -98,17 +98,17 @@ bool transport_master(matrix_row_t matrix[]) { return true; } -void transport_slave(matrix_row_t matrix[]) { +void transport_follower(matrix_row_t matrix[]) { for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[I2C_KEYMAP_START + i] = matrix[i]; + i2c_follower_buffer[I2C_KEYMAP_START + i] = matrix[i]; } // Read Backlight Info #ifdef BACKLIGHT_ENABLE if (BACKLIT_DIRTY) { - backlight_set(i2c_slave_buffer[I2C_BACKLIT_START]); + backlight_set(i2c_follower_buffer[I2C_BACKLIT_START]); BACKLIT_DIRTY = false; } #endif @@ -124,7 +124,7 @@ void transport_slave(matrix_row_t matrix[]) { uint8_t * dword_dat = (uint8_t *)(&dword); for (int i = 0; i < 4; i++) { - dword_dat[i] = i2c_slave_buffer[I2C_RGB_START + i]; + dword_dat[i] = i2c_follower_buffer[I2C_RGB_START + i]; } // Update the RGB now with the new data and set RGB_DIRTY to false @@ -140,8 +140,8 @@ void transport_master_init(void) { i2c_master_init(); } -void transport_slave_init(void) { - i2c_slave_init(SLAVE_I2C_ADDRESS); +void transport_follower_init(void) { + i2c_follower_init(follower_I2C_ADDRESS); } #else // USE_SERIAL @@ -161,21 +161,21 @@ SSTD_t transactions[] = { } }; -uint8_t slave_layer_cache; -uint8_t slave_nlock_cache; -uint8_t slave_clock_cache; -uint8_t slave_slock_cache; +uint8_t follower_layer_cache; +uint8_t follower_nlock_cache; +uint8_t follower_clock_cache; +uint8_t follower_slock_cache; void transport_master_init(void) { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void transport_slave_init(void) +void transport_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); - slave_layer_cache = 255; - slave_nlock_cache = 255; - slave_clock_cache = 255; - slave_slock_cache = 255; + follower_layer_cache = 255; + follower_nlock_cache = 255; + follower_clock_cache = 255; + follower_slock_cache = 255; } bool transport_master(matrix_row_t matrix[]) { @@ -194,14 +194,14 @@ bool transport_master(matrix_row_t matrix[]) { #endif #ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read + // Write backlight level for follower to read serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0; #endif return true; } -void transport_slave(matrix_row_t matrix[]) { +void transport_follower(matrix_row_t matrix[]) { // TODO: if MATRIX_COLS > 8 change to pack() for (int i = 0; i < ROWS_PER_HAND; ++i) @@ -215,22 +215,22 @@ void transport_slave(matrix_row_t matrix[]) { // Add serial implementation for RGB here #endif - if (slave_layer_cache != serial_m2s_buffer.current_layer) { - slave_layer_cache = serial_m2s_buffer.current_layer; - set_layer_indicators(slave_layer_cache); + if (follower_layer_cache != serial_m2s_buffer.current_layer) { + follower_layer_cache = serial_m2s_buffer.current_layer; + set_layer_indicators(follower_layer_cache); } - if (slave_nlock_cache != serial_m2s_buffer.nlock_led) { - slave_nlock_cache = serial_m2s_buffer.nlock_led; - led_toggle(3, slave_nlock_cache); + if (follower_nlock_cache != serial_m2s_buffer.nlock_led) { + follower_nlock_cache = serial_m2s_buffer.nlock_led; + led_toggle(3, follower_nlock_cache); } - if (slave_clock_cache != serial_m2s_buffer.clock_led) { - slave_clock_cache = serial_m2s_buffer.clock_led; - led_toggle(4, slave_clock_cache); + if (follower_clock_cache != serial_m2s_buffer.clock_led) { + follower_clock_cache = serial_m2s_buffer.clock_led; + led_toggle(4, follower_clock_cache); } - if (slave_slock_cache != serial_m2s_buffer.slock_led) { - slave_slock_cache = serial_m2s_buffer.slock_led; - led_toggle(5, slave_slock_cache); + if (follower_slock_cache != serial_m2s_buffer.slock_led) { + follower_slock_cache = serial_m2s_buffer.slock_led; + led_toggle(5, follower_slock_cache); } } diff --git a/keyboards/ai03/orbit/transport.h b/keyboards/ai03/orbit/transport.h index 422e2ecb9902..18058e61382b 100644 --- a/keyboards/ai03/orbit/transport.h +++ b/keyboards/ai03/orbit/transport.h @@ -35,8 +35,8 @@ extern volatile Serial_s2m_buffer_t serial_s2m_buffer; extern volatile Serial_m2s_buffer_t serial_m2s_buffer; void transport_master_init(void); -void transport_slave_init(void); +void transport_follower_init(void); -// returns false if valid data not received from slave +// returns false if valid data not received from follower bool transport_master(matrix_row_t matrix[]); -void transport_slave(matrix_row_t matrix[]); +void transport_follower(matrix_row_t matrix[]); diff --git a/keyboards/butterstick/sten.h b/keyboards/butterstick/sten.h index 84635a554c19..6831b5e87f7b 100644 --- a/keyboards/butterstick/sten.h +++ b/keyboards/butterstick/sten.h @@ -1,7 +1,7 @@ // 2019, g Heavy Industries // Blessed mother of Christ, please keep this readable // and protect us from segfaults. For thine is the clock, -// the slave and the master. Until we return from main. +// the follower and the master. Until we return from main. // // Amen. diff --git a/keyboards/cannonkeys/bluepill/ws2812.c b/keyboards/cannonkeys/bluepill/ws2812.c index d30806d564a6..b3982eb7241d 100644 --- a/keyboards/cannonkeys/bluepill/ws2812.c +++ b/keyboards/cannonkeys/bluepill/ws2812.c @@ -69,7 +69,7 @@ void leds_init(void){ txbuf[i] = 0x00; spiAcquireBus(&WS2812_SPI); /* Acquire ownership of the bus. */ spiStart(&WS2812_SPI, &spicfg); /* Setup transfer parameters. */ - spiSelect(&WS2812_SPI); /* Slave Select assertion. */ + spiSelect(&WS2812_SPI); /* follower Select assertion. */ chThdCreateStatic(LEDS_THREAD_WA, sizeof(LEDS_THREAD_WA),NORMALPRIO, ledsThread, NULL); } diff --git a/keyboards/centromere/matrix.c b/keyboards/centromere/matrix.c index c5fc8db6ce94..4835ad5d687b 100644 --- a/keyboards/centromere/matrix.c +++ b/keyboards/centromere/matrix.c @@ -87,7 +87,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; - //the s character requests the RF remote slave to send the matrix information + //the s character requests the RF remote follower to send the matrix information SERIAL_UART_DATA = 's'; //trust the external keystates, erase the last set of data diff --git a/keyboards/chidori/board.c b/keyboards/chidori/board.c index e00156eb9032..6551902c34e5 100644 --- a/keyboards/chidori/board.c +++ b/keyboards/chidori/board.c @@ -32,7 +32,7 @@ static board_info_t* get_board_by_index(uint8_t board_index); static uint8_t board_merge_led_config(board_info_t* board, uint8_t iodir); static uint8_t board_merge_led_status(board_info_t* board, uint8_t data); static void board_master_init(void); -static void board_slave_init(void); +static void board_follower_init(void); // // board interface @@ -42,20 +42,20 @@ static void board_unselect_master_row(board_info_t* board, uint8_t row); static void board_unselect_master_rows(board_info_t* board); static bool board_read_cols_on_master_row(board_info_t* board, matrix_row_t current_matrix[], uint8_t row); static void board_set_master_led(board_info_t* board, uint8_t led_index, bool status); -static void board_select_slave_row(board_info_t* board, uint8_t row); -static void board_unselect_slave_row(board_info_t* board, uint8_t row); -static void board_unselect_slave_rows(board_info_t* board); -static bool board_read_cols_on_slave_row(board_info_t* board, matrix_row_t current_matrix[], uint8_t row); -static void board_set_slave_led(board_info_t* board, uint8_t led_index, bool status); +static void board_select_follower_row(board_info_t* board, uint8_t row); +static void board_unselect_follower_row(board_info_t* board, uint8_t row); +static void board_unselect_follower_rows(board_info_t* board); +static bool board_read_cols_on_follower_row(board_info_t* board, matrix_row_t current_matrix[], uint8_t row); +static void board_set_follower_led(board_info_t* board, uint8_t led_index, bool status); static board_interface_t master_interface = {board_select_master_row, board_unselect_master_row, board_unselect_master_rows, board_read_cols_on_master_row, board_set_master_led}; -static board_interface_t slave_interface = {board_select_slave_row, board_unselect_slave_row, board_unselect_slave_rows, board_read_cols_on_slave_row, board_set_slave_led}; +static board_interface_t follower_interface = {board_select_follower_row, board_unselect_follower_row, board_unselect_follower_rows, board_read_cols_on_follower_row, board_set_follower_led}; static board_interface_t* get_interface(board_info_t* board) { if (board_is_master(board)) { return &master_interface; } - return &slave_interface; + return &follower_interface; } static void board_set_master_led(board_info_t* board, uint8_t led_index, bool status) { @@ -65,7 +65,7 @@ static void board_set_master_led(board_info_t* board, uint8_t led_index, bool st status ? writePinHigh(pin) : writePinLow(pin); } -static void board_set_slave_led(board_info_t* board, uint8_t led_index, bool status) { +static void board_set_follower_led(board_info_t* board, uint8_t led_index, bool status) { board->led_status[led_index] = status; uint8_t iodir = board_merge_led_config(board, 0xff); uint8_t data = board_merge_led_status(board, 0x00); @@ -80,7 +80,7 @@ static uint8_t board_merge_led_config(board_info_t* board, uint8_t iodir) { return iodir; } -static bool board_slave_config(board_info_t* board) { +static bool board_follower_config(board_info_t* board) { uint8_t set = 0xff; uint8_t clear = 0x00; i2c_status_t res = 0; @@ -115,7 +115,7 @@ static bool board_slave_config(board_info_t* board) { return true; } -static void board_slave_init(void) { +static void board_follower_init(void) { i2c_init(); _delay_ms(500); @@ -128,7 +128,7 @@ static void board_slave_init(void) { continue; } i2c_stop(); - if (board_slave_config(board)) { + if (board_follower_config(board)) { board->initialized = true; } } @@ -196,9 +196,9 @@ static uint8_t board_merge_led_status(board_info_t* board, uint8_t data) { } // -// Functions for slave +// Functions for follower // -static uint8_t board_read_slave_cols(board_info_t* board) { +static uint8_t board_read_follower_cols(board_info_t* board) { if (!board_is_initialized(board)) { return 0xff; } @@ -207,7 +207,7 @@ static uint8_t board_read_slave_cols(board_info_t* board) { return (res < 0) ? 0xff : data; } -static void board_select_slave_row(board_info_t* board, uint8_t board_row) { +static void board_select_follower_row(board_info_t* board, uint8_t board_row) { if (!board_is_initialized(board)) { return; } @@ -218,7 +218,7 @@ static void board_select_slave_row(board_info_t* board, uint8_t board_row) { i2c_writeReg(EXPANDER_ADDR(board->i2c_address), EXPANDER_OLATB, (const uint8_t*)&status, sizeof(status), BOARD_I2C_TIMEOUT); } -static void board_unselect_slave_rows(board_info_t* board) { +static void board_unselect_follower_rows(board_info_t* board) { if (!board_is_initialized(board)) { return; } @@ -228,26 +228,26 @@ static void board_unselect_slave_rows(board_info_t* board) { i2c_writeReg(EXPANDER_ADDR(board->i2c_address), EXPANDER_OLATB, (const uint8_t*)&data, sizeof(data), BOARD_I2C_TIMEOUT); } -static void board_unselect_slave_row(board_info_t* board, uint8_t board_row) { board_unselect_slave_rows(board); } +static void board_unselect_follower_row(board_info_t* board, uint8_t board_row) { board_unselect_follower_rows(board); } /* * row : matrix row (not board row) */ -static bool board_read_cols_on_slave_row(board_info_t* board, matrix_row_t current_matrix[], uint8_t row) { +static bool board_read_cols_on_follower_row(board_info_t* board, matrix_row_t current_matrix[], uint8_t row) { matrix_row_t last_row_value = current_matrix[row]; current_matrix[row] = 0; uint8_t board_row = matrix2board(row); - board_select_slave_row(board, board_row); + board_select_follower_row(board, board_row); wait_us(30); - uint8_t cols = board_read_slave_cols(board); + uint8_t cols = board_read_follower_cols(board); for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { uint8_t pin = board->col_pins[col_index]; uint8_t pin_state = cols & PIN2BIT(pin); current_matrix[row] |= pin_state ? 0 : (1 << col_index); } - board_unselect_slave_row(board, board_row); + board_unselect_follower_row(board, board_row); return (last_row_value != current_matrix[row]); } @@ -359,6 +359,6 @@ void board_unselect_rows(void) { void board_init(void) { board_setup(); board_master_init(); - board_slave_init(); + board_follower_init(); board_unselect_rows(); } diff --git a/keyboards/chimera_ergo/matrix.c b/keyboards/chimera_ergo/matrix.c index d512a51d9735..dd8e90ed873c 100644 --- a/keyboards/chimera_ergo/matrix.c +++ b/keyboards/chimera_ergo/matrix.c @@ -96,7 +96,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; - //the s character requests the RF slave to send the matrix + //the s character requests the RF follower to send the matrix SERIAL_UART_DATA = 's'; //trust the external keystates entirely, erase the last data diff --git a/keyboards/chimera_ls/matrix.c b/keyboards/chimera_ls/matrix.c index 72fe4413704a..ddfa637c0b78 100644 --- a/keyboards/chimera_ls/matrix.c +++ b/keyboards/chimera_ls/matrix.c @@ -100,7 +100,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; - //the s character requests the RF slave to send the matrix + //the s character requests the RF follower to send the matrix SERIAL_UART_DATA = 's'; //trust the external keystates entirely, erase the last data diff --git a/keyboards/chimera_ortho/matrix.c b/keyboards/chimera_ortho/matrix.c index dc38ba74f865..c316b098f871 100644 --- a/keyboards/chimera_ortho/matrix.c +++ b/keyboards/chimera_ortho/matrix.c @@ -86,7 +86,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; - //the s character requests the RF slave to send the matrix + //the s character requests the RF follower to send the matrix SERIAL_UART_DATA = 's'; //trust the external keystates entirely, erase the last data diff --git a/keyboards/chimera_ortho_plus/matrix.c b/keyboards/chimera_ortho_plus/matrix.c index ed6eac2b0933..a6139bbe7798 100644 --- a/keyboards/chimera_ortho_plus/matrix.c +++ b/keyboards/chimera_ortho_plus/matrix.c @@ -86,7 +86,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; - //the s character requests the RF slave to send the matrix + //the s character requests the RF follower to send the matrix SERIAL_UART_DATA = 's'; //trust the external keystates entirely, erase the last data diff --git a/keyboards/claw44/i2c.c b/keyboards/claw44/i2c.c index 4bee5c639829..af23dc5748b0 100644 --- a/keyboards/claw44/i2c.c +++ b/keyboards/claw44/i2c.c @@ -16,12 +16,12 @@ // poll loop takes at least 8 clock cycles to execute #define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) +#define BUFFER_POS_INC() (follower_buffer_pos = (follower_buffer_pos+1)%follower_BUFFER_SIZE) -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; +static volatile uint8_t follower_buffer_pos; +static volatile bool follower_has_register_set = false; // Wait for an i2c operation to finish inline static @@ -43,7 +43,7 @@ void i2c_master_init(void) { TWBR = ((F_CPU/SCL_CLOCK)-16)/2; } -// Start a transaction with the given i2c slave address. The direction of the +// Start a transaction with the given i2c follower address. The direction of the // transfer is set with I2C_READ and I2C_WRITE. // returns: 0 => success // 1 => error @@ -62,7 +62,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -77,20 +77,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/claw44/i2c.h b/keyboards/claw44/i2c.h index 710662c7abd6..b14ed967dcce 100644 --- a/keyboards/claw44/i2c.h +++ b/keyboards/claw44/i2c.h @@ -12,12 +12,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency 400kHz #define SCL_CLOCK 400000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -25,7 +25,7 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); static inline unsigned char i2c_start_read(unsigned char addr) { diff --git a/keyboards/claw44/rev1/matrix.c b/keyboards/claw44/rev1/matrix.c index a5896d9792a1..96fca2358ef0 100644 --- a/keyboards/claw44/rev1/matrix.c +++ b/keyboards/claw44/rev1/matrix.c @@ -151,9 +151,9 @@ uint8_t _matrix_scan(void) // Get rows from other half over i2c int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + int err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) goto i2c_error; // start of matrix stored at 0x00 @@ -161,15 +161,15 @@ int i2c_transaction(void) { if (err) goto i2c_error; // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_READ); if (err) goto i2c_error; if (!err) { int i; for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + matrix[followerOffset+i] = i2c_master_read(I2C_ACK); } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + matrix[followerOffset+i] = i2c_master_read(I2C_NACK); i2c_master_stop(); } else { i2c_error: // the cable is disconnceted, or something else went wrong @@ -183,7 +183,7 @@ int i2c_transaction(void) { #else // USE_SERIAL int serial_transaction(int master_changed) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; #ifdef SERIAL_USE_MULTI_TRANSACTION int ret=serial_update_buffers(master_changed); #else @@ -194,8 +194,8 @@ int serial_transaction(int master_changed) { return 1; } writePinHigh(B0); - memcpy(&matrix[slaveOffset], - (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); + memcpy(&matrix[followerOffset], + (void *)serial_follower_buffer, SERIAL_follower_BUFFER_LENGTH); return 0; } #endif @@ -205,7 +205,7 @@ uint8_t matrix_scan(void) if (is_master) { matrix_master_scan(); }else{ - matrix_slave_scan(); + matrix_follower_scan(); int offset = (isLeftHand) ? ROWS_PER_HAND : 0; memcpy(&matrix[offset], (void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH); @@ -224,8 +224,8 @@ uint8_t matrix_master_scan(void) { #ifdef USE_MATRIX_I2C // for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ -// i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ +// i2c_follower_buffer[i] = matrix[offset+i]; // } #else // USE_SERIAL #ifdef SERIAL_USE_MULTI_TRANSACTION @@ -248,9 +248,9 @@ uint8_t matrix_master_scan(void) { if (error_count > ERROR_DISCONNECT_COUNT) { // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; + matrix[followerOffset+i] = 0; } } } else { @@ -262,15 +262,15 @@ uint8_t matrix_master_scan(void) { return ret; } -void matrix_slave_scan(void) { +void matrix_follower_scan(void) { _matrix_scan(); int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; #ifdef USE_MATRIX_I2C for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ + i2c_follower_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL #ifdef SERIAL_USE_MULTI_TRANSACTION @@ -278,13 +278,13 @@ void matrix_slave_scan(void) { #endif for (int i = 0; i < ROWS_PER_HAND; ++i) { #ifdef SERIAL_USE_MULTI_TRANSACTION - if( serial_slave_buffer[i] != matrix[offset+i] ) + if( serial_follower_buffer[i] != matrix[offset+i] ) change = 1; #endif - serial_slave_buffer[i] = matrix[offset+i]; + serial_follower_buffer[i] = matrix[offset+i]; } #ifdef SERIAL_USE_MULTI_TRANSACTION - slave_buffer_change_count += change; + follower_buffer_change_count += change; #endif #endif } diff --git a/keyboards/claw44/rev1/split_scomm.c b/keyboards/claw44/rev1/split_scomm.c index a1fe6ba5b823..05c67f2b8f9b 100644 --- a/keyboards/claw44/rev1/split_scomm.c +++ b/keyboards/claw44/rev1/split_scomm.c @@ -11,32 +11,32 @@ #include #endif -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; uint8_t volatile status_com = 0; uint8_t volatile status1 = 0; -uint8_t slave_buffer_change_count = 0; +uint8_t follower_buffer_change_count = 0; uint8_t s_change_old = 0xff; uint8_t s_change_new = 0xff; SSTD_t transactions[] = { -#define GET_SLAVE_STATUS 0 - /* master buffer not changed, only recive slave_buffer_change_count */ +#define GET_follower_STATUS 0 + /* master buffer not changed, only recive follower_buffer_change_count */ { (uint8_t *)&status_com, 0, NULL, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, + sizeof(follower_buffer_change_count), &follower_buffer_change_count, }, -#define PUT_MASTER_GET_SLAVE_STATUS 1 - /* master buffer changed need send, and recive slave_buffer_change_count */ +#define PUT_MASTER_GET_follower_STATUS 1 + /* master buffer changed need send, and recive follower_buffer_change_count */ { (uint8_t *)&status_com, sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, + sizeof(follower_buffer_change_count), &follower_buffer_change_count, }, -#define GET_SLAVE_BUFFER 2 - /* recive serial_slave_buffer */ +#define GET_follower_BUFFER 2 + /* recive serial_follower_buffer */ { (uint8_t *)&status1, 0, NULL, - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + sizeof(serial_follower_buffer), (uint8_t *)serial_follower_buffer } }; @@ -45,13 +45,13 @@ void serial_master_init(void) soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void serial_slave_init(void) +void serial_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers(int master_update) { @@ -59,27 +59,27 @@ int serial_update_buffers(int master_update) static int need_retry = 0; if( s_change_old != s_change_new ) { - smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + smatstatus = soft_serial_transaction(GET_follower_BUFFER); if( smatstatus == TRANSACTION_END ) { s_change_old = s_change_new; #ifdef CONSOLE_ENABLE - uprintf("slave matrix = %b %b %b %b\n", - serial_slave_buffer[0], serial_slave_buffer[1], - serial_slave_buffer[2], serial_slave_buffer[3]); + uprintf("follower matrix = %b %b %b %b\n", + serial_follower_buffer[0], serial_follower_buffer[1], + serial_follower_buffer[2], serial_follower_buffer[3]); #endif } } else { - // serial_slave_buffer dosen't change + // serial_follower_buffer dosen't change smatstatus = TRANSACTION_END; // dummy status } if( !master_update && !need_retry) { - status = soft_serial_transaction(GET_SLAVE_STATUS); + status = soft_serial_transaction(GET_follower_STATUS); } else { - status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + status = soft_serial_transaction(PUT_MASTER_GET_follower_STATUS); } if( status == TRANSACTION_END ) { - s_change_new = slave_buffer_change_count; + s_change_new = follower_buffer_change_count; need_retry = 0; } else { need_retry = 1; diff --git a/keyboards/claw44/rev1/split_scomm.h b/keyboards/claw44/rev1/split_scomm.h index 873d8939d81f..4a377a13c93f 100644 --- a/keyboards/claw44/rev1/split_scomm.h +++ b/keyboards/claw44/rev1/split_scomm.h @@ -7,16 +7,16 @@ #else /* --- USE flexible API (using multi-type transaction function) --- */ -// Buffers for master - slave communication -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// Buffers for master - follower communication +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; -extern uint8_t slave_buffer_change_count; +extern uint8_t follower_buffer_change_count; void serial_master_init(void); -void serial_slave_init(void); +void serial_follower_init(void); int serial_update_buffers(int master_changed); #endif diff --git a/keyboards/claw44/rev1/split_util.c b/keyboards/claw44/rev1/split_util.c index e1ff8b4379dc..e2d2ca6cdeb0 100644 --- a/keyboards/claw44/rev1/split_util.c +++ b/keyboards/claw44/rev1/split_util.c @@ -38,12 +38,12 @@ static void keyboard_master_setup(void) { #endif } -static void keyboard_slave_setup(void) { +static void keyboard_follower_setup(void) { #ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); + i2c_follower_init(follower_I2C_ADDRESS); #else - serial_slave_init(); + serial_follower_init(); #endif } @@ -59,7 +59,7 @@ void split_keyboard_setup(void) { if (has_usb()) { keyboard_master_setup(); } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } sei(); } diff --git a/keyboards/claw44/rev1/split_util.h b/keyboards/claw44/rev1/split_util.h index 687ca19bd3e5..0c226201f3aa 100644 --- a/keyboards/claw44/rev1/split_util.h +++ b/keyboards/claw44/rev1/split_util.h @@ -4,12 +4,12 @@ #include #include "eeconfig.h" -#define SLAVE_I2C_ADDRESS 0x32 +#define follower_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); +// follower version of matix scan, defined in matrix.c +void matrix_follower_scan(void); void split_keyboard_setup(void); bool has_usb(void); diff --git a/keyboards/claw44/serial.c b/keyboards/claw44/serial.c index f6293c3dc231..086b8c25b8bd 100644 --- a/keyboards/claw44/serial.c +++ b/keyboards/claw44/serial.c @@ -72,8 +72,8 @@ //////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #if SERIAL_follower_BUFFER_LENGTH > 0 + uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; #endif #if SERIAL_MASTER_BUFFER_LENGTH > 0 uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; @@ -87,8 +87,8 @@ SSTD_t transactions[] = { #else 0, (uint8_t *)NULL, #endif - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #if SERIAL_follower_BUFFER_LENGTH > 0 + sizeof(serial_follower_buffer), (uint8_t *)serial_follower_buffer #else 0, (uint8_t *)NULL, #endif @@ -98,11 +98,11 @@ SSTD_t transactions[] = { void serial_master_init(void) { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void serial_slave_init(void) +void serial_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers() { @@ -212,12 +212,12 @@ int serial_update_buffers() #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) -#define SLAVE_INT_WIDTH_US 1 +#define follower_INT_WIDTH_US 1 #ifndef SERIAL_USE_MULTI_TRANSACTION - #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY + #define follower_INT_RESPONSE_TIME SERIAL_DELAY #else - #define SLAVE_INT_ACK_WIDTH_UNIT 2 - #define SLAVE_INT_ACK_WIDTH 4 + #define follower_INT_ACK_WIDTH_UNIT 2 + #define follower_INT_ACK_WIDTH 4 #endif static SSTD_t *Transaction_table = NULL; @@ -436,7 +436,7 @@ ISR(SERIAL_PIN_INTERRUPT) { serial_high(); // response step1 low->high serial_output(); - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT*follower_INT_ACK_WIDTH); SSTD_t *trans = &Transaction_table[tid]; serial_low(); // response step2 ack high->low #endif @@ -487,12 +487,12 @@ int soft_serial_transaction(int sstd_index) { // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(SLAVE_INT_WIDTH_US); + _delay_us(follower_INT_WIDTH_US); #ifndef SERIAL_USE_MULTI_TRANSACTION // wait for the target response serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); + _delay_us(follower_INT_RESPONSE_TIME); // check if the target is present if (serial_read_pin()) { @@ -520,15 +520,15 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { - if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present + if (i > follower_INT_ACK_WIDTH + 1) { + // follower failed to pull the line low, assume not present serial_output(); serial_high(); *trans->status = TRANSACTION_NO_RESPONSE; sei(); return TRANSACTION_NO_RESPONSE; } - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT); } #endif @@ -577,7 +577,7 @@ int soft_serial_get_and_clean_status(int sstd_index) { // Helix serial.c history // 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) -// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// 2018-6-28 bug fix master to follower comm and speed up (#3255, 1038bbef4) // (adjusted with avr-gcc 4.9.2) // 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) // (adjusted with avr-gcc 4.9.2) diff --git a/keyboards/claw44/serial.h b/keyboards/claw44/serial.h index 7e0c0847a431..8775c030a08e 100644 --- a/keyboards/claw44/serial.h +++ b/keyboards/claw44/serial.h @@ -17,7 +17,7 @@ // // //// USE Simple API (OLD API, compatible with let's split serial.c) // ex. -// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 // #define SERIAL_MASTER_BUFFER_LENGTH 1 // // //// USE flexible API (using multi-type transaction function) @@ -28,15 +28,15 @@ #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ -#if SERIAL_SLAVE_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#if SERIAL_follower_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; #endif #if SERIAL_MASTER_BUFFER_LENGTH > 0 extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; #endif void serial_master_init(void); -void serial_slave_init(void); +void serial_follower_init(void); int serial_update_buffers(void); #endif // USE Simple API diff --git a/keyboards/comet46/i2c.c b/keyboards/comet46/i2c.c index 4bee5c639829..af23dc5748b0 100644 --- a/keyboards/comet46/i2c.c +++ b/keyboards/comet46/i2c.c @@ -16,12 +16,12 @@ // poll loop takes at least 8 clock cycles to execute #define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) +#define BUFFER_POS_INC() (follower_buffer_pos = (follower_buffer_pos+1)%follower_BUFFER_SIZE) -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; +static volatile uint8_t follower_buffer_pos; +static volatile bool follower_has_register_set = false; // Wait for an i2c operation to finish inline static @@ -43,7 +43,7 @@ void i2c_master_init(void) { TWBR = ((F_CPU/SCL_CLOCK)-16)/2; } -// Start a transaction with the given i2c slave address. The direction of the +// Start a transaction with the given i2c follower address. The direction of the // transfer is set with I2C_READ and I2C_WRITE. // returns: 0 => success // 1 => error @@ -62,7 +62,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -77,20 +77,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/comet46/i2c.h b/keyboards/comet46/i2c.h index 47cf6bd1b2c9..1898ad3de167 100644 --- a/keyboards/comet46/i2c.h +++ b/keyboards/comet46/i2c.h @@ -13,12 +13,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency 400kHz #define SCL_CLOCK 400000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -26,7 +26,7 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); static inline unsigned char i2c_start_read(unsigned char addr) { diff --git a/keyboards/comet46/matrix.c b/keyboards/comet46/matrix.c index dc38ba74f865..c316b098f871 100644 --- a/keyboards/comet46/matrix.c +++ b/keyboards/comet46/matrix.c @@ -86,7 +86,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; - //the s character requests the RF slave to send the matrix + //the s character requests the RF follower to send the matrix SERIAL_UART_DATA = 's'; //trust the external keystates entirely, erase the last data diff --git a/keyboards/converter/ibm_terminal/config.h b/keyboards/converter/ibm_terminal/config.h index ba9ec82fa287..0037b4053148 100644 --- a/keyboards/converter/ibm_terminal/config.h +++ b/keyboards/converter/ibm_terminal/config.h @@ -59,7 +59,7 @@ along with this program. If not, see . #define PS2_DATA_BIT 2 /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ -/* set DDR of CLOCK as input to be slave */ +/* set DDR of CLOCK as input to be follower */ #define PS2_USART_INIT() do { \ PS2_CLOCK_DDR &= ~(1< success // 1 => error @@ -62,7 +62,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -77,20 +77,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/crkbd/i2c.h b/keyboards/crkbd/i2c.h index 710662c7abd6..b14ed967dcce 100644 --- a/keyboards/crkbd/i2c.h +++ b/keyboards/crkbd/i2c.h @@ -12,12 +12,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency 400kHz #define SCL_CLOCK 400000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -25,7 +25,7 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); static inline unsigned char i2c_start_read(unsigned char addr) { diff --git a/keyboards/crkbd/keymaps/kidbrazil/keymap.c b/keyboards/crkbd/keymaps/kidbrazil/keymap.c index 9c950e537349..4c27af8669a9 100644 --- a/keyboards/crkbd/keymaps/kidbrazil/keymap.c +++ b/keyboards/crkbd/keymaps/kidbrazil/keymap.c @@ -166,8 +166,8 @@ void render_master_oled(void) { } } -// Slave OLED scren (Right Hand) -void render_slave_oled(void) { +// follower OLED scren (Right Hand) +void render_follower_oled(void) { render_logo(); } @@ -205,7 +205,7 @@ void oled_task_user(void) { if (is_master) { render_master_oled(); } else { - render_slave_oled(); + render_follower_oled(); } } } diff --git a/keyboards/crkbd/keymaps/rpbaptist/readme.md b/keyboards/crkbd/keymaps/rpbaptist/readme.md index b9e749b5c67e..d601092c0ad1 100644 --- a/keyboards/crkbd/keymaps/rpbaptist/readme.md +++ b/keyboards/crkbd/keymaps/rpbaptist/readme.md @@ -61,7 +61,7 @@ I took a big inspiration from Drashna's RGB configuration and tweaked it. ## Notes -I use several OLED slave side images, depending on the keycaps I am using. These also determine the default LED color and underglow. +I use several OLED follower side images, depending on the keycaps I am using. These also determine the default LED color and underglow. `make crkbd/rev1:rpbaptist:dfu THEME=pulse` diff --git a/keyboards/crkbd/rev1/matrix.c b/keyboards/crkbd/rev1/matrix.c index 46dead369fa8..d7fb2b8f0c82 100644 --- a/keyboards/crkbd/rev1/matrix.c +++ b/keyboards/crkbd/rev1/matrix.c @@ -186,9 +186,9 @@ uint8_t _matrix_scan(void) // Get rows from other half over i2c int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + int err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) goto i2c_error; // start of matrix stored at 0x00 @@ -196,15 +196,15 @@ int i2c_transaction(void) { if (err) goto i2c_error; // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_READ); if (err) goto i2c_error; if (!err) { int i; for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + matrix[followerOffset+i] = i2c_master_read(I2C_ACK); } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + matrix[followerOffset+i] = i2c_master_read(I2C_NACK); i2c_master_stop(); } else { i2c_error: // the cable is disconnceted, or something else went wrong @@ -218,7 +218,7 @@ int i2c_transaction(void) { #else // USE_SERIAL int serial_transaction(int master_changed) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; #ifdef SERIAL_USE_MULTI_TRANSACTION int ret=serial_update_buffers(master_changed); #else @@ -229,8 +229,8 @@ int serial_transaction(int master_changed) { return 1; } rx_led_off(); - memcpy(&matrix[slaveOffset], - (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); + memcpy(&matrix[followerOffset], + (void *)serial_follower_buffer, SERIAL_follower_BUFFER_LENGTH); return 0; } #endif @@ -240,7 +240,7 @@ uint8_t matrix_scan(void) if (is_master) { matrix_master_scan(); }else{ - matrix_slave_scan(); + matrix_follower_scan(); int offset = (isLeftHand) ? ROWS_PER_HAND : 0; memcpy(&matrix[offset], (void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH); @@ -259,8 +259,8 @@ uint8_t matrix_master_scan(void) { #ifdef USE_MATRIX_I2C // for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ -// i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ +// i2c_follower_buffer[i] = matrix[offset+i]; // } #else // USE_SERIAL #ifdef SERIAL_USE_MULTI_TRANSACTION @@ -283,9 +283,9 @@ uint8_t matrix_master_scan(void) { if (error_count > ERROR_DISCONNECT_COUNT) { // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; + matrix[followerOffset+i] = 0; } } } else { @@ -297,15 +297,15 @@ uint8_t matrix_master_scan(void) { return ret; } -void matrix_slave_scan(void) { +void matrix_follower_scan(void) { _matrix_scan(); int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; #ifdef USE_MATRIX_I2C for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ + i2c_follower_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL #ifdef SERIAL_USE_MULTI_TRANSACTION @@ -313,13 +313,13 @@ void matrix_slave_scan(void) { #endif for (int i = 0; i < ROWS_PER_HAND; ++i) { #ifdef SERIAL_USE_MULTI_TRANSACTION - if( serial_slave_buffer[i] != matrix[offset+i] ) + if( serial_follower_buffer[i] != matrix[offset+i] ) change = 1; #endif - serial_slave_buffer[i] = matrix[offset+i]; + serial_follower_buffer[i] = matrix[offset+i]; } #ifdef SERIAL_USE_MULTI_TRANSACTION - slave_buffer_change_count += change; + follower_buffer_change_count += change; #endif #endif } diff --git a/keyboards/crkbd/rev1/serial_config_simpleapi.h b/keyboards/crkbd/rev1/serial_config_simpleapi.h index 0e1dd9e4acb2..b17a1f1f86c3 100644 --- a/keyboards/crkbd/rev1/serial_config_simpleapi.h +++ b/keyboards/crkbd/rev1/serial_config_simpleapi.h @@ -1,5 +1,5 @@ #pragma once #undef SERIAL_USE_MULTI_TRANSACTION -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 diff --git a/keyboards/crkbd/rev1/split_scomm.c b/keyboards/crkbd/rev1/split_scomm.c index 12b00f6840f6..1d6a2be05b3e 100644 --- a/keyboards/crkbd/rev1/split_scomm.c +++ b/keyboards/crkbd/rev1/split_scomm.c @@ -11,32 +11,32 @@ #include "debug.h" #endif -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; uint8_t volatile status_com = 0; uint8_t volatile status1 = 0; -uint8_t slave_buffer_change_count = 0; +uint8_t follower_buffer_change_count = 0; uint8_t s_change_old = 0xff; uint8_t s_change_new = 0xff; SSTD_t transactions[] = { -#define GET_SLAVE_STATUS 0 - /* master buffer not changed, only recive slave_buffer_change_count */ +#define GET_follower_STATUS 0 + /* master buffer not changed, only recive follower_buffer_change_count */ { (uint8_t *)&status_com, 0, NULL, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, + sizeof(follower_buffer_change_count), &follower_buffer_change_count, }, -#define PUT_MASTER_GET_SLAVE_STATUS 1 - /* master buffer changed need send, and recive slave_buffer_change_count */ +#define PUT_MASTER_GET_follower_STATUS 1 + /* master buffer changed need send, and recive follower_buffer_change_count */ { (uint8_t *)&status_com, sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, + sizeof(follower_buffer_change_count), &follower_buffer_change_count, }, -#define GET_SLAVE_BUFFER 2 - /* recive serial_slave_buffer */ +#define GET_follower_BUFFER 2 + /* recive serial_follower_buffer */ { (uint8_t *)&status1, 0, NULL, - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + sizeof(serial_follower_buffer), (uint8_t *)serial_follower_buffer } }; @@ -45,13 +45,13 @@ void serial_master_init(void) soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void serial_slave_init(void) +void serial_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers(int master_update) { @@ -59,29 +59,29 @@ int serial_update_buffers(int master_update) static int need_retry = 0; if( s_change_old != s_change_new ) { - smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + smatstatus = soft_serial_transaction(GET_follower_BUFFER); if( smatstatus == TRANSACTION_END ) { s_change_old = s_change_new; #ifdef CONSOLE_ENABLE if (debug_matrix) { - uprintf("slave matrix = %b %b %b %b\n", - serial_slave_buffer[0], serial_slave_buffer[1], - serial_slave_buffer[2], serial_slave_buffer[3]); + uprintf("follower matrix = %b %b %b %b\n", + serial_follower_buffer[0], serial_follower_buffer[1], + serial_follower_buffer[2], serial_follower_buffer[3]); } #endif } } else { - // serial_slave_buffer dosen't change + // serial_follower_buffer dosen't change smatstatus = TRANSACTION_END; // dummy status } if( !master_update && !need_retry) { - status = soft_serial_transaction(GET_SLAVE_STATUS); + status = soft_serial_transaction(GET_follower_STATUS); } else { - status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + status = soft_serial_transaction(PUT_MASTER_GET_follower_STATUS); } if( status == TRANSACTION_END ) { - s_change_new = slave_buffer_change_count; + s_change_new = follower_buffer_change_count; need_retry = 0; } else { need_retry = 1; diff --git a/keyboards/crkbd/rev1/split_scomm.h b/keyboards/crkbd/rev1/split_scomm.h index 873d8939d81f..4a377a13c93f 100644 --- a/keyboards/crkbd/rev1/split_scomm.h +++ b/keyboards/crkbd/rev1/split_scomm.h @@ -7,16 +7,16 @@ #else /* --- USE flexible API (using multi-type transaction function) --- */ -// Buffers for master - slave communication -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// Buffers for master - follower communication +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; -extern uint8_t slave_buffer_change_count; +extern uint8_t follower_buffer_change_count; void serial_master_init(void); -void serial_slave_init(void); +void serial_follower_init(void); int serial_update_buffers(int master_changed); #endif diff --git a/keyboards/crkbd/rev1/split_util.c b/keyboards/crkbd/rev1/split_util.c index b642a734cc52..792ae5b1c35b 100644 --- a/keyboards/crkbd/rev1/split_util.c +++ b/keyboards/crkbd/rev1/split_util.c @@ -59,17 +59,17 @@ __attribute__((weak)) bool is_keyboard_left(void) { } __attribute__((weak)) bool has_usb(void) { - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; + static enum { UNKNOWN, MASTER, follower } usbstate = UNKNOWN; // only check once, as this is called often if (usbstate == UNKNOWN) { #if defined(SPLIT_USB_DETECT) - usbstate = waitForUsb() ? MASTER : SLAVE; + usbstate = waitForUsb() ? MASTER : follower; #elif defined(__AVR__) USBCON |= (1 << OTGPADE); // enables VBUS pad wait_us(5); - usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS + usbstate = (USBSTA & (1 << VBUS)) ? MASTER : follower; // checks state of VBUS #else usbstate = MASTER; #endif @@ -87,12 +87,12 @@ static void keyboard_master_setup(void) { #endif } -static void keyboard_slave_setup(void) { +static void keyboard_follower_setup(void) { #ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); + i2c_follower_init(follower_I2C_ADDRESS); #else - serial_slave_init(); + serial_follower_init(); #endif } @@ -103,7 +103,7 @@ void split_keyboard_setup(void) { if (has_usb()) { keyboard_master_setup(); } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } sei(); } diff --git a/keyboards/crkbd/rev1/split_util.h b/keyboards/crkbd/rev1/split_util.h index 687ca19bd3e5..0c226201f3aa 100644 --- a/keyboards/crkbd/rev1/split_util.h +++ b/keyboards/crkbd/rev1/split_util.h @@ -4,12 +4,12 @@ #include #include "eeconfig.h" -#define SLAVE_I2C_ADDRESS 0x32 +#define follower_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); +// follower version of matix scan, defined in matrix.c +void matrix_follower_scan(void); void split_keyboard_setup(void); bool has_usb(void); diff --git a/keyboards/crkbd/serial.c b/keyboards/crkbd/serial.c index f6293c3dc231..086b8c25b8bd 100644 --- a/keyboards/crkbd/serial.c +++ b/keyboards/crkbd/serial.c @@ -72,8 +72,8 @@ //////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #if SERIAL_follower_BUFFER_LENGTH > 0 + uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; #endif #if SERIAL_MASTER_BUFFER_LENGTH > 0 uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; @@ -87,8 +87,8 @@ SSTD_t transactions[] = { #else 0, (uint8_t *)NULL, #endif - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #if SERIAL_follower_BUFFER_LENGTH > 0 + sizeof(serial_follower_buffer), (uint8_t *)serial_follower_buffer #else 0, (uint8_t *)NULL, #endif @@ -98,11 +98,11 @@ SSTD_t transactions[] = { void serial_master_init(void) { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void serial_slave_init(void) +void serial_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers() { @@ -212,12 +212,12 @@ int serial_update_buffers() #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) -#define SLAVE_INT_WIDTH_US 1 +#define follower_INT_WIDTH_US 1 #ifndef SERIAL_USE_MULTI_TRANSACTION - #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY + #define follower_INT_RESPONSE_TIME SERIAL_DELAY #else - #define SLAVE_INT_ACK_WIDTH_UNIT 2 - #define SLAVE_INT_ACK_WIDTH 4 + #define follower_INT_ACK_WIDTH_UNIT 2 + #define follower_INT_ACK_WIDTH 4 #endif static SSTD_t *Transaction_table = NULL; @@ -436,7 +436,7 @@ ISR(SERIAL_PIN_INTERRUPT) { serial_high(); // response step1 low->high serial_output(); - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT*follower_INT_ACK_WIDTH); SSTD_t *trans = &Transaction_table[tid]; serial_low(); // response step2 ack high->low #endif @@ -487,12 +487,12 @@ int soft_serial_transaction(int sstd_index) { // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(SLAVE_INT_WIDTH_US); + _delay_us(follower_INT_WIDTH_US); #ifndef SERIAL_USE_MULTI_TRANSACTION // wait for the target response serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); + _delay_us(follower_INT_RESPONSE_TIME); // check if the target is present if (serial_read_pin()) { @@ -520,15 +520,15 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { - if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present + if (i > follower_INT_ACK_WIDTH + 1) { + // follower failed to pull the line low, assume not present serial_output(); serial_high(); *trans->status = TRANSACTION_NO_RESPONSE; sei(); return TRANSACTION_NO_RESPONSE; } - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT); } #endif @@ -577,7 +577,7 @@ int soft_serial_get_and_clean_status(int sstd_index) { // Helix serial.c history // 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) -// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// 2018-6-28 bug fix master to follower comm and speed up (#3255, 1038bbef4) // (adjusted with avr-gcc 4.9.2) // 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) // (adjusted with avr-gcc 4.9.2) diff --git a/keyboards/crkbd/serial.h b/keyboards/crkbd/serial.h index 7e0c0847a431..8775c030a08e 100644 --- a/keyboards/crkbd/serial.h +++ b/keyboards/crkbd/serial.h @@ -17,7 +17,7 @@ // // //// USE Simple API (OLD API, compatible with let's split serial.c) // ex. -// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 // #define SERIAL_MASTER_BUFFER_LENGTH 1 // // //// USE flexible API (using multi-type transaction function) @@ -28,15 +28,15 @@ #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ -#if SERIAL_SLAVE_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#if SERIAL_follower_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; #endif #if SERIAL_MASTER_BUFFER_LENGTH > 0 extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; #endif void serial_master_init(void); -void serial_slave_init(void); +void serial_follower_init(void); int serial_update_buffers(void); #endif // USE Simple API diff --git a/keyboards/dc01/arrow/matrix.c b/keyboards/dc01/arrow/matrix.c index 1823138c39d0..524a8f2644e9 100644 --- a/keyboards/dc01/arrow/matrix.c +++ b/keyboards/dc01/arrow/matrix.c @@ -29,10 +29,10 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" #include "timer.h" -#include "i2c_slave.h" +#include "i2c_follower.h" #include "lufa.h" -#define SLAVE_I2C_ADDRESS 0x23 +#define follower_I2C_ADDRESS 0x23 /* Set 0 if debouncing isn't needed */ @@ -197,9 +197,9 @@ uint8_t matrix_scan(void) # endif if (USB_DeviceState != DEVICE_STATE_Configured){ - i2c_slave_reg[1] = 0x55; + i2c_follower_reg[1] = 0x55; for (uint8_t i = 0; i < MATRIX_ROWS; i++){ - i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c + i2c_follower_reg[i+2] = matrix[i]; //send matrix over i2c } } @@ -398,7 +398,7 @@ static void unselect_cols(void) void matrix_setup(void){ if (USB_DeviceState != DEVICE_STATE_Configured){ - i2c_slave_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c + i2c_follower_init(follower_I2C_ADDRESS); //setup address of follower i2c sei(); //enable interupts } } \ No newline at end of file diff --git a/keyboards/dc01/arrow/rules.mk b/keyboards/dc01/arrow/rules.mk index 6643ad789e7e..c31c4c247dfa 100644 --- a/keyboards/dc01/arrow/rules.mk +++ b/keyboards/dc01/arrow/rules.mk @@ -33,4 +33,4 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in CUSTOM_MATRIX = yes # Use custom matrix SRC += matrix.c \ - i2c_slave.c + i2c_follower.c diff --git a/keyboards/dc01/left/i2c.c b/keyboards/dc01/left/i2c.c index c72789403e55..78253538cb3e 100644 --- a/keyboards/dc01/left/i2c.c +++ b/keyboards/dc01/left/i2c.c @@ -14,12 +14,12 @@ // poll loop takes at least 8 clock cycles to execute #define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) +#define BUFFER_POS_INC() (follower_buffer_pos = (follower_buffer_pos+1)%follower_BUFFER_SIZE) -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; +static volatile uint8_t follower_buffer_pos; +static volatile bool follower_has_register_set = false; // Wait for an i2c operation to finish inline static @@ -41,7 +41,7 @@ void i2c_master_init(void) { TWBR = ((F_CPU/SCL_CLOCK)-16)/2; } -// Start a transaction with the given i2c slave address. The direction of the +// Start a transaction with the given i2c follower address. The direction of the // transfer is set with I2C_READ and I2C_WRITE. // returns: 0 => success // 1 => error @@ -60,7 +60,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -75,20 +75,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/dc01/left/i2c.h b/keyboards/dc01/left/i2c.h index 25e876658bbd..793fed79cad9 100644 --- a/keyboards/dc01/left/i2c.h +++ b/keyboards/dc01/left/i2c.h @@ -13,12 +13,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency #define SCL_CLOCK 400000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -26,6 +26,6 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); #endif diff --git a/keyboards/dc01/left/matrix.c b/keyboards/dc01/left/matrix.c index 0e7b591f82cf..9674c28e0a69 100644 --- a/keyboards/dc01/left/matrix.c +++ b/keyboards/dc01/left/matrix.c @@ -31,9 +31,9 @@ along with this program. If not, see . #include "timer.h" #include "i2c_master.h" -#define SLAVE_I2C_ADDRESS_RIGHT 0x19 -#define SLAVE_I2C_ADDRESS_NUMPAD 0x21 -#define SLAVE_I2C_ADDRESS_ARROW 0x23 +#define follower_I2C_ADDRESS_RIGHT 0x19 +#define follower_I2C_ADDRESS_NUMPAD 0x21 +#define follower_I2C_ADDRESS_ARROW 0x23 #define ERROR_DISCONNECT_COUNT 5 static uint8_t error_count_right = 0; @@ -210,7 +210,7 @@ uint8_t matrix_scan(void) } # endif - if (i2c_transaction(SLAVE_I2C_ADDRESS_RIGHT, 0x3F, 0)){ //error has occured for main right half + if (i2c_transaction(follower_I2C_ADDRESS_RIGHT, 0x3F, 0)){ //error has occured for main right half error_count_right++; if (error_count_right > ERROR_DISCONNECT_COUNT){ //disconnect half for (uint8_t i = 0; i < MATRIX_ROWS ; i++) { @@ -221,7 +221,7 @@ uint8_t matrix_scan(void) error_count_right = 0; } - if (i2c_transaction(SLAVE_I2C_ADDRESS_ARROW, 0X3FFF, 8)){ //error has occured for arrow cluster + if (i2c_transaction(follower_I2C_ADDRESS_ARROW, 0X3FFF, 8)){ //error has occured for arrow cluster error_count_arrow++; if (error_count_arrow > ERROR_DISCONNECT_COUNT){ //disconnect arrow cluster for (uint8_t i = 0; i < MATRIX_ROWS ; i++) { @@ -232,7 +232,7 @@ uint8_t matrix_scan(void) error_count_arrow = 0; } - if (i2c_transaction(SLAVE_I2C_ADDRESS_NUMPAD, 0x1FFFF, 11)){ //error has occured for numpad + if (i2c_transaction(follower_I2C_ADDRESS_NUMPAD, 0x1FFFF, 11)){ //error has occured for numpad error_count_numpad++; if (error_count_numpad > ERROR_DISCONNECT_COUNT){ //disconnect numpad for (uint8_t i = 0; i < MATRIX_ROWS ; i++) { @@ -444,7 +444,7 @@ i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset) err = i2c_read_ack(10); if (err == 0x55) { //synchronization byte - for (uint8_t i = 0; i < MATRIX_ROWS-1 ; i++) { //assemble slave matrix in main matrix + for (uint8_t i = 0; i < MATRIX_ROWS-1 ; i++) { //assemble follower matrix in main matrix matrix[i] &= mask; //mask bits to keep err = i2c_read_ack(10); matrix[i] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end diff --git a/keyboards/dc01/numpad/matrix.c b/keyboards/dc01/numpad/matrix.c index f8b725adc285..55c09cacc8ab 100644 --- a/keyboards/dc01/numpad/matrix.c +++ b/keyboards/dc01/numpad/matrix.c @@ -29,10 +29,10 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" #include "timer.h" -#include "i2c_slave.h" +#include "i2c_follower.h" #include "lufa.h" -#define SLAVE_I2C_ADDRESS 0x21 +#define follower_I2C_ADDRESS 0x21 /* Set 0 if debouncing isn't needed */ @@ -197,9 +197,9 @@ uint8_t matrix_scan(void) # endif if (USB_DeviceState != DEVICE_STATE_Configured){ - i2c_slave_reg[1] = 0x55; + i2c_follower_reg[1] = 0x55; for (uint8_t i = 0; i < MATRIX_ROWS; i++){ - i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c + i2c_follower_reg[i+2] = matrix[i]; //send matrix over i2c } } @@ -398,7 +398,7 @@ static void unselect_cols(void) void matrix_setup(void){ if (USB_DeviceState != DEVICE_STATE_Configured){ - i2c_slave_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c + i2c_follower_init(follower_I2C_ADDRESS); //setup address of follower i2c sei(); //enable interupts } } \ No newline at end of file diff --git a/keyboards/dc01/numpad/rules.mk b/keyboards/dc01/numpad/rules.mk index 27d73e261834..81e3469c4b40 100644 --- a/keyboards/dc01/numpad/rules.mk +++ b/keyboards/dc01/numpad/rules.mk @@ -33,7 +33,7 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in CUSTOM_MATRIX = yes # Use custom matrix SRC += matrix.c \ - i2c_slave.c + i2c_follower.c # Community layouts supported LAYOUTS = numpad_5x4 ortho_5x4 diff --git a/keyboards/dc01/right/matrix.c b/keyboards/dc01/right/matrix.c index 6ec3a3b72314..5b6617d381c4 100644 --- a/keyboards/dc01/right/matrix.c +++ b/keyboards/dc01/right/matrix.c @@ -29,10 +29,10 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" #include "timer.h" -#include "i2c_slave.h" +#include "i2c_follower.h" #include "lufa.h" -#define SLAVE_I2C_ADDRESS 0x19 +#define follower_I2C_ADDRESS 0x19 /* Set 0 if debouncing isn't needed */ @@ -197,9 +197,9 @@ uint8_t matrix_scan(void) # endif if (USB_DeviceState != DEVICE_STATE_Configured){ - i2c_slave_reg[1] = 0x55; + i2c_follower_reg[1] = 0x55; for (uint8_t i = 0; i < MATRIX_ROWS; i++){ - i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c + i2c_follower_reg[i+2] = matrix[i]; //send matrix over i2c } } @@ -398,7 +398,7 @@ static void unselect_cols(void) void matrix_setup(void){ if (USB_DeviceState != DEVICE_STATE_Configured){ - i2c_slave_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c + i2c_follower_init(follower_I2C_ADDRESS); //setup address of follower i2c sei(); //enable interupts } } \ No newline at end of file diff --git a/keyboards/dc01/right/rules.mk b/keyboards/dc01/right/rules.mk index 6643ad789e7e..c31c4c247dfa 100644 --- a/keyboards/dc01/right/rules.mk +++ b/keyboards/dc01/right/rules.mk @@ -33,4 +33,4 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in CUSTOM_MATRIX = yes # Use custom matrix SRC += matrix.c \ - i2c_slave.c + i2c_follower.c diff --git a/keyboards/dichotomy/dichotomy.c b/keyboards/dichotomy/dichotomy.c index b94030a37638..4c4bb60ccd34 100755 --- a/keyboards/dichotomy/dichotomy.c +++ b/keyboards/dichotomy/dichotomy.c @@ -9,7 +9,7 @@ void pointing_device_task(void){ SERIAL_UART_INIT(); uint32_t timeout = 0; - //the m character requests the RF slave to send the mouse report + //the m character requests the RF follower to send the mouse report SERIAL_UART_DATA = 'm'; //trust the external inputs completely, erase old data diff --git a/keyboards/dichotomy/matrix.c b/keyboards/dichotomy/matrix.c index d93889e6ad4a..84825edabb60 100755 --- a/keyboards/dichotomy/matrix.c +++ b/keyboards/dichotomy/matrix.c @@ -102,7 +102,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; - //the s character requests the RF slave to send the matrix + //the s character requests the RF follower to send the matrix SERIAL_UART_DATA = 's'; //trust the external keystates entirely, erase the last data diff --git a/keyboards/dm9records/ergoinu/matrix.c b/keyboards/dm9records/ergoinu/matrix.c index 4a80cf9f24f5..7aa5418ec55d 100644 --- a/keyboards/dm9records/ergoinu/matrix.c +++ b/keyboards/dm9records/ergoinu/matrix.c @@ -142,7 +142,7 @@ uint8_t _matrix_scan(void) { } int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; int ret=serial_update_buffers(); if (ret ) { #ifndef DISABLE_PROMICRO_LEDs @@ -154,7 +154,7 @@ int serial_transaction(void) { writePinHigh(B0); #endif for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; + matrix[followerOffset+i] = serial_follower_buffer[i]; } return 0; } @@ -163,7 +163,7 @@ uint8_t matrix_scan(void) { if (is_master) { matrix_master_scan(); }else{ - matrix_slave_scan(); + matrix_follower_scan(); int offset = (isLeftHand) ? ROWS_PER_HAND : 0; @@ -197,9 +197,9 @@ uint8_t matrix_master_scan(void) { if (error_count > ERROR_DISCONNECT_COUNT) { // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; + matrix[followerOffset+i] = 0; } } } else { @@ -213,13 +213,13 @@ uint8_t matrix_master_scan(void) { return ret; } -void matrix_slave_scan(void) { +void matrix_follower_scan(void) { _matrix_scan(); int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; + serial_follower_buffer[i] = matrix[offset+i]; } } diff --git a/keyboards/dm9records/ergoinu/serial.c b/keyboards/dm9records/ergoinu/serial.c index 591941587789..598a8a189eb1 100644 --- a/keyboards/dm9records/ergoinu/serial.c +++ b/keyboards/dm9records/ergoinu/serial.c @@ -51,13 +51,13 @@ #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) -#define SLAVE_INT_WIDTH 1 -#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#define follower_INT_WIDTH 1 +#define follower_INT_RESPONSE_TIME SERIAL_DELAY -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; -#define SLAVE_DATA_CORRUPT (1<<0) +#define follower_DATA_CORRUPT (1<<0) volatile uint8_t status = 0; inline static @@ -107,7 +107,7 @@ void serial_master_init(void) { serial_high(); } -void serial_slave_init(void) { +void serial_follower_init(void) { serial_input_with_pullup(); #if SERIAL_PIN_MASK == _BV(PD0) @@ -130,8 +130,8 @@ static void sync_recv(void) { for (int i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { } - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. + // This shouldn't hang if the follower disconnects because the + // serial line will float to high if the follower does disconnect. while (!serial_read_pin()); } @@ -173,28 +173,28 @@ void serial_write_byte(uint8_t data) { serial_low(); // sync_send() / senc_recv() need raise edge } -// interrupt handle to be used by the slave device +// interrupt handle to be used by the follower device ISR(SERIAL_PIN_INTERRUPT) { serial_output(); - // slave send phase + // follower send phase uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + for (int i = 0; i < SERIAL_follower_BUFFER_LENGTH; ++i) { sync_send(); - serial_write_byte(serial_slave_buffer[i]); - checksum += serial_slave_buffer[i]; + serial_write_byte(serial_follower_buffer[i]); + checksum += serial_follower_buffer[i]; } sync_send(); serial_write_byte(checksum); - // slave switch to input + // follower switch to input sync_send(); //0 serial_delay_half1(); //1 serial_low(); //2 serial_input_with_pullup(); //2 serial_delay_half1(); //3 - // slave recive phase + // follower recive phase uint8_t checksum_computed = 0; for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { sync_recv(); @@ -205,42 +205,42 @@ ISR(SERIAL_PIN_INTERRUPT) { uint8_t checksum_received = serial_read_byte(); if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; + status |= follower_DATA_CORRUPT; } else { - status &= ~SLAVE_DATA_CORRUPT; + status &= ~follower_DATA_CORRUPT; } sync_recv(); //weit master output to high } inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; +bool serial_follower_DATA_CORRUPT(void) { + return status & follower_DATA_CORRUPT; } -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. +// Copies the serial_follower_buffer to the master and sends the +// serial_master_buffer to the follower. // // Returns: // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers(void) { // this code is very time dependent, so we need to disable interrupts cli(); - // signal to the slave that we want to start a transaction + // signal to the follower that we want to start a transaction serial_output(); serial_low(); - _delay_us(SLAVE_INT_WIDTH); + _delay_us(follower_INT_WIDTH); - // wait for the slaves response + // wait for the followers response serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); + _delay_us(follower_INT_RESPONSE_TIME); - // check if the slave is present + // check if the follower is present if (serial_read_pin()) { - // slave failed to pull the line low, assume not present + // follower failed to pull the line low, assume not present serial_output(); serial_high(); sei(); @@ -248,14 +248,14 @@ int serial_update_buffers(void) { } // master recive phase - // if the slave is present syncronize with it + // if the follower is present syncronize with it uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + // receive data from the follower + for (int i = 0; i < SERIAL_follower_BUFFER_LENGTH; ++i) { sync_recv(); - serial_slave_buffer[i] = serial_read_byte(); - checksum_computed += serial_slave_buffer[i]; + serial_follower_buffer[i] = serial_read_byte(); + checksum_computed += serial_follower_buffer[i]; } sync_recv(); uint8_t checksum_received = serial_read_byte(); diff --git a/keyboards/dm9records/ergoinu/serial.h b/keyboards/dm9records/ergoinu/serial.h index 67cf06ac6b81..3e19931b2d92 100644 --- a/keyboards/dm9records/ergoinu/serial.h +++ b/keyboards/dm9records/ergoinu/serial.h @@ -11,14 +11,14 @@ // #define SERIAL_PIN_INPUT PIND // #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 // #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 -// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 // #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +// Buffers for master - follower communication +extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; void serial_master_init(void); -void serial_slave_init(void); +void serial_follower_init(void); int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); +bool serial_follower_data_corrupt(void); diff --git a/keyboards/dm9records/ergoinu/serial_config.h b/keyboards/dm9records/ergoinu/serial_config.h index a16db684ca8f..3ac37af50175 100644 --- a/keyboards/dm9records/ergoinu/serial_config.h +++ b/keyboards/dm9records/ergoinu/serial_config.h @@ -7,5 +7,5 @@ #define SERIAL_PIN_MASK _BV(PD2) #define SERIAL_PIN_INTERRUPT INT2_vect -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 diff --git a/keyboards/dm9records/ergoinu/split_util.c b/keyboards/dm9records/ergoinu/split_util.c index 0cbc2c69c46a..865fff54677f 100644 --- a/keyboards/dm9records/ergoinu/split_util.c +++ b/keyboards/dm9records/ergoinu/split_util.c @@ -29,8 +29,8 @@ static void keyboard_master_setup(void) { serial_master_init(); } -static void keyboard_slave_setup(void) { - serial_slave_init(); +static void keyboard_follower_setup(void) { + serial_follower_init(); } bool has_usb(void) { @@ -45,7 +45,7 @@ void split_keyboard_setup(void) { if (has_usb()) { keyboard_master_setup(); } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } sei(); } diff --git a/keyboards/dm9records/ergoinu/split_util.h b/keyboards/dm9records/ergoinu/split_util.h index 11cfd5455aa8..03bd182b5bcd 100644 --- a/keyboards/dm9records/ergoinu/split_util.h +++ b/keyboards/dm9records/ergoinu/split_util.h @@ -5,8 +5,8 @@ extern volatile bool isLeftHand; -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); +// follower version of matix scan, defined in matrix.c +void matrix_follower_scan(void); void split_keyboard_setup(void); bool has_usb(void); diff --git a/keyboards/ergodash/rev1/config.h b/keyboards/ergodash/rev1/config.h index 0e89ca3402af..f6dbf56e1635 100644 --- a/keyboards/ergodash/rev1/config.h +++ b/keyboards/ergodash/rev1/config.h @@ -71,7 +71,7 @@ along with this program. If not, see . #define RGBLIGHT_SPLIT #define RGBLED_SPLIT { 12, 12 } // Number of LEDs -// The LEDs on the slave half go in reverse order +// The LEDs on the follower half go in reverse order #define RGBLIGHT_LED_MAP { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, \ 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12} diff --git a/keyboards/ergodone/i2cmaster.h b/keyboards/ergodone/i2cmaster.h index 3917b9e6c006..b8f871e1a1ca 100644 --- a/keyboards/ergodone/i2cmaster.h +++ b/keyboards/ergodone/i2cmaster.h @@ -17,7 +17,7 @@ @brief I2C (TWI) Master Software Library - Basic routines for communicating with I2C slave devices. This single master + Basic routines for communicating with I2C follower devices. This single master implementation is limited to one bus master on the I2C bus. This I2c library is implemented as a compact assembler software implementation of the I2C protocol diff --git a/keyboards/ergodox_infinity/visualizer.c b/keyboards/ergodox_infinity/visualizer.c index 4b16021abcd9..7cdfb66acca0 100644 --- a/keyboards/ergodox_infinity/visualizer.c +++ b/keyboards/ergodox_infinity/visualizer.c @@ -136,7 +136,7 @@ static uint8_t get_led_index_master(visualizer_user_data_t* user_data) { return 0; } -static uint8_t get_led_index_slave(visualizer_user_data_t* user_data) { +static uint8_t get_led_index_follower(visualizer_user_data_t* user_data) { uint8_t master_index = get_led_index_master(user_data); if (master_index!=0) { for (int i=master_index; i < 3; i++) { @@ -182,8 +182,8 @@ static void update_emulated_leds(visualizer_state_t* state, visualizer_keyboard_ old_index = get_led_index_master(user_data_old); } else { - new_index = get_led_index_slave(user_data_new); - old_index = get_led_index_slave(user_data_old); + new_index = get_led_index_follower(user_data_new); + old_index = get_led_index_follower(user_data_old); } uint8_t new_secondary_index = get_secondary_led_index(user_data_new); uint8_t old_secondary_index = get_secondary_led_index(user_data_old); @@ -252,7 +252,7 @@ void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard // This function is called every time the status changes // NOTE that this is called from the visualizer thread, so don't access anything else outside the status - // This is also important because the slave won't have access to the active layer for example outside the + // This is also important because the follower won't have access to the active layer for example outside the // status. update_emulated_leds(state, prev_status); diff --git a/keyboards/ergoslab/rev1/config.h b/keyboards/ergoslab/rev1/config.h index 4e69b1095303..8f94cb6cecf7 100644 --- a/keyboards/ergoslab/rev1/config.h +++ b/keyboards/ergoslab/rev1/config.h @@ -49,7 +49,7 @@ along with this program. If not, see . #define RGBLED_NUM 2 // Number of LEDs // FIXME this following line should enable our layer status LEDs to work on both // sides without need to wire them into a chain. It doesn't though. Uncommenting -// means the slave side of the keyboard stops working (and the LEDs don't work). +// means the follower side of the keyboard stops working (and the LEDs don't work). // #define RGBLED_SPLIT {1,1} /* diff --git a/keyboards/fc660c/i2c.c b/keyboards/fc660c/i2c.c index 084c890c405f..0dbe9416618a 100644 --- a/keyboards/fc660c/i2c.c +++ b/keyboards/fc660c/i2c.c @@ -16,12 +16,12 @@ // poll loop takes at least 8 clock cycles to execute #define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) +#define BUFFER_POS_INC() (follower_buffer_pos = (follower_buffer_pos+1)%follower_BUFFER_SIZE) -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; +static volatile uint8_t follower_buffer_pos; +static volatile bool follower_has_register_set = false; // Wait for an i2c operation to finish inline static @@ -43,7 +43,7 @@ void i2c_master_init(void) { TWBR = ((F_CPU/SCL_CLOCK)-16)/2; } -// Start a transaction with the given i2c slave address. The direction of the +// Start a transaction with the given i2c follower address. The direction of the // transfer is set with I2C_READ and I2C_WRITE. // returns: 0 => success // 1 => error @@ -62,7 +62,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -77,20 +77,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/fc660c/i2c.h b/keyboards/fc660c/i2c.h index c15b6bc5065e..2d8fcc72ce72 100644 --- a/keyboards/fc660c/i2c.h +++ b/keyboards/fc660c/i2c.h @@ -13,12 +13,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency #define SCL_CLOCK 400000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -26,7 +26,7 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); static inline unsigned char i2c_start_read(unsigned char addr) { diff --git a/keyboards/fc980c/i2c.c b/keyboards/fc980c/i2c.c index 084c890c405f..0dbe9416618a 100644 --- a/keyboards/fc980c/i2c.c +++ b/keyboards/fc980c/i2c.c @@ -16,12 +16,12 @@ // poll loop takes at least 8 clock cycles to execute #define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) +#define BUFFER_POS_INC() (follower_buffer_pos = (follower_buffer_pos+1)%follower_BUFFER_SIZE) -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; +static volatile uint8_t follower_buffer_pos; +static volatile bool follower_has_register_set = false; // Wait for an i2c operation to finish inline static @@ -43,7 +43,7 @@ void i2c_master_init(void) { TWBR = ((F_CPU/SCL_CLOCK)-16)/2; } -// Start a transaction with the given i2c slave address. The direction of the +// Start a transaction with the given i2c follower address. The direction of the // transfer is set with I2C_READ and I2C_WRITE. // returns: 0 => success // 1 => error @@ -62,7 +62,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -77,20 +77,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/fc980c/i2c.h b/keyboards/fc980c/i2c.h index c15b6bc5065e..2d8fcc72ce72 100644 --- a/keyboards/fc980c/i2c.h +++ b/keyboards/fc980c/i2c.h @@ -13,12 +13,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency #define SCL_CLOCK 400000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -26,7 +26,7 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); static inline unsigned char i2c_start_read(unsigned char addr) { diff --git a/keyboards/gboards/engine/engine.h b/keyboards/gboards/engine/engine.h index 5b9d5b0ecb29..8610065ad52c 100644 --- a/keyboards/gboards/engine/engine.h +++ b/keyboards/gboards/engine/engine.h @@ -1,7 +1,7 @@ /* 2019, g Heavy Industries Blessed mother of Christ, please keep this readable and protect us from segfaults. For thine is the clock, - the slave and the master. Until we return from main. + the follower and the master. Until we return from main. Amen. diff --git a/keyboards/gboards/g/engine.h b/keyboards/gboards/g/engine.h index 547ea09fdd2c..7f9160cd2e2e 100644 --- a/keyboards/gboards/g/engine.h +++ b/keyboards/gboards/g/engine.h @@ -1,7 +1,7 @@ /* 2019, g Heavy Industries Blessed mother of Christ, please keep this readable and protect us from segfaults. For thine is the clock, - the slave and the master. Until we return from main. + the follower and the master. Until we return from main. Amen. diff --git a/keyboards/georgi/sten.h b/keyboards/georgi/sten.h index e94f10fc2881..bf978e91763c 100644 --- a/keyboards/georgi/sten.h +++ b/keyboards/georgi/sten.h @@ -1,7 +1,7 @@ // 2019, g Heavy Industries // Blessed mother of Christ, please keep this readable // and protect us from segfaults. For thine is the clock, -// the slave and the master. Until we return from main. +// the follower and the master. Until we return from main. // // Amen. diff --git a/keyboards/hadron/i2c.c b/keyboards/hadron/i2c.c index cd2b835d501d..0c8535e3c16d 100644 --- a/keyboards/hadron/i2c.c +++ b/keyboards/hadron/i2c.c @@ -16,12 +16,12 @@ // poll loop takes at least 8 clock cycles to execute #define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) +#define BUFFER_POS_INC() (follower_buffer_pos = (follower_buffer_pos+1)%follower_BUFFER_SIZE) -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; +static volatile uint8_t follower_buffer_pos; +static volatile bool follower_has_register_set = false; // Wait for an i2c operation to finish inline static @@ -43,7 +43,7 @@ void i2c_master_init(void) { TWBR = ((F_CPU/SCL_CLOCK)-16)/2; } -// Start a transaction with the given i2c slave address. The direction of the +// Start a transaction with the given i2c follower address. The direction of the // transfer is set with I2C_READ and I2C_WRITE. // returns: 0 => success // 1 => error @@ -63,7 +63,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -78,20 +78,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/hadron/i2c.h b/keyboards/hadron/i2c.h index 2bd7f4096859..abb988f3ae98 100644 --- a/keyboards/hadron/i2c.h +++ b/keyboards/hadron/i2c.h @@ -13,12 +13,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency #define SCL_CLOCK 800000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -26,7 +26,7 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); static inline unsigned char i2c_start_read(unsigned char addr) { diff --git a/keyboards/handwired/108key_trackpoint/config.h b/keyboards/handwired/108key_trackpoint/config.h index 2c0662c0b67b..8bb48bb15da5 100644 --- a/keyboards/handwired/108key_trackpoint/config.h +++ b/keyboards/handwired/108key_trackpoint/config.h @@ -23,7 +23,7 @@ #define PS2_DATA_BIT 2 /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ - /* set DDR of CLOCK as input to be slave */ + /* set DDR of CLOCK as input to be follower */ #define PS2_USART_INIT() do { \ PS2_CLOCK_DDR &= ~(1< success // 1 => error @@ -62,7 +62,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -77,20 +77,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/handwired/not_so_minidox/i2c.h b/keyboards/handwired/not_so_minidox/i2c.h index c15b6bc5065e..2d8fcc72ce72 100644 --- a/keyboards/handwired/not_so_minidox/i2c.h +++ b/keyboards/handwired/not_so_minidox/i2c.h @@ -13,12 +13,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency #define SCL_CLOCK 400000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -26,7 +26,7 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); static inline unsigned char i2c_start_read(unsigned char addr) { diff --git a/keyboards/handwired/not_so_minidox/matrix.c b/keyboards/handwired/not_so_minidox/matrix.c index aca9daedcb70..a4b0c3d19072 100644 --- a/keyboards/handwired/not_so_minidox/matrix.c +++ b/keyboards/handwired/not_so_minidox/matrix.c @@ -145,9 +145,9 @@ uint8_t _matrix_scan(void) // Get rows from other half over i2c int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + int err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) goto i2c_error; // start of matrix stored at 0x00 @@ -155,15 +155,15 @@ int i2c_transaction(void) { if (err) goto i2c_error; // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_READ); if (err) goto i2c_error; if (!err) { int i; for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + matrix[followerOffset+i] = i2c_master_read(I2C_ACK); } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + matrix[followerOffset+i] = i2c_master_read(I2C_NACK); i2c_master_stop(); } else { i2c_error: // the cable is disconnceted, or something else went wrong @@ -177,14 +177,14 @@ int i2c_transaction(void) { #else // USE_SERIAL int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; if (serial_update_buffers()) { return 1; } for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; + matrix[followerOffset+i] = serial_follower_buffer[i]; } return 0; } @@ -208,9 +208,9 @@ uint8_t matrix_scan(void) if (error_count > ERROR_DISCONNECT_COUNT) { // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; + matrix[followerOffset+i] = 0; } } } else { @@ -222,19 +222,19 @@ uint8_t matrix_scan(void) return ret; } -void matrix_slave_scan(void) { +void matrix_follower_scan(void) { _matrix_scan(); int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2); #ifdef USE_I2C for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ + i2c_follower_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; + serial_follower_buffer[i] = matrix[offset+i]; } #endif } diff --git a/keyboards/handwired/not_so_minidox/serial.c b/keyboards/handwired/not_so_minidox/serial.c index 74bcbb6bf6e2..e991085b7a4c 100644 --- a/keyboards/handwired/not_so_minidox/serial.c +++ b/keyboards/handwired/not_so_minidox/serial.c @@ -18,10 +18,10 @@ // value. #define SERIAL_DELAY 24 -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; -#define SLAVE_DATA_CORRUPT (1<<0) +#define follower_DATA_CORRUPT (1<<0) volatile uint8_t status = 0; inline static @@ -61,7 +61,7 @@ void serial_master_init(void) { serial_high(); } -void serial_slave_init(void) { +void serial_follower_init(void) { serial_input(); // Enable INT0 @@ -70,17 +70,17 @@ void serial_slave_init(void) { EICRA &= ~(_BV(ISC00) | _BV(ISC01)); } -// Used by the master to synchronize timing with the slave. +// Used by the master to synchronize timing with the follower. static void sync_recv(void) { serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. + // This shouldn't hang if the follower disconnects because the + // serial line will float to high if the follower does disconnect. while (!serial_read_pin()); serial_delay(); } -// Used by the slave to send a synchronization signal to the master. +// Used by the follower to send a synchronization signal to the master. static void sync_send(void) { serial_output(); @@ -120,15 +120,15 @@ void serial_write_byte(uint8_t data) { } } -// interrupt handle to be used by the slave device +// interrupt handle to be used by the follower device ISR(SERIAL_PIN_INTERRUPT) { sync_send(); uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); + for (int i = 0; i < SERIAL_follower_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_follower_buffer[i]); sync_send(); - checksum += serial_slave_buffer[i]; + checksum += serial_follower_buffer[i]; } serial_write_byte(checksum); sync_send(); @@ -151,53 +151,53 @@ ISR(SERIAL_PIN_INTERRUPT) { serial_input(); // end transaction if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; + status |= follower_DATA_CORRUPT; } else { - status &= ~SLAVE_DATA_CORRUPT; + status &= ~follower_DATA_CORRUPT; } } inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; +bool serial_follower_DATA_CORRUPT(void) { + return status & follower_DATA_CORRUPT; } -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. +// Copies the serial_follower_buffer to the master and sends the +// serial_master_buffer to the follower. // // Returns: // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond int serial_update_buffers(void) { // this code is very time dependent, so we need to disable interrupts cli(); - // signal to the slave that we want to start a transaction + // signal to the follower that we want to start a transaction serial_output(); serial_low(); _delay_us(1); - // wait for the slaves response + // wait for the followers response serial_input(); serial_high(); _delay_us(SERIAL_DELAY); - // check if the slave is present + // check if the follower is present if (serial_read_pin()) { - // slave failed to pull the line low, assume not present + // follower failed to pull the line low, assume not present sei(); return 1; } - // if the slave is present syncronize with it + // if the follower is present syncronize with it sync_recv(); uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); + // receive data from the follower + for (int i = 0; i < SERIAL_follower_BUFFER_LENGTH; ++i) { + serial_follower_buffer[i] = serial_read_byte(); sync_recv(); - checksum_computed += serial_slave_buffer[i]; + checksum_computed += serial_follower_buffer[i]; } uint8_t checksum_received = serial_read_byte(); sync_recv(); @@ -208,7 +208,7 @@ int serial_update_buffers(void) { } uint8_t checksum = 0; - // send data to the slave + // send data to the follower for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { serial_write_byte(serial_master_buffer[i]); sync_recv(); diff --git a/keyboards/handwired/not_so_minidox/serial.h b/keyboards/handwired/not_so_minidox/serial.h index 15fe4db7b4c6..1dd3be4e1193 100644 --- a/keyboards/handwired/not_so_minidox/serial.h +++ b/keyboards/handwired/not_so_minidox/serial.h @@ -11,16 +11,16 @@ #define SERIAL_PIN_MASK _BV(PD0) #define SERIAL_PIN_INTERRUPT INT0_vect -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH 1 -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +// Buffers for master - follower communication +extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; void serial_master_init(void); -void serial_slave_init(void); +void serial_follower_init(void); int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); +bool serial_follower_data_corrupt(void); #endif diff --git a/keyboards/handwired/not_so_minidox/split_util.c b/keyboards/handwired/not_so_minidox/split_util.c index 39639c3b4bd8..9ef0f6103b9e 100644 --- a/keyboards/handwired/not_so_minidox/split_util.c +++ b/keyboards/handwired/not_so_minidox/split_util.c @@ -41,11 +41,11 @@ static void keyboard_master_setup(void) { #endif } -static void keyboard_slave_setup(void) { +static void keyboard_follower_setup(void) { #ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); + i2c_follower_init(follower_I2C_ADDRESS); #else - serial_slave_init(); + serial_follower_init(); #endif } @@ -61,16 +61,16 @@ void split_keyboard_setup(void) { if (has_usb()) { keyboard_master_setup(); } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } sei(); } -void keyboard_slave_loop(void) { +void keyboard_follower_loop(void) { matrix_init(); while (1) { - matrix_slave_scan(); + matrix_follower_scan(); } } @@ -79,6 +79,6 @@ void matrix_setup(void) { split_keyboard_setup(); if (!has_usb()) { - keyboard_slave_loop(); + keyboard_follower_loop(); } } diff --git a/keyboards/handwired/not_so_minidox/split_util.h b/keyboards/handwired/not_so_minidox/split_util.h index 595a0659e1dd..24a7d8af11ce 100644 --- a/keyboards/handwired/not_so_minidox/split_util.h +++ b/keyboards/handwired/not_so_minidox/split_util.h @@ -4,16 +4,16 @@ #include #include "eeconfig.h" -#define SLAVE_I2C_ADDRESS 0x32 +#define follower_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); +// follower version of matix scan, defined in matrix.c +void matrix_follower_scan(void); void split_keyboard_setup(void); bool has_usb(void); -void keyboard_slave_loop(void); +void keyboard_follower_loop(void); void matrix_master_OLED_init (void); diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h index f9560206b49c..56fe78834ab9 100644 --- a/keyboards/handwired/promethium/config.h +++ b/keyboards/handwired/promethium/config.h @@ -296,7 +296,7 @@ enum led_sequence { #define PS2_DATA_BIT 2 /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ -/* set DDR of CLOCK as input to be slave */ +/* set DDR of CLOCK as input to be follower */ #define PS2_USART_INIT() do { \ PS2_CLOCK_DDR &= ~(1< success // 1 => error @@ -60,7 +60,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -75,20 +75,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/helix/local_drivers/i2c.h b/keyboards/helix/local_drivers/i2c.h index 47cf6bd1b2c9..1898ad3de167 100644 --- a/keyboards/helix/local_drivers/i2c.h +++ b/keyboards/helix/local_drivers/i2c.h @@ -13,12 +13,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency 400kHz #define SCL_CLOCK 400000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -26,7 +26,7 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); static inline unsigned char i2c_start_read(unsigned char addr) { diff --git a/keyboards/helix/local_drivers/serial.c b/keyboards/helix/local_drivers/serial.c index 674c42d593b1..0209b0bdb4da 100644 --- a/keyboards/helix/local_drivers/serial.c +++ b/keyboards/helix/local_drivers/serial.c @@ -72,8 +72,8 @@ //////////////// for backward compatibility //////////////////////////////// #if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) /* --- USE OLD API (compatible with let's split serial.c) */ - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #if SERIAL_follower_BUFFER_LENGTH > 0 + uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; #endif #if SERIAL_MASTER_BUFFER_LENGTH > 0 uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; @@ -87,8 +87,8 @@ SSTD_t transactions[] = { #else 0, (uint8_t *)NULL, #endif - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #if SERIAL_follower_BUFFER_LENGTH > 0 + sizeof(serial_follower_buffer), (uint8_t *)serial_follower_buffer #else 0, (uint8_t *)NULL, #endif @@ -98,11 +98,11 @@ SSTD_t transactions[] = { void serial_master_init(void) { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void serial_slave_init(void) +void serial_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers() { @@ -212,12 +212,12 @@ int serial_update_buffers() #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) -#define SLAVE_INT_WIDTH_US 1 +#define follower_INT_WIDTH_US 1 #ifndef SERIAL_USE_MULTI_TRANSACTION - #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY + #define follower_INT_RESPONSE_TIME SERIAL_DELAY #else - #define SLAVE_INT_ACK_WIDTH_UNIT 2 - #define SLAVE_INT_ACK_WIDTH 4 + #define follower_INT_ACK_WIDTH_UNIT 2 + #define follower_INT_ACK_WIDTH 4 #endif static SSTD_t *Transaction_table = NULL; @@ -436,7 +436,7 @@ ISR(SERIAL_PIN_INTERRUPT) { serial_high(); // response step1 low->high serial_output(); - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT*follower_INT_ACK_WIDTH); SSTD_t *trans = &Transaction_table[tid]; serial_low(); // response step2 ack high->low #endif @@ -487,12 +487,12 @@ int soft_serial_transaction(int sstd_index) { // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(SLAVE_INT_WIDTH_US); + _delay_us(follower_INT_WIDTH_US); #ifndef SERIAL_USE_MULTI_TRANSACTION // wait for the target response serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); + _delay_us(follower_INT_RESPONSE_TIME); // check if the target is present if (serial_read_pin()) { @@ -520,15 +520,15 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { - if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present + if (i > follower_INT_ACK_WIDTH + 1) { + // follower failed to pull the line low, assume not present serial_output(); serial_high(); *trans->status = TRANSACTION_NO_RESPONSE; sei(); return TRANSACTION_NO_RESPONSE; } - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT); } #endif @@ -577,7 +577,7 @@ int soft_serial_get_and_clean_status(int sstd_index) { // Helix serial.c history // 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) -// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// 2018-6-28 bug fix master to follower comm and speed up (#3255, 1038bbef4) // (adjusted with avr-gcc 4.9.2) // 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) // (adjusted with avr-gcc 4.9.2) diff --git a/keyboards/helix/local_drivers/serial.h b/keyboards/helix/local_drivers/serial.h index 2e53928df2d3..c14aac0f3b43 100644 --- a/keyboards/helix/local_drivers/serial.h +++ b/keyboards/helix/local_drivers/serial.h @@ -17,7 +17,7 @@ // // //// USE OLD API (compatible with let's split serial.c) // ex. -// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 // #define SERIAL_MASTER_BUFFER_LENGTH 1 // // //// USE NEW API @@ -32,15 +32,15 @@ //////////////// for backward compatibility //////////////////////////////// #if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) /* --- USE OLD API (compatible with let's split serial.c) */ - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; + #if SERIAL_follower_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; #endif #if SERIAL_MASTER_BUFFER_LENGTH > 0 extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; #endif void serial_master_init(void); - void serial_slave_init(void); + void serial_follower_init(void); int serial_update_buffers(void); #endif // end of USE OLD API diff --git a/keyboards/helix/pico/config.h b/keyboards/helix/pico/config.h index a4cc77143b7d..e439669fcbf6 100644 --- a/keyboards/helix/pico/config.h +++ b/keyboards/helix/pico/config.h @@ -35,7 +35,7 @@ along with this program. If not, see . /* Soft Serial defines */ #define SOFT_SERIAL_PIN D2 -#define SERIAL_SLAVE_BUFFER_LENGTH ((MATRIX_ROWS)/2) +#define SERIAL_follower_BUFFER_LENGTH ((MATRIX_ROWS)/2) #define SERIAL_MASTER_BUFFER_LENGTH ((MATRIX_ROWS)/2) /* Select hand configuration */ diff --git a/keyboards/helix/pico/matrix.c b/keyboards/helix/pico/matrix.c index 27170e03941b..7d95b73716d9 100644 --- a/keyboards/helix/pico/matrix.c +++ b/keyboards/helix/pico/matrix.c @@ -146,9 +146,9 @@ uint8_t _matrix_scan(void) // Get rows from other half over i2c int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + int err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) goto i2c_error; // start of matrix stored at 0x00 @@ -156,15 +156,15 @@ int i2c_transaction(void) { if (err) goto i2c_error; // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_READ); if (err) goto i2c_error; if (!err) { int i; for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + matrix[followerOffset+i] = i2c_master_read(I2C_ACK); } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + matrix[followerOffset+i] = i2c_master_read(I2C_NACK); i2c_master_stop(); } else { i2c_error: // the cable is disconnceted, or something else went wrong @@ -178,7 +178,7 @@ int i2c_transaction(void) { #else // USE_SERIAL int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; int ret=serial_update_buffers(); if (ret ) { if(ret==2) writePinLow(B0); @@ -186,7 +186,7 @@ int serial_transaction(void) { } writePinHigh(B0); for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; + matrix[followerOffset+i] = serial_follower_buffer[i]; } return 0; } @@ -197,7 +197,7 @@ uint8_t matrix_scan(void) if (is_helix_master()) { matrix_master_scan(); }else{ - matrix_slave_scan(); + matrix_follower_scan(); int offset = (isLeftHand) ? ROWS_PER_HAND : 0; @@ -220,8 +220,8 @@ uint8_t matrix_master_scan(void) { #ifdef USE_MATRIX_I2C // for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ -// i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ +// i2c_follower_buffer[i] = matrix[offset+i]; // } #else // USE_SERIAL for (int i = 0; i < ROWS_PER_HAND; ++i) { @@ -242,9 +242,9 @@ uint8_t matrix_master_scan(void) { if (error_count > ERROR_DISCONNECT_COUNT) { // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; + matrix[followerOffset+i] = 0; } } } else { @@ -256,19 +256,19 @@ uint8_t matrix_master_scan(void) { return ret; } -void matrix_slave_scan(void) { +void matrix_follower_scan(void) { _matrix_scan(); int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; #ifdef USE_MATRIX_I2C for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ + i2c_follower_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; + serial_follower_buffer[i] = matrix[offset+i]; } #endif } diff --git a/keyboards/helix/pico/pico.c b/keyboards/helix/pico/pico.c index 12b8ae9efa99..fda5a8b2f001 100644 --- a/keyboards/helix/pico/pico.c +++ b/keyboards/helix/pico/pico.c @@ -35,7 +35,7 @@ void keyboard_post_init_kb(void) { } #if defined(SPLIT_KEYBOARD) && defined(SSD1306OLED) -void matrix_slave_scan_user(void) { +void matrix_follower_scan_user(void) { matrix_scan_user(); } #endif diff --git a/keyboards/helix/pico/split_util.c b/keyboards/helix/pico/split_util.c index c77e63f33c47..56d34f840537 100644 --- a/keyboards/helix/pico/split_util.c +++ b/keyboards/helix/pico/split_util.c @@ -55,17 +55,17 @@ bool is_keyboard_left(void) { } bool is_helix_master(void) { - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; + static enum { UNKNOWN, MASTER, follower } usbstate = UNKNOWN; // only check once, as this is called often if (usbstate == UNKNOWN) { #if defined(SPLIT_USB_DETECT) - usbstate = waitForUsb() ? MASTER : SLAVE; + usbstate = waitForUsb() ? MASTER : follower; #elif defined(__AVR__) USBCON |= (1 << OTGPADE); // enables VBUS pad wait_us(5); - usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS + usbstate = (USBSTA & (1 << VBUS)) ? MASTER : follower; // checks state of VBUS #else usbstate = MASTER; #endif @@ -83,12 +83,12 @@ static void keyboard_master_setup(void) { #endif } -static void keyboard_slave_setup(void) { +static void keyboard_follower_setup(void) { #ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); + i2c_follower_init(follower_I2C_ADDRESS); #else - serial_slave_init(); + serial_follower_init(); #endif } @@ -98,7 +98,7 @@ void split_keyboard_setup(void) { if (is_helix_master()) { keyboard_master_setup(); } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } sei(); } diff --git a/keyboards/helix/pico/split_util.h b/keyboards/helix/pico/split_util.h index c0ecdb097412..0d298c654a90 100644 --- a/keyboards/helix/pico/split_util.h +++ b/keyboards/helix/pico/split_util.h @@ -4,12 +4,12 @@ #include #include "eeconfig.h" -#define SLAVE_I2C_ADDRESS 0x32 +#define follower_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); +// follower version of matix scan, defined in matrix.c +void matrix_follower_scan(void); void split_keyboard_setup(void); bool is_helix_master(void); diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h index f56951e707fb..21ffb356f295 100644 --- a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h +++ b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h @@ -4,6 +4,6 @@ /* Soft Serial defines */ #define SOFT_SERIAL_PIN D2 -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH 0 #endif diff --git a/keyboards/helix/rev1/matrix.c b/keyboards/helix/rev1/matrix.c index 06ef49b563d6..09d04fd9c8c5 100644 --- a/keyboards/helix/rev1/matrix.c +++ b/keyboards/helix/rev1/matrix.c @@ -145,9 +145,9 @@ uint8_t _matrix_scan(void) // Get rows from other half over i2c int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + int err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) goto i2c_error; // start of matrix stored at 0x00 @@ -155,15 +155,15 @@ int i2c_transaction(void) { if (err) goto i2c_error; // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_READ); if (err) goto i2c_error; if (!err) { int i; for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + matrix[followerOffset+i] = i2c_master_read(I2C_ACK); } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + matrix[followerOffset+i] = i2c_master_read(I2C_NACK); i2c_master_stop(); } else { i2c_error: // the cable is disconnceted, or something else went wrong @@ -177,14 +177,14 @@ int i2c_transaction(void) { #else // USE_SERIAL int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; if (serial_update_buffers()) { return 1; } for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; + matrix[followerOffset+i] = serial_follower_buffer[i]; } return 0; } @@ -208,9 +208,9 @@ uint8_t matrix_scan(void) if (error_count > ERROR_DISCONNECT_COUNT) { // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; + matrix[followerOffset+i] = 0; } } } else { @@ -222,19 +222,19 @@ uint8_t matrix_scan(void) return ret; } -void matrix_slave_scan(void) { +void matrix_follower_scan(void) { _matrix_scan(); int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2); #ifdef USE_MATRIX_I2C for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ + i2c_follower_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; + serial_follower_buffer[i] = matrix[offset+i]; } #endif } diff --git a/keyboards/helix/rev1/serial_config.h b/keyboards/helix/rev1/serial_config.h index 32218f9bbec3..b16c4e6a23a9 100644 --- a/keyboards/helix/rev1/serial_config.h +++ b/keyboards/helix/rev1/serial_config.h @@ -4,6 +4,6 @@ /* Soft Serial defines */ #define SOFT_SERIAL_PIN D0 -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH 0 #endif diff --git a/keyboards/helix/rev1/split_util.c b/keyboards/helix/rev1/split_util.c index 5debd6e00bd2..52f89cfda813 100644 --- a/keyboards/helix/rev1/split_util.c +++ b/keyboards/helix/rev1/split_util.c @@ -43,11 +43,11 @@ static void keyboard_master_setup(void) { #endif } -static void keyboard_slave_setup(void) { +static void keyboard_follower_setup(void) { #ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); + i2c_follower_init(follower_I2C_ADDRESS); #else - serial_slave_init(); + serial_follower_init(); #endif } @@ -63,16 +63,16 @@ void split_keyboard_setup(void) { if (has_usb()) { keyboard_master_setup(); } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } sei(); } -void keyboard_slave_loop(void) { +void keyboard_follower_loop(void) { matrix_init(); while (1) { - matrix_slave_scan(); + matrix_follower_scan(); } } @@ -81,6 +81,6 @@ void matrix_setup(void) { split_keyboard_setup(); if (!has_usb()) { - keyboard_slave_loop(); + keyboard_follower_loop(); } } diff --git a/keyboards/helix/rev1/split_util.h b/keyboards/helix/rev1/split_util.h index 595a0659e1dd..24a7d8af11ce 100644 --- a/keyboards/helix/rev1/split_util.h +++ b/keyboards/helix/rev1/split_util.h @@ -4,16 +4,16 @@ #include #include "eeconfig.h" -#define SLAVE_I2C_ADDRESS 0x32 +#define follower_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); +// follower version of matix scan, defined in matrix.c +void matrix_follower_scan(void); void split_keyboard_setup(void); bool has_usb(void); -void keyboard_slave_loop(void); +void keyboard_follower_loop(void); void matrix_master_OLED_init (void); diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c index 8ea070aa3a45..7dcdc3e2fe8b 100644 --- a/keyboards/helix/rev2/matrix.c +++ b/keyboards/helix/rev2/matrix.c @@ -147,9 +147,9 @@ uint8_t _matrix_scan(void) // Get rows from other half over i2c int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + int err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) goto i2c_error; // start of matrix stored at 0x00 @@ -157,15 +157,15 @@ int i2c_transaction(void) { if (err) goto i2c_error; // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_READ); if (err) goto i2c_error; if (!err) { int i; for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + matrix[followerOffset+i] = i2c_master_read(I2C_ACK); } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + matrix[followerOffset+i] = i2c_master_read(I2C_NACK); i2c_master_stop(); } else { i2c_error: // the cable is disconnceted, or something else went wrong @@ -179,7 +179,7 @@ int i2c_transaction(void) { #else // USE_SERIAL int serial_transaction(int master_changed) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; #ifdef SERIAL_USE_MULTI_TRANSACTION int ret=serial_update_buffers(master_changed); #else @@ -190,8 +190,8 @@ int serial_transaction(int master_changed) { return 1; } writePinHigh(B0); - memcpy(&matrix[slaveOffset], - (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); + memcpy(&matrix[followerOffset], + (void *)serial_follower_buffer, sizeof(serial_follower_buffer)); return 0; } #endif @@ -201,7 +201,7 @@ uint8_t matrix_scan(void) if (is_helix_master()) { matrix_master_scan(); }else{ - matrix_slave_scan(); + matrix_follower_scan(); int offset = (isLeftHand) ? ROWS_PER_HAND : 0; memcpy(&matrix[offset], (void *)serial_master_buffer, sizeof(serial_master_buffer)); @@ -221,8 +221,8 @@ uint8_t matrix_master_scan(void) { #ifdef USE_MATRIX_I2C // for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ -// i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ +// i2c_follower_buffer[i] = matrix[offset+i]; // } #else // USE_SERIAL #ifdef SERIAL_USE_MULTI_TRANSACTION @@ -246,9 +246,9 @@ uint8_t matrix_master_scan(void) { if (error_count > ERROR_DISCONNECT_COUNT) { // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; + matrix[followerOffset+i] = 0; } } } else { @@ -260,15 +260,15 @@ uint8_t matrix_master_scan(void) { return ret; } -void matrix_slave_scan(void) { +void matrix_follower_scan(void) { _matrix_scan(); int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; #ifdef USE_MATRIX_I2C for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ + i2c_follower_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL #ifdef SERIAL_USE_MULTI_TRANSACTION @@ -276,13 +276,13 @@ void matrix_slave_scan(void) { #endif for (int i = 0; i < ROWS_PER_HAND; ++i) { #ifdef SERIAL_USE_MULTI_TRANSACTION - if( serial_slave_buffer[i] != matrix[offset+i] ) + if( serial_follower_buffer[i] != matrix[offset+i] ) change = 1; #endif - serial_slave_buffer[i] = matrix[offset+i]; + serial_follower_buffer[i] = matrix[offset+i]; } #ifdef SERIAL_USE_MULTI_TRANSACTION - slave_buffer_change_count += change; + follower_buffer_change_count += change; #endif #endif } diff --git a/keyboards/helix/rev2/rev2.c b/keyboards/helix/rev2/rev2.c index 12b8ae9efa99..fda5a8b2f001 100644 --- a/keyboards/helix/rev2/rev2.c +++ b/keyboards/helix/rev2/rev2.c @@ -35,7 +35,7 @@ void keyboard_post_init_kb(void) { } #if defined(SPLIT_KEYBOARD) && defined(SSD1306OLED) -void matrix_slave_scan_user(void) { +void matrix_follower_scan_user(void) { matrix_scan_user(); } #endif diff --git a/keyboards/helix/rev2/serial_config_simpleapi.h b/keyboards/helix/rev2/serial_config_simpleapi.h index e2d22a41e7bc..a22e5912a43a 100644 --- a/keyboards/helix/rev2/serial_config_simpleapi.h +++ b/keyboards/helix/rev2/serial_config_simpleapi.h @@ -2,7 +2,7 @@ #define SERIAL_CONFIG_SIMPLEAPI_H #undef SERIAL_USE_MULTI_TRANSACTION -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 #endif // SERIAL_CONFIG_SIMPLEAPI_H diff --git a/keyboards/helix/rev2/split_scomm.c b/keyboards/helix/rev2/split_scomm.c index ada7867960b9..7edd19649c75 100644 --- a/keyboards/helix/rev2/split_scomm.c +++ b/keyboards/helix/rev2/split_scomm.c @@ -11,32 +11,32 @@ #include #endif -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; uint8_t volatile status_com = 0; uint8_t volatile status1 = 0; -uint8_t slave_buffer_change_count = 0; +uint8_t follower_buffer_change_count = 0; uint8_t s_change_old = 0xff; uint8_t s_change_new = 0xff; SSTD_t transactions[] = { -#define GET_SLAVE_STATUS 0 - /* master buffer not changed, only recive slave_buffer_change_count */ +#define GET_follower_STATUS 0 + /* master buffer not changed, only recive follower_buffer_change_count */ { (uint8_t *)&status_com, 0, NULL, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, + sizeof(follower_buffer_change_count), &follower_buffer_change_count, }, -#define PUT_MASTER_GET_SLAVE_STATUS 1 - /* master buffer changed need send, and recive slave_buffer_change_count */ +#define PUT_MASTER_GET_follower_STATUS 1 + /* master buffer changed need send, and recive follower_buffer_change_count */ { (uint8_t *)&status_com, sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, + sizeof(follower_buffer_change_count), &follower_buffer_change_count, }, -#define GET_SLAVE_BUFFER 2 - /* recive serial_slave_buffer */ +#define GET_follower_BUFFER 2 + /* recive serial_follower_buffer */ { (uint8_t *)&status1, 0, NULL, - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + sizeof(serial_follower_buffer), (uint8_t *)serial_follower_buffer } }; @@ -45,13 +45,13 @@ void serial_master_init(void) soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void serial_slave_init(void) +void serial_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers(int master_update) { @@ -59,28 +59,28 @@ int serial_update_buffers(int master_update) static int need_retry = 0; if( s_change_old != s_change_new ) { - smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + smatstatus = soft_serial_transaction(GET_follower_BUFFER); if( smatstatus == TRANSACTION_END ) { s_change_old = s_change_new; #ifdef CONSOLE_ENABLE - uprintf("slave matrix = %b %b %b %b %b\n", - serial_slave_buffer[0], serial_slave_buffer[1], - serial_slave_buffer[2], serial_slave_buffer[3], - serial_slave_buffer[4] ); + uprintf("follower matrix = %b %b %b %b %b\n", + serial_follower_buffer[0], serial_follower_buffer[1], + serial_follower_buffer[2], serial_follower_buffer[3], + serial_follower_buffer[4] ); #endif } } else { - // serial_slave_buffer dosen't change + // serial_follower_buffer dosen't change smatstatus = TRANSACTION_END; // dummy status } if( !master_update && !need_retry) { - status = soft_serial_transaction(GET_SLAVE_STATUS); + status = soft_serial_transaction(GET_follower_STATUS); } else { - status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + status = soft_serial_transaction(PUT_MASTER_GET_follower_STATUS); } if( status == TRANSACTION_END ) { - s_change_new = slave_buffer_change_count; + s_change_new = follower_buffer_change_count; need_retry = 0; } else { need_retry = 1; diff --git a/keyboards/helix/rev2/split_scomm.h b/keyboards/helix/rev2/split_scomm.h index 873d8939d81f..4a377a13c93f 100644 --- a/keyboards/helix/rev2/split_scomm.h +++ b/keyboards/helix/rev2/split_scomm.h @@ -7,16 +7,16 @@ #else /* --- USE flexible API (using multi-type transaction function) --- */ -// Buffers for master - slave communication -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// Buffers for master - follower communication +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; -extern uint8_t slave_buffer_change_count; +extern uint8_t follower_buffer_change_count; void serial_master_init(void); -void serial_slave_init(void); +void serial_follower_init(void); int serial_update_buffers(int master_changed); #endif diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c index ab40315487fd..bb17366fd88b 100644 --- a/keyboards/helix/rev2/split_util.c +++ b/keyboards/helix/rev2/split_util.c @@ -60,17 +60,17 @@ bool is_keyboard_left(void) { } bool is_helix_master(void) { - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; + static enum { UNKNOWN, MASTER, follower } usbstate = UNKNOWN; // only check once, as this is called often if (usbstate == UNKNOWN) { #if defined(SPLIT_USB_DETECT) - usbstate = waitForUsb() ? MASTER : SLAVE; + usbstate = waitForUsb() ? MASTER : follower; #elif defined(__AVR__) USBCON |= (1 << OTGPADE); // enables VBUS pad wait_us(5); - usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS + usbstate = (USBSTA & (1 << VBUS)) ? MASTER : follower; // checks state of VBUS #else usbstate = MASTER; #endif @@ -88,12 +88,12 @@ static void keyboard_master_setup(void) { #endif } -static void keyboard_slave_setup(void) { +static void keyboard_follower_setup(void) { #ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); + i2c_follower_init(follower_I2C_ADDRESS); #else - serial_slave_init(); + serial_follower_init(); #endif } @@ -103,7 +103,7 @@ void split_keyboard_setup(void) { if (is_helix_master()) { keyboard_master_setup(); } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } sei(); } diff --git a/keyboards/helix/rev2/split_util.h b/keyboards/helix/rev2/split_util.h index c0ecdb097412..0d298c654a90 100644 --- a/keyboards/helix/rev2/split_util.h +++ b/keyboards/helix/rev2/split_util.h @@ -4,12 +4,12 @@ #include #include "eeconfig.h" -#define SLAVE_I2C_ADDRESS 0x32 +#define follower_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); +// follower version of matix scan, defined in matrix.c +void matrix_follower_scan(void); void split_keyboard_setup(void); bool is_helix_master(void); diff --git a/keyboards/hhkb/rn42/PowerSave.txt b/keyboards/hhkb/rn42/PowerSave.txt index 4b9c8f415d07..a493faf04350 100644 --- a/keyboards/hhkb/rn42/PowerSave.txt +++ b/keyboards/hhkb/rn42/PowerSave.txt @@ -49,7 +49,7 @@ b) reduce baud of RN-42 to lower rate;(factory default is 115200bps) -Slave mode +follower mode ---------- Discovery/Inquire Connect/Page diff --git a/keyboards/hhkb/rn42/RN42.txt b/keyboards/hhkb/rn42/RN42.txt index b30a0327d4aa..af69c3baf45b 100644 --- a/keyboards/hhkb/rn42/RN42.txt +++ b/keyboards/hhkb/rn42/RN42.txt @@ -330,7 +330,7 @@ Configuration timer settings ---------------------------- Remote configuration is used for the module to be configured with various commands over Bluetooth(SPP profile only?). -The module has remote configuration timer to allow remote configuration over Bluetooth after power up in Slave mode. In Master modes the remote configuration timer is set to 0(no remote configuration). (In Trigger Master mode the timer is used as an idle timer to break the connection after time expires with no charactors receive.) +The module has remote configuration timer to allow remote configuration over Bluetooth after power up in follower mode. In Master modes the remote configuration timer is set to 0(no remote configuration). (In Trigger Master mode the timer is used as an idle timer to break the connection after time expires with no charactors receive.) ST,0 // no remote, no local when connected ST,<1-252> // local and remote with timeout in seconds from power up ST,253 // local only without timeout @@ -351,7 +351,7 @@ SQ, Special configuration(GPIO, discovery mode, low latency, SR, Store remote address SR,Z Erase all address SS, Set service name(1-20)** -ST, Remote configuration timer(Master:0, Slave:0-255, Triger:as idle timer) +ST, Remote configuration timer(Master:0, follower:0-255, Triger:as idle timer) SU, UART baud rate SW, low-power sniff mode** deep sleep and wake up every 625us * SX,<0|1> bonding enable only acceps device that matches the stored address diff --git a/keyboards/honeycomb/honeycomb.c b/keyboards/honeycomb/honeycomb.c index add4af153652..5f7f4e324ec0 100755 --- a/keyboards/honeycomb/honeycomb.c +++ b/keyboards/honeycomb/honeycomb.c @@ -11,7 +11,7 @@ void pointing_device_task(void){ SERIAL_UART_INIT(); uint32_t timeout = 0; - //the m character requests the RF slave to send the mouse report + //the m character requests the RF follower to send the mouse report SERIAL_UART_DATA = 'm'; //trust the external inputs completely, erase old data diff --git a/keyboards/honeycomb/matrix.c b/keyboards/honeycomb/matrix.c index a06afb6d9685..3ec2c496e3fc 100755 --- a/keyboards/honeycomb/matrix.c +++ b/keyboards/honeycomb/matrix.c @@ -102,7 +102,7 @@ uint8_t matrix_scan(void) uint32_t timeout = 0; - // The 's' character requests the RF slave to send the matrix + // The 's' character requests the RF follower to send the matrix SERIAL_UART_DATA = 's'; // Trust the external keystates entirely, erase the last data diff --git a/keyboards/keebio/iris/keymaps/olligranlund_nordic/readme.md b/keyboards/keebio/iris/keymaps/olligranlund_nordic/readme.md index 72eccde10293..0fa5bc6fb206 100644 --- a/keyboards/keebio/iris/keymaps/olligranlund_nordic/readme.md +++ b/keyboards/keebio/iris/keymaps/olligranlund_nordic/readme.md @@ -7,5 +7,5 @@ This is for those who insist to use keyboard with ÅÄÖ. Also thought about the gaming aspect with this keyboard, therefore space on left side. At first I thought about having backspace in the upper right corner of the -slave side, but that made it really clunky to fix your text. Thumbs should take +follower side, but that made it really clunky to fix your text. Thumbs should take care of this job instead. diff --git a/keyboards/keebio/levinson/keymaps/issmirnov/config.h b/keyboards/keebio/levinson/keymaps/issmirnov/config.h index 89c2f5ebe82c..8223e13b99da 100644 --- a/keyboards/keebio/levinson/keymaps/issmirnov/config.h +++ b/keyboards/keebio/levinson/keymaps/issmirnov/config.h @@ -14,7 +14,7 @@ #define RGBLED_NUM 16 #define RGBLIGHT_LED_MAP { 0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8 } // When changed, BE SURE to flash EEPROM on both halves and clear it. - // DO NOT USE RGBLED_SPLIT - the slave board will stop responding. + // DO NOT USE RGBLED_SPLIT - the follower board will stop responding. // Turn off RGB when computer sleeps #define RGBLIGHT_SLEEP diff --git a/keyboards/keebio/nyquist/keymaps/bakingpy/Underglow Pinouts.md b/keyboards/keebio/nyquist/keymaps/bakingpy/Underglow Pinouts.md index 9a7633a52f77..489c10246745 100644 --- a/keyboards/keebio/nyquist/keymaps/bakingpy/Underglow Pinouts.md +++ b/keyboards/keebio/nyquist/keymaps/bakingpy/Underglow Pinouts.md @@ -12,7 +12,7 @@ - Green: LED Do -> PCB Extra Data - Black: LED GND -> PCB GND -## Slave +## follower ### TRRS - Red: LED +5V -> PCB VCC diff --git a/keyboards/kyria/keymaps/corodiak/config.h b/keyboards/kyria/keymaps/corodiak/config.h index eed94d055863..57023ff048e9 100644 --- a/keyboards/kyria/keymaps/corodiak/config.h +++ b/keyboards/kyria/keymaps/corodiak/config.h @@ -33,10 +33,10 @@ #define TAPPING_TERM 200 -// Turn off on slave +// Turn off on follower #define WAIT_FOR_USB -// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +// If you are using an Elite C rev3 on the follower side, uncomment the lines below: #define SPLIT_USB_DETECT #define NO_USB_STARTUP_CHECK diff --git a/keyboards/kyria/keymaps/default/config.h b/keyboards/kyria/keymaps/default/config.h index f00bfa8e7059..7495b6f78cf0 100644 --- a/keyboards/kyria/keymaps/default/config.h +++ b/keyboards/kyria/keymaps/default/config.h @@ -27,6 +27,6 @@ #define RGBLIGHT_VAL_STEP 8 #endif -// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +// If you are using an Elite C rev3 on the follower side, uncomment the lines below: // #define SPLIT_USB_DETECT // #define NO_USB_STARTUP_CHECK diff --git a/keyboards/kyria/keymaps/drashna/config.h b/keyboards/kyria/keymaps/drashna/config.h index f93069ac00ef..a58b3a34322a 100644 --- a/keyboards/kyria/keymaps/drashna/config.h +++ b/keyboards/kyria/keymaps/drashna/config.h @@ -34,7 +34,7 @@ # define RGBLIGHT_SPLIT #endif -// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +// If you are using an Elite C rev3 on the follower side, uncomment the lines below: #define SPLIT_USB_DETECT #define SPLIT_USB_TIMEOUT 1000 diff --git a/keyboards/kyria/keymaps/ninjonas/config.h b/keyboards/kyria/keymaps/ninjonas/config.h index 5673e6c3d83d..4d459e79f110 100644 --- a/keyboards/kyria/keymaps/ninjonas/config.h +++ b/keyboards/kyria/keymaps/ninjonas/config.h @@ -32,6 +32,6 @@ # define RGBLIGHT_SPLIT #endif -// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +// If you are using an Elite C rev3 on the follower side, uncomment the lines below: #define SPLIT_USB_DETECT #define SPLIT_USB_TIMEOUT 1000 diff --git a/keyboards/lets_split/keymaps/tylerwince/keymap.c b/keyboards/lets_split/keymaps/tylerwince/keymap.c index c781513c4855..50208c83cbeb 100644 --- a/keyboards/lets_split/keymaps/tylerwince/keymap.c +++ b/keyboards/lets_split/keymaps/tylerwince/keymap.c @@ -153,14 +153,14 @@ void set_qwerty(void){ } void set_lower(void){ rgblight_sethsv_master(255, 255, 255); - rgblight_sethsv_slave(255, 0, 160); + rgblight_sethsv_follower(255, 0, 160); } void set_raise(void){ - rgblight_sethsv_slave(35, 255, 255); + rgblight_sethsv_follower(35, 255, 255); rgblight_sethsv_master(255, 0, 160); } void set_adjust(void){ - rgblight_sethsv_slave(35, 255, 255); + rgblight_sethsv_follower(35, 255, 255); rgblight_sethsv_master(255, 255, 255); } diff --git a/keyboards/lets_split/readme.md b/keyboards/lets_split/readme.md index 2a2b95c0971d..601250d61702 100644 --- a/keyboards/lets_split/readme.md +++ b/keyboards/lets_split/readme.md @@ -178,7 +178,7 @@ Notes on Using Pro Micro 3.3V Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects the frequency on the 3.3V board. -Also, if the slave board is producing weird characters in certain columns, +Also, if the follower board is producing weird characters in certain columns, update the following line in `matrix.c` to the following: ``` diff --git a/keyboards/lfkeyboards/TWIlib.c b/keyboards/lfkeyboards/TWIlib.c index abb12cc87ace..5a11089517b3 100644 --- a/keyboards/lfkeyboards/TWIlib.c +++ b/keyboards/lfkeyboards/TWIlib.c @@ -139,7 +139,7 @@ uint8_t TWIReadData(uint8_t TWIaddr, uint8_t bytesToRead, uint8_t repStart) uint8_t TXdata[1]; // Shift the address and AND a 1 into the read write bit (set to write mode) TXdata[0] = (TWIaddr << 1) | 0x01; - // Use the TWITransmitData function to initialize the transfer and address the slave + // Use the TWITransmitData function to initialize the transfer and address the follower TWITransmitData(TXdata, 1, repStart, 0); } else @@ -261,13 +261,13 @@ ISR (TWI_vect) TWIInfo.mode = RepeatedStartSent; break; - // ----\/ ---- SLAVE RECEIVER ----\/ ---- // + // ----\/ ---- follower RECEIVER ----\/ ---- // - // TODO IMPLEMENT SLAVE RECEIVER FUNCTIONALITY + // TODO IMPLEMENT follower RECEIVER FUNCTIONALITY - // ----\/ ---- SLAVE TRANSMITTER ----\/ ---- // + // ----\/ ---- follower TRANSMITTER ----\/ ---- // - // TODO IMPLEMENT SLAVE TRANSMITTER FUNCTIONALITY + // TODO IMPLEMENT follower TRANSMITTER FUNCTIONALITY // ----\/ ---- MISCELLANEOUS STATES ----\/ ---- // case TWI_NO_RELEVANT_INFO: // It is not really possible to get into this ISR on this condition diff --git a/keyboards/lfkeyboards/TWIlib.h b/keyboards/lfkeyboards/TWIlib.h index 6db3cc9513e0..5e5f156ce84a 100644 --- a/keyboards/lfkeyboards/TWIlib.h +++ b/keyboards/lfkeyboards/TWIlib.h @@ -34,7 +34,7 @@ typedef enum { MasterTransmitter, MasterReceiver, SlaceTransmitter, - SlaveReciever + followerReciever } TWIMode; typedef struct TWIInfoStruct{ @@ -69,8 +69,8 @@ TWIInfoStruct TWIInfo; #define TWISendStart() (TWCR = (1< ERROR_DISCONNECT_COUNT) { // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; + matrix[followerOffset+i] = 0; } } } else { @@ -261,15 +261,15 @@ uint8_t matrix_master_scan(void) { return ret; } -void matrix_slave_scan(void) { +void matrix_follower_scan(void) { _matrix_scan(); int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; #ifdef USE_MATRIX_I2C for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ + i2c_follower_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL #ifdef SERIAL_USE_MULTI_TRANSACTION @@ -277,13 +277,13 @@ void matrix_slave_scan(void) { #endif for (int i = 0; i < ROWS_PER_HAND; ++i) { #ifdef SERIAL_USE_MULTI_TRANSACTION - if( serial_slave_buffer[i] != matrix[offset+i] ) + if( serial_follower_buffer[i] != matrix[offset+i] ) change = 1; #endif - serial_slave_buffer[i] = matrix[offset+i]; + serial_follower_buffer[i] = matrix[offset+i]; } #ifdef SERIAL_USE_MULTI_TRANSACTION - slave_buffer_change_count += change; + follower_buffer_change_count += change; #endif #endif } diff --git a/keyboards/lily58/rev1/split_util.c b/keyboards/lily58/rev1/split_util.c index 316c1c389e9d..f814f3feec76 100755 --- a/keyboards/lily58/rev1/split_util.c +++ b/keyboards/lily58/rev1/split_util.c @@ -51,17 +51,17 @@ __attribute__((weak)) bool is_keyboard_left(void) { } __attribute__((weak)) bool has_usb(void) { - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; + static enum { UNKNOWN, MASTER, follower } usbstate = UNKNOWN; // only check once, as this is called often if (usbstate == UNKNOWN) { #if defined(SPLIT_USB_DETECT) - usbstate = waitForUsb() ? MASTER : SLAVE; + usbstate = waitForUsb() ? MASTER : follower; #elif defined(__AVR__) USBCON |= (1 << OTGPADE); // enables VBUS pad wait_us(5); - usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS + usbstate = (USBSTA & (1 << VBUS)) ? MASTER : follower; // checks state of VBUS #else usbstate = MASTER; #endif @@ -79,12 +79,12 @@ static void keyboard_master_setup(void) { #endif } -static void keyboard_slave_setup(void) { +static void keyboard_follower_setup(void) { #ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); + i2c_follower_init(follower_I2C_ADDRESS); #else - serial_slave_init(); + serial_follower_init(); #endif } @@ -94,7 +94,7 @@ void split_keyboard_setup(void) { if (has_usb()) { keyboard_master_setup(); } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } sei(); } diff --git a/keyboards/lily58/serial.c b/keyboards/lily58/serial.c index f6293c3dc231..086b8c25b8bd 100755 --- a/keyboards/lily58/serial.c +++ b/keyboards/lily58/serial.c @@ -72,8 +72,8 @@ //////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #if SERIAL_follower_BUFFER_LENGTH > 0 + uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; #endif #if SERIAL_MASTER_BUFFER_LENGTH > 0 uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; @@ -87,8 +87,8 @@ SSTD_t transactions[] = { #else 0, (uint8_t *)NULL, #endif - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #if SERIAL_follower_BUFFER_LENGTH > 0 + sizeof(serial_follower_buffer), (uint8_t *)serial_follower_buffer #else 0, (uint8_t *)NULL, #endif @@ -98,11 +98,11 @@ SSTD_t transactions[] = { void serial_master_init(void) { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void serial_slave_init(void) +void serial_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers() { @@ -212,12 +212,12 @@ int serial_update_buffers() #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) -#define SLAVE_INT_WIDTH_US 1 +#define follower_INT_WIDTH_US 1 #ifndef SERIAL_USE_MULTI_TRANSACTION - #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY + #define follower_INT_RESPONSE_TIME SERIAL_DELAY #else - #define SLAVE_INT_ACK_WIDTH_UNIT 2 - #define SLAVE_INT_ACK_WIDTH 4 + #define follower_INT_ACK_WIDTH_UNIT 2 + #define follower_INT_ACK_WIDTH 4 #endif static SSTD_t *Transaction_table = NULL; @@ -436,7 +436,7 @@ ISR(SERIAL_PIN_INTERRUPT) { serial_high(); // response step1 low->high serial_output(); - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT*follower_INT_ACK_WIDTH); SSTD_t *trans = &Transaction_table[tid]; serial_low(); // response step2 ack high->low #endif @@ -487,12 +487,12 @@ int soft_serial_transaction(int sstd_index) { // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(SLAVE_INT_WIDTH_US); + _delay_us(follower_INT_WIDTH_US); #ifndef SERIAL_USE_MULTI_TRANSACTION // wait for the target response serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); + _delay_us(follower_INT_RESPONSE_TIME); // check if the target is present if (serial_read_pin()) { @@ -520,15 +520,15 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { - if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present + if (i > follower_INT_ACK_WIDTH + 1) { + // follower failed to pull the line low, assume not present serial_output(); serial_high(); *trans->status = TRANSACTION_NO_RESPONSE; sei(); return TRANSACTION_NO_RESPONSE; } - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT); } #endif @@ -577,7 +577,7 @@ int soft_serial_get_and_clean_status(int sstd_index) { // Helix serial.c history // 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) -// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// 2018-6-28 bug fix master to follower comm and speed up (#3255, 1038bbef4) // (adjusted with avr-gcc 4.9.2) // 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) // (adjusted with avr-gcc 4.9.2) diff --git a/keyboards/massdrop/alt/config_led.h b/keyboards/massdrop/alt/config_led.h index 82117b33279e..34260e78e8ab 100644 --- a/keyboards/massdrop/alt/config_led.h +++ b/keyboards/massdrop/alt/config_led.h @@ -21,7 +21,7 @@ along with this program. If not, see . #define ISSI3733_DRIVER_COUNT 2 #define DRIVER_LED_TOTAL ISSI3733_LED_COUNT -//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) +//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 follower Address" and keyboard schematic) #define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } //LED I2C bus speed diff --git a/keyboards/massdrop/ctrl/config_led.h b/keyboards/massdrop/ctrl/config_led.h index 0c91a0c80baf..1279a2f2b7e6 100644 --- a/keyboards/massdrop/ctrl/config_led.h +++ b/keyboards/massdrop/ctrl/config_led.h @@ -21,7 +21,7 @@ along with this program. If not, see . #define ISSI3733_DRIVER_COUNT 2 #define DRIVER_LED_TOTAL ISSI3733_LED_COUNT -//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) +//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 follower Address" and keyboard schematic) #define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } //LED I2C bus speed diff --git a/keyboards/meira/TWIlib.c b/keyboards/meira/TWIlib.c index 8e0c974381f1..6bfe8a9d8cff 100755 --- a/keyboards/meira/TWIlib.c +++ b/keyboards/meira/TWIlib.c @@ -143,7 +143,7 @@ uint8_t TWIReadData(uint8_t TWIaddr, uint8_t bytesToRead, uint8_t repStart) uint8_t TXdata[1]; // Shift the address and AND a 1 into the read write bit (set to write mode) TXdata[0] = (TWIaddr << 1) | 0x01; - // Use the TWITransmitData function to initialize the transfer and address the slave + // Use the TWITransmitData function to initialize the transfer and address the follower TWITransmitData(TXdata, 1, repStart, 0); } else @@ -265,13 +265,13 @@ ISR (TWI_vect) TWIInfo.mode = RepeatedStartSent; break; - // ----\/ ---- SLAVE RECEIVER ----\/ ---- // + // ----\/ ---- follower RECEIVER ----\/ ---- // - // TODO IMPLEMENT SLAVE RECEIVER FUNCTIONALITY + // TODO IMPLEMENT follower RECEIVER FUNCTIONALITY - // ----\/ ---- SLAVE TRANSMITTER ----\/ ---- // + // ----\/ ---- follower TRANSMITTER ----\/ ---- // - // TODO IMPLEMENT SLAVE TRANSMITTER FUNCTIONALITY + // TODO IMPLEMENT follower TRANSMITTER FUNCTIONALITY // ----\/ ---- MISCELLANEOUS STATES ----\/ ---- // case TWI_NO_RELEVANT_INFO: // It is not really possible to get into this ISR on this condition diff --git a/keyboards/meira/TWIlib.h b/keyboards/meira/TWIlib.h index 6db3cc9513e0..5e5f156ce84a 100755 --- a/keyboards/meira/TWIlib.h +++ b/keyboards/meira/TWIlib.h @@ -34,7 +34,7 @@ typedef enum { MasterTransmitter, MasterReceiver, SlaceTransmitter, - SlaveReciever + followerReciever } TWIMode; typedef struct TWIInfoStruct{ @@ -69,8 +69,8 @@ TWIInfoStruct TWIInfo; #define TWISendStart() (TWCR = (1<. * | A | P24 | */ -// PCA9555 slave addresses +// PCA9555 follower addresses #define IC1 0x20 #define IC2 0x21 diff --git a/keyboards/mxss/rgblight.c b/keyboards/mxss/rgblight.c index ec4d70e17cd0..61c3635ee351 100644 --- a/keyboards/mxss/rgblight.c +++ b/keyboards/mxss/rgblight.c @@ -641,11 +641,11 @@ void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, #ifndef RGBLIGHT_SPLIT void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb_range(r, g, b, 0, (uint8_t)RGBLED_NUM / 2); } -void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb_range(r, g, b, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } +void rgblight_setrgb_follower(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb_range(r, g, b, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, 0, (uint8_t)RGBLED_NUM / 2); } -void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } +void rgblight_sethsv_follower(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } #endif // ifndef RGBLIGHT_SPLIT #ifndef RGBLIGHT_CUSTOM_DRIVER @@ -729,7 +729,7 @@ void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo) { syncinfo->status = rgblight_status; } -/* for split keyboard slave side */ +/* for split keyboard follower side */ void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom) { if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_MODE) { if (syncinfo->config.enable) { @@ -907,7 +907,7 @@ void rgblight_task(void) { tick_flag = false; if (timer_elapsed(report_last_timer) >= 30000) { report_last_timer = timer_read(); - dprintf("rgblight animation tick report to slave\n"); + dprintf("rgblight animation tick report to follower\n"); RGBLIGHT_SPLIT_ANIMATION_TICK; } } diff --git a/keyboards/mxss/rgblight.h b/keyboards/mxss/rgblight.h index 21eff627dc70..c2e9e39e0b17 100644 --- a/keyboards/mxss/rgblight.h +++ b/keyboards/mxss/rgblight.h @@ -223,9 +223,9 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); # ifndef RGBLIGHT_SPLIT void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b); -void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b); +void rgblight_setrgb_follower(uint8_t r, uint8_t g, uint8_t b); void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val); -void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_follower(uint8_t hue, uint8_t sat, uint8_t val); # endif /* effect mode change */ @@ -323,7 +323,7 @@ typedef struct _rgblight_syncinfo_t { uint8_t rgblight_get_change_flags(void); void rgblight_clear_change_flags(void); void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo); -/* for split keyboard slave side */ +/* for split keyboard follower side */ void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom); # endif diff --git a/keyboards/nek_type_a/mcp23017.c b/keyboards/nek_type_a/mcp23017.c index e24231680415..c3f8ff0be876 100644 --- a/keyboards/nek_type_a/mcp23017.c +++ b/keyboards/nek_type_a/mcp23017.c @@ -37,12 +37,12 @@ static const char *twi_err_str(uint8_t res) { return "BUSFAULT"; case TWI_ERROR_BusCaptureTimeout: return "BUSTIMEOUT"; - case TWI_ERROR_SlaveResponseTimeout: - return "SLAVETIMEOUT"; - case TWI_ERROR_SlaveNotReady: - return "SLAVENOTREADY"; - case TWI_ERROR_SlaveNAK: - return "SLAVENAK"; + case TWI_ERROR_followerResponseTimeout: + return "followerTIMEOUT"; + case TWI_ERROR_followerNotReady: + return "followerNOTREADY"; + case TWI_ERROR_followerNAK: + return "followerNAK"; default: return "UNKNOWN"; } diff --git a/keyboards/orthodox/readme.md b/keyboards/orthodox/readme.md index 8bf60a9bdda2..c474463db6fd 100644 --- a/keyboards/orthodox/readme.md +++ b/keyboards/orthodox/readme.md @@ -155,7 +155,7 @@ Notes on Using Pro Micro 3.3V Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects the frequency on the 3.3V board. -Also, if the slave board is producing weird characters in certain columns, +Also, if the follower board is producing weird characters in certain columns, update the following line in `matrix.c` to the following: ``` diff --git a/keyboards/paladin64/config.h b/keyboards/paladin64/config.h index 8d7cef248378..5ab7423dbae5 100755 --- a/keyboards/paladin64/config.h +++ b/keyboards/paladin64/config.h @@ -27,7 +27,7 @@ /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling * edge */ - /* set DDR of CLOCK as input to be slave */ + /* set DDR of CLOCK as input to be follower */ #define PS2_USART_INIT() do { \ PS2_CLOCK_DDR &= ~(1< success // 1 => error @@ -62,7 +62,7 @@ uint8_t i2c_master_start(uint8_t address) { i2c_delay(); if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge + return 1; // follower did not acknowledge else return 0; // success } @@ -77,20 +77,20 @@ void i2c_master_stop(void) { lim++; } -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK +// Write one byte to the i2c follower. +// returns 0 => follower ACK +// 1 => follower NACK uint8_t i2c_master_write(uint8_t data) { TWDR = data; TWCR = (1<= SLAVE_BUFFER_SIZE ) { + if ( follower_buffer_pos >= follower_BUFFER_SIZE ) { ack = 0; - slave_buffer_pos = 0; + follower_buffer_pos = 0; } - slave_has_register_set = true; + follower_has_register_set = true; } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; + i2c_follower_buffer[follower_buffer_pos] = TWDR; BUFFER_POS_INC(); } break; case TW_ST_SLA_ACK: case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is + // master has addressed this device as a follower transmitter and is // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; + TWDR = i2c_follower_buffer[follower_buffer_pos]; BUFFER_POS_INC(); break; diff --git a/keyboards/yosino58/i2c.h b/keyboards/yosino58/i2c.h index 710662c7abd6..b14ed967dcce 100644 --- a/keyboards/yosino58/i2c.h +++ b/keyboards/yosino58/i2c.h @@ -12,12 +12,12 @@ #define I2C_ACK 1 #define I2C_NACK 0 -#define SLAVE_BUFFER_SIZE 0x10 +#define follower_BUFFER_SIZE 0x10 // i2c SCL clock frequency 400kHz #define SCL_CLOCK 400000L -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; +extern volatile uint8_t i2c_follower_buffer[follower_BUFFER_SIZE]; void i2c_master_init(void); uint8_t i2c_master_start(uint8_t address); @@ -25,7 +25,7 @@ void i2c_master_stop(void); uint8_t i2c_master_write(uint8_t data); uint8_t i2c_master_read(int); void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); +void i2c_follower_init(uint8_t address); static inline unsigned char i2c_start_read(unsigned char addr) { diff --git a/keyboards/yosino58/rev1/matrix.c b/keyboards/yosino58/rev1/matrix.c index 20efb6922996..b4cf6e585648 100644 --- a/keyboards/yosino58/rev1/matrix.c +++ b/keyboards/yosino58/rev1/matrix.c @@ -151,9 +151,9 @@ uint8_t _matrix_scan(void) // Get rows from other half over i2c int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + int err = i2c_master_start(follower_I2C_ADDRESS + I2C_WRITE); if (err) goto i2c_error; // start of matrix stored at 0x00 @@ -161,15 +161,15 @@ int i2c_transaction(void) { if (err) goto i2c_error; // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + err = i2c_master_start(follower_I2C_ADDRESS + I2C_READ); if (err) goto i2c_error; if (!err) { int i; for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + matrix[followerOffset+i] = i2c_master_read(I2C_ACK); } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + matrix[followerOffset+i] = i2c_master_read(I2C_NACK); i2c_master_stop(); } else { i2c_error: // the cable is disconnceted, or something else went wrong @@ -183,7 +183,7 @@ int i2c_transaction(void) { #else // USE_SERIAL int serial_transaction(int master_changed) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; #ifdef SERIAL_USE_MULTI_TRANSACTION int ret=serial_update_buffers(master_changed); #else @@ -194,8 +194,8 @@ int serial_transaction(int master_changed) { return 1; } writePinHigh(B0); - memcpy(&matrix[slaveOffset], - (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); + memcpy(&matrix[followerOffset], + (void *)serial_follower_buffer, SERIAL_follower_BUFFER_LENGTH); return 0; } #endif @@ -205,7 +205,7 @@ uint8_t matrix_scan(void) if (is_master) { matrix_master_scan(); }else{ - matrix_slave_scan(); + matrix_follower_scan(); int offset = (isLeftHand) ? ROWS_PER_HAND : 0; memcpy(&matrix[offset], (void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH); @@ -224,8 +224,8 @@ uint8_t matrix_master_scan(void) { #ifdef USE_MATRIX_I2C // for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ -// i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ +// i2c_follower_buffer[i] = matrix[offset+i]; // } #else // USE_SERIAL #ifdef SERIAL_USE_MULTI_TRANSACTION @@ -248,9 +248,9 @@ uint8_t matrix_master_scan(void) { if (error_count > ERROR_DISCONNECT_COUNT) { // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int followerOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; + matrix[followerOffset+i] = 0; } } } else { @@ -262,15 +262,15 @@ uint8_t matrix_master_scan(void) { return ret; } -void matrix_slave_scan(void) { +void matrix_follower_scan(void) { _matrix_scan(); int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; #ifdef USE_MATRIX_I2C for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; + /* i2c_follower_buffer[i] = matrix[offset+i]; */ + i2c_follower_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL #ifdef SERIAL_USE_MULTI_TRANSACTION @@ -278,13 +278,13 @@ void matrix_slave_scan(void) { #endif for (int i = 0; i < ROWS_PER_HAND; ++i) { #ifdef SERIAL_USE_MULTI_TRANSACTION - if( serial_slave_buffer[i] != matrix[offset+i] ) + if( serial_follower_buffer[i] != matrix[offset+i] ) change = 1; #endif - serial_slave_buffer[i] = matrix[offset+i]; + serial_follower_buffer[i] = matrix[offset+i]; } #ifdef SERIAL_USE_MULTI_TRANSACTION - slave_buffer_change_count += change; + follower_buffer_change_count += change; #endif #endif } diff --git a/keyboards/yosino58/rev1/serial_config_simpleapi.h b/keyboards/yosino58/rev1/serial_config_simpleapi.h index 0e1dd9e4acb2..b17a1f1f86c3 100644 --- a/keyboards/yosino58/rev1/serial_config_simpleapi.h +++ b/keyboards/yosino58/rev1/serial_config_simpleapi.h @@ -1,5 +1,5 @@ #pragma once #undef SERIAL_USE_MULTI_TRANSACTION -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 diff --git a/keyboards/yosino58/rev1/split_scomm.c b/keyboards/yosino58/rev1/split_scomm.c index a1fe6ba5b823..05c67f2b8f9b 100644 --- a/keyboards/yosino58/rev1/split_scomm.c +++ b/keyboards/yosino58/rev1/split_scomm.c @@ -11,32 +11,32 @@ #include #endif -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; uint8_t volatile status_com = 0; uint8_t volatile status1 = 0; -uint8_t slave_buffer_change_count = 0; +uint8_t follower_buffer_change_count = 0; uint8_t s_change_old = 0xff; uint8_t s_change_new = 0xff; SSTD_t transactions[] = { -#define GET_SLAVE_STATUS 0 - /* master buffer not changed, only recive slave_buffer_change_count */ +#define GET_follower_STATUS 0 + /* master buffer not changed, only recive follower_buffer_change_count */ { (uint8_t *)&status_com, 0, NULL, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, + sizeof(follower_buffer_change_count), &follower_buffer_change_count, }, -#define PUT_MASTER_GET_SLAVE_STATUS 1 - /* master buffer changed need send, and recive slave_buffer_change_count */ +#define PUT_MASTER_GET_follower_STATUS 1 + /* master buffer changed need send, and recive follower_buffer_change_count */ { (uint8_t *)&status_com, sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, + sizeof(follower_buffer_change_count), &follower_buffer_change_count, }, -#define GET_SLAVE_BUFFER 2 - /* recive serial_slave_buffer */ +#define GET_follower_BUFFER 2 + /* recive serial_follower_buffer */ { (uint8_t *)&status1, 0, NULL, - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + sizeof(serial_follower_buffer), (uint8_t *)serial_follower_buffer } }; @@ -45,13 +45,13 @@ void serial_master_init(void) soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void serial_slave_init(void) +void serial_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers(int master_update) { @@ -59,27 +59,27 @@ int serial_update_buffers(int master_update) static int need_retry = 0; if( s_change_old != s_change_new ) { - smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + smatstatus = soft_serial_transaction(GET_follower_BUFFER); if( smatstatus == TRANSACTION_END ) { s_change_old = s_change_new; #ifdef CONSOLE_ENABLE - uprintf("slave matrix = %b %b %b %b\n", - serial_slave_buffer[0], serial_slave_buffer[1], - serial_slave_buffer[2], serial_slave_buffer[3]); + uprintf("follower matrix = %b %b %b %b\n", + serial_follower_buffer[0], serial_follower_buffer[1], + serial_follower_buffer[2], serial_follower_buffer[3]); #endif } } else { - // serial_slave_buffer dosen't change + // serial_follower_buffer dosen't change smatstatus = TRANSACTION_END; // dummy status } if( !master_update && !need_retry) { - status = soft_serial_transaction(GET_SLAVE_STATUS); + status = soft_serial_transaction(GET_follower_STATUS); } else { - status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + status = soft_serial_transaction(PUT_MASTER_GET_follower_STATUS); } if( status == TRANSACTION_END ) { - s_change_new = slave_buffer_change_count; + s_change_new = follower_buffer_change_count; need_retry = 0; } else { need_retry = 1; diff --git a/keyboards/yosino58/rev1/split_scomm.h b/keyboards/yosino58/rev1/split_scomm.h index 873d8939d81f..4a377a13c93f 100644 --- a/keyboards/yosino58/rev1/split_scomm.h +++ b/keyboards/yosino58/rev1/split_scomm.h @@ -7,16 +7,16 @@ #else /* --- USE flexible API (using multi-type transaction function) --- */ -// Buffers for master - slave communication -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// Buffers for master - follower communication +#define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; -extern uint8_t slave_buffer_change_count; +extern uint8_t follower_buffer_change_count; void serial_master_init(void); -void serial_slave_init(void); +void serial_follower_init(void); int serial_update_buffers(int master_changed); #endif diff --git a/keyboards/yosino58/rev1/split_util.c b/keyboards/yosino58/rev1/split_util.c index e1ff8b4379dc..e2d2ca6cdeb0 100644 --- a/keyboards/yosino58/rev1/split_util.c +++ b/keyboards/yosino58/rev1/split_util.c @@ -38,12 +38,12 @@ static void keyboard_master_setup(void) { #endif } -static void keyboard_slave_setup(void) { +static void keyboard_follower_setup(void) { #ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); + i2c_follower_init(follower_I2C_ADDRESS); #else - serial_slave_init(); + serial_follower_init(); #endif } @@ -59,7 +59,7 @@ void split_keyboard_setup(void) { if (has_usb()) { keyboard_master_setup(); } else { - keyboard_slave_setup(); + keyboard_follower_setup(); } sei(); } diff --git a/keyboards/yosino58/rev1/split_util.h b/keyboards/yosino58/rev1/split_util.h index 687ca19bd3e5..0c226201f3aa 100644 --- a/keyboards/yosino58/rev1/split_util.h +++ b/keyboards/yosino58/rev1/split_util.h @@ -4,12 +4,12 @@ #include #include "eeconfig.h" -#define SLAVE_I2C_ADDRESS 0x32 +#define follower_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); +// follower version of matix scan, defined in matrix.c +void matrix_follower_scan(void); void split_keyboard_setup(void); bool has_usb(void); diff --git a/keyboards/yosino58/serial.c b/keyboards/yosino58/serial.c index f6293c3dc231..086b8c25b8bd 100644 --- a/keyboards/yosino58/serial.c +++ b/keyboards/yosino58/serial.c @@ -72,8 +72,8 @@ //////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #if SERIAL_follower_BUFFER_LENGTH > 0 + uint8_t volatile serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH] = {0}; #endif #if SERIAL_MASTER_BUFFER_LENGTH > 0 uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; @@ -87,8 +87,8 @@ SSTD_t transactions[] = { #else 0, (uint8_t *)NULL, #endif - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #if SERIAL_follower_BUFFER_LENGTH > 0 + sizeof(serial_follower_buffer), (uint8_t *)serial_follower_buffer #else 0, (uint8_t *)NULL, #endif @@ -98,11 +98,11 @@ SSTD_t transactions[] = { void serial_master_init(void) { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void serial_slave_init(void) +void serial_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error -// 1 => slave did not respond +// 1 => follower did not respond // 2 => checksum error int serial_update_buffers() { @@ -212,12 +212,12 @@ int serial_update_buffers() #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) -#define SLAVE_INT_WIDTH_US 1 +#define follower_INT_WIDTH_US 1 #ifndef SERIAL_USE_MULTI_TRANSACTION - #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY + #define follower_INT_RESPONSE_TIME SERIAL_DELAY #else - #define SLAVE_INT_ACK_WIDTH_UNIT 2 - #define SLAVE_INT_ACK_WIDTH 4 + #define follower_INT_ACK_WIDTH_UNIT 2 + #define follower_INT_ACK_WIDTH 4 #endif static SSTD_t *Transaction_table = NULL; @@ -436,7 +436,7 @@ ISR(SERIAL_PIN_INTERRUPT) { serial_high(); // response step1 low->high serial_output(); - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT*follower_INT_ACK_WIDTH); SSTD_t *trans = &Transaction_table[tid]; serial_low(); // response step2 ack high->low #endif @@ -487,12 +487,12 @@ int soft_serial_transaction(int sstd_index) { // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(SLAVE_INT_WIDTH_US); + _delay_us(follower_INT_WIDTH_US); #ifndef SERIAL_USE_MULTI_TRANSACTION // wait for the target response serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); + _delay_us(follower_INT_RESPONSE_TIME); // check if the target is present if (serial_read_pin()) { @@ -520,15 +520,15 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { - if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present + if (i > follower_INT_ACK_WIDTH + 1) { + // follower failed to pull the line low, assume not present serial_output(); serial_high(); *trans->status = TRANSACTION_NO_RESPONSE; sei(); return TRANSACTION_NO_RESPONSE; } - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + _delay_sub_us(follower_INT_ACK_WIDTH_UNIT); } #endif @@ -577,7 +577,7 @@ int soft_serial_get_and_clean_status(int sstd_index) { // Helix serial.c history // 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) -// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// 2018-6-28 bug fix master to follower comm and speed up (#3255, 1038bbef4) // (adjusted with avr-gcc 4.9.2) // 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) // (adjusted with avr-gcc 4.9.2) diff --git a/keyboards/yosino58/serial.h b/keyboards/yosino58/serial.h index 7e0c0847a431..8775c030a08e 100644 --- a/keyboards/yosino58/serial.h +++ b/keyboards/yosino58/serial.h @@ -17,7 +17,7 @@ // // //// USE Simple API (OLD API, compatible with let's split serial.c) // ex. -// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_follower_BUFFER_LENGTH MATRIX_ROWS/2 // #define SERIAL_MASTER_BUFFER_LENGTH 1 // // //// USE flexible API (using multi-type transaction function) @@ -28,15 +28,15 @@ #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ -#if SERIAL_SLAVE_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#if SERIAL_follower_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_follower_buffer[SERIAL_follower_BUFFER_LENGTH]; #endif #if SERIAL_MASTER_BUFFER_LENGTH > 0 extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; #endif void serial_master_init(void); -void serial_slave_init(void); +void serial_follower_init(void); int serial_update_buffers(void); #endif // USE Simple API diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/adc.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/adc.h index 33c38ae3f8fa..d5603f93b6fc 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/adc.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/adc.h @@ -47,7 +47,7 @@ typedef union { uint16_t ENABLE:1; /*!< bit: 1 Enable */ uint16_t :1; /*!< bit: 2 Reserved */ uint16_t DUALSEL:2; /*!< bit: 3.. 4 Dual Mode Trigger Selection */ - uint16_t SLAVEEN:1; /*!< bit: 5 Slave Enable */ + uint16_t followerEN:1; /*!< bit: 5 follower Enable */ uint16_t RUNSTDBY:1; /*!< bit: 6 Run in Standby */ uint16_t ONDEMAND:1; /*!< bit: 7 On Demand Control */ uint16_t PRESCALER:3; /*!< bit: 8..10 Prescaler Configuration */ @@ -72,8 +72,8 @@ typedef union { #define ADC_CTRLA_DUALSEL_INTERLEAVE_Val _U_(0x1) /**< \brief (ADC_CTRLA) START event or software trigger will alternatingly start a conversion on ADC0 and ADC1 */ #define ADC_CTRLA_DUALSEL_BOTH (ADC_CTRLA_DUALSEL_BOTH_Val << ADC_CTRLA_DUALSEL_Pos) #define ADC_CTRLA_DUALSEL_INTERLEAVE (ADC_CTRLA_DUALSEL_INTERLEAVE_Val << ADC_CTRLA_DUALSEL_Pos) -#define ADC_CTRLA_SLAVEEN_Pos 5 /**< \brief (ADC_CTRLA) Slave Enable */ -#define ADC_CTRLA_SLAVEEN (_U_(0x1) << ADC_CTRLA_SLAVEEN_Pos) +#define ADC_CTRLA_followerEN_Pos 5 /**< \brief (ADC_CTRLA) follower Enable */ +#define ADC_CTRLA_followerEN (_U_(0x1) << ADC_CTRLA_followerEN_Pos) #define ADC_CTRLA_RUNSTDBY_Pos 6 /**< \brief (ADC_CTRLA) Run in Standby */ #define ADC_CTRLA_RUNSTDBY (_U_(0x1) << ADC_CTRLA_RUNSTDBY_Pos) #define ADC_CTRLA_ONDEMAND_Pos 7 /**< \brief (ADC_CTRLA) On Demand Control */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/hmatrixb.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/hmatrixb.h index e0526c0d8a73..9abd5cb06404 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/hmatrixb.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/hmatrixb.h @@ -39,35 +39,35 @@ #define HMATRIXB_I7638 #define REV_HMATRIXB 0x214 -/* -------- HMATRIXB_PRAS : (HMATRIXB Offset: 0x080) (R/W 32) PRS Priority A for Slave -------- */ +/* -------- HMATRIXB_PRAS : (HMATRIXB Offset: 0x080) (R/W 32) PRS Priority A for follower -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } HMATRIXB_PRAS_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -#define HMATRIXB_PRAS_OFFSET 0x080 /**< \brief (HMATRIXB_PRAS offset) Priority A for Slave */ -#define HMATRIXB_PRAS_RESETVALUE _U_(0x00000000) /**< \brief (HMATRIXB_PRAS reset_value) Priority A for Slave */ +#define HMATRIXB_PRAS_OFFSET 0x080 /**< \brief (HMATRIXB_PRAS offset) Priority A for follower */ +#define HMATRIXB_PRAS_RESETVALUE _U_(0x00000000) /**< \brief (HMATRIXB_PRAS reset_value) Priority A for follower */ #define HMATRIXB_PRAS_MASK _U_(0x00000000) /**< \brief (HMATRIXB_PRAS) MASK Register */ -/* -------- HMATRIXB_PRBS : (HMATRIXB Offset: 0x084) (R/W 32) PRS Priority B for Slave -------- */ +/* -------- HMATRIXB_PRBS : (HMATRIXB Offset: 0x084) (R/W 32) PRS Priority B for follower -------- */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { uint32_t reg; /*!< Type used for register access */ } HMATRIXB_PRBS_Type; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -#define HMATRIXB_PRBS_OFFSET 0x084 /**< \brief (HMATRIXB_PRBS offset) Priority B for Slave */ -#define HMATRIXB_PRBS_RESETVALUE _U_(0x00000000) /**< \brief (HMATRIXB_PRBS reset_value) Priority B for Slave */ +#define HMATRIXB_PRBS_OFFSET 0x084 /**< \brief (HMATRIXB_PRBS offset) Priority B for follower */ +#define HMATRIXB_PRBS_RESETVALUE _U_(0x00000000) /**< \brief (HMATRIXB_PRBS reset_value) Priority B for follower */ #define HMATRIXB_PRBS_MASK _U_(0x00000000) /**< \brief (HMATRIXB_PRBS) MASK Register */ /** \brief HmatrixbPrs hardware registers */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef struct { - __IO HMATRIXB_PRAS_Type PRAS; /**< \brief Offset: 0x000 (R/W 32) Priority A for Slave */ - __IO HMATRIXB_PRBS_Type PRBS; /**< \brief Offset: 0x004 (R/W 32) Priority B for Slave */ + __IO HMATRIXB_PRAS_Type PRAS; /**< \brief Offset: 0x000 (R/W 32) Priority A for follower */ + __IO HMATRIXB_PRBS_Type PRBS; /**< \brief Offset: 0x004 (R/W 32) Priority B for follower */ } HmatrixbPrs; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/sercom.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/sercom.h index f884c127a5ff..8132e0d59799 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/sercom.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/sercom.h @@ -53,7 +53,7 @@ typedef union { uint32_t :3; /*!< bit: 17..19 Reserved */ uint32_t SDAHOLD:2; /*!< bit: 20..21 SDA Hold Time */ uint32_t MEXTTOEN:1; /*!< bit: 22 Master SCL Low Extend Timeout */ - uint32_t SEXTTOEN:1; /*!< bit: 23 Slave SCL Low Extend Timeout */ + uint32_t SEXTTOEN:1; /*!< bit: 23 follower SCL Low Extend Timeout */ uint32_t SPEED:2; /*!< bit: 24..25 Transfer Speed */ uint32_t :1; /*!< bit: 26 Reserved */ uint32_t SCLSM:1; /*!< bit: 27 SCL Clock Stretch Mode */ @@ -84,7 +84,7 @@ typedef union { #define SERCOM_I2CM_CTRLA_SDAHOLD(value) (SERCOM_I2CM_CTRLA_SDAHOLD_Msk & ((value) << SERCOM_I2CM_CTRLA_SDAHOLD_Pos)) #define SERCOM_I2CM_CTRLA_MEXTTOEN_Pos 22 /**< \brief (SERCOM_I2CM_CTRLA) Master SCL Low Extend Timeout */ #define SERCOM_I2CM_CTRLA_MEXTTOEN (_U_(0x1) << SERCOM_I2CM_CTRLA_MEXTTOEN_Pos) -#define SERCOM_I2CM_CTRLA_SEXTTOEN_Pos 23 /**< \brief (SERCOM_I2CM_CTRLA) Slave SCL Low Extend Timeout */ +#define SERCOM_I2CM_CTRLA_SEXTTOEN_Pos 23 /**< \brief (SERCOM_I2CM_CTRLA) follower SCL Low Extend Timeout */ #define SERCOM_I2CM_CTRLA_SEXTTOEN (_U_(0x1) << SERCOM_I2CM_CTRLA_SEXTTOEN_Pos) #define SERCOM_I2CM_CTRLA_SPEED_Pos 24 /**< \brief (SERCOM_I2CM_CTRLA) Transfer Speed */ #define SERCOM_I2CM_CTRLA_SPEED_Msk (_U_(0x3) << SERCOM_I2CM_CTRLA_SPEED_Pos) @@ -112,7 +112,7 @@ typedef union { uint32_t :3; /*!< bit: 17..19 Reserved */ uint32_t SDAHOLD:2; /*!< bit: 20..21 SDA Hold Time */ uint32_t :1; /*!< bit: 22 Reserved */ - uint32_t SEXTTOEN:1; /*!< bit: 23 Slave SCL Low Extend Timeout */ + uint32_t SEXTTOEN:1; /*!< bit: 23 follower SCL Low Extend Timeout */ uint32_t SPEED:2; /*!< bit: 24..25 Transfer Speed */ uint32_t :1; /*!< bit: 26 Reserved */ uint32_t SCLSM:1; /*!< bit: 27 SCL Clock Stretch Mode */ @@ -141,7 +141,7 @@ typedef union { #define SERCOM_I2CS_CTRLA_SDAHOLD_Pos 20 /**< \brief (SERCOM_I2CS_CTRLA) SDA Hold Time */ #define SERCOM_I2CS_CTRLA_SDAHOLD_Msk (_U_(0x3) << SERCOM_I2CS_CTRLA_SDAHOLD_Pos) #define SERCOM_I2CS_CTRLA_SDAHOLD(value) (SERCOM_I2CS_CTRLA_SDAHOLD_Msk & ((value) << SERCOM_I2CS_CTRLA_SDAHOLD_Pos)) -#define SERCOM_I2CS_CTRLA_SEXTTOEN_Pos 23 /**< \brief (SERCOM_I2CS_CTRLA) Slave SCL Low Extend Timeout */ +#define SERCOM_I2CS_CTRLA_SEXTTOEN_Pos 23 /**< \brief (SERCOM_I2CS_CTRLA) follower SCL Low Extend Timeout */ #define SERCOM_I2CS_CTRLA_SEXTTOEN (_U_(0x1) << SERCOM_I2CS_CTRLA_SEXTTOEN_Pos) #define SERCOM_I2CS_CTRLA_SPEED_Pos 24 /**< \brief (SERCOM_I2CS_CTRLA) Transfer Speed */ #define SERCOM_I2CS_CTRLA_SPEED_Msk (_U_(0x3) << SERCOM_I2CS_CTRLA_SPEED_Pos) @@ -352,9 +352,9 @@ typedef union { uint32_t :3; /*!< bit: 3.. 5 Reserved */ uint32_t PLOADEN:1; /*!< bit: 6 Data Preload Enable */ uint32_t :2; /*!< bit: 7.. 8 Reserved */ - uint32_t SSDE:1; /*!< bit: 9 Slave Select Low Detect Enable */ + uint32_t SSDE:1; /*!< bit: 9 follower Select Low Detect Enable */ uint32_t :3; /*!< bit: 10..12 Reserved */ - uint32_t MSSEN:1; /*!< bit: 13 Master Slave Select Enable */ + uint32_t MSSEN:1; /*!< bit: 13 Master follower Select Enable */ uint32_t AMODE:2; /*!< bit: 14..15 Address Mode */ uint32_t :1; /*!< bit: 16 Reserved */ uint32_t RXEN:1; /*!< bit: 17 Receiver Enable */ @@ -372,9 +372,9 @@ typedef union { #define SERCOM_SPI_CTRLB_CHSIZE(value) (SERCOM_SPI_CTRLB_CHSIZE_Msk & ((value) << SERCOM_SPI_CTRLB_CHSIZE_Pos)) #define SERCOM_SPI_CTRLB_PLOADEN_Pos 6 /**< \brief (SERCOM_SPI_CTRLB) Data Preload Enable */ #define SERCOM_SPI_CTRLB_PLOADEN (_U_(0x1) << SERCOM_SPI_CTRLB_PLOADEN_Pos) -#define SERCOM_SPI_CTRLB_SSDE_Pos 9 /**< \brief (SERCOM_SPI_CTRLB) Slave Select Low Detect Enable */ +#define SERCOM_SPI_CTRLB_SSDE_Pos 9 /**< \brief (SERCOM_SPI_CTRLB) follower Select Low Detect Enable */ #define SERCOM_SPI_CTRLB_SSDE (_U_(0x1) << SERCOM_SPI_CTRLB_SSDE_Pos) -#define SERCOM_SPI_CTRLB_MSSEN_Pos 13 /**< \brief (SERCOM_SPI_CTRLB) Master Slave Select Enable */ +#define SERCOM_SPI_CTRLB_MSSEN_Pos 13 /**< \brief (SERCOM_SPI_CTRLB) Master follower Select Enable */ #define SERCOM_SPI_CTRLB_MSSEN (_U_(0x1) << SERCOM_SPI_CTRLB_MSSEN_Pos) #define SERCOM_SPI_CTRLB_AMODE_Pos 14 /**< \brief (SERCOM_SPI_CTRLB) Address Mode */ #define SERCOM_SPI_CTRLB_AMODE_Msk (_U_(0x3) << SERCOM_SPI_CTRLB_AMODE_Pos) @@ -666,7 +666,7 @@ typedef union { typedef union { struct { uint8_t MB:1; /*!< bit: 0 Master On Bus Interrupt Disable */ - uint8_t SB:1; /*!< bit: 1 Slave On Bus Interrupt Disable */ + uint8_t SB:1; /*!< bit: 1 follower On Bus Interrupt Disable */ uint8_t :5; /*!< bit: 2.. 6 Reserved */ uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt Disable */ } bit; /*!< Structure used for bit access */ @@ -679,7 +679,7 @@ typedef union { #define SERCOM_I2CM_INTENCLR_MB_Pos 0 /**< \brief (SERCOM_I2CM_INTENCLR) Master On Bus Interrupt Disable */ #define SERCOM_I2CM_INTENCLR_MB (_U_(0x1) << SERCOM_I2CM_INTENCLR_MB_Pos) -#define SERCOM_I2CM_INTENCLR_SB_Pos 1 /**< \brief (SERCOM_I2CM_INTENCLR) Slave On Bus Interrupt Disable */ +#define SERCOM_I2CM_INTENCLR_SB_Pos 1 /**< \brief (SERCOM_I2CM_INTENCLR) follower On Bus Interrupt Disable */ #define SERCOM_I2CM_INTENCLR_SB (_U_(0x1) << SERCOM_I2CM_INTENCLR_SB_Pos) #define SERCOM_I2CM_INTENCLR_ERROR_Pos 7 /**< \brief (SERCOM_I2CM_INTENCLR) Combined Error Interrupt Disable */ #define SERCOM_I2CM_INTENCLR_ERROR (_U_(0x1) << SERCOM_I2CM_INTENCLR_ERROR_Pos) @@ -719,7 +719,7 @@ typedef union { uint8_t DRE:1; /*!< bit: 0 Data Register Empty Interrupt Disable */ uint8_t TXC:1; /*!< bit: 1 Transmit Complete Interrupt Disable */ uint8_t RXC:1; /*!< bit: 2 Receive Complete Interrupt Disable */ - uint8_t SSL:1; /*!< bit: 3 Slave Select Low Interrupt Disable */ + uint8_t SSL:1; /*!< bit: 3 follower Select Low Interrupt Disable */ uint8_t :3; /*!< bit: 4.. 6 Reserved */ uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt Disable */ } bit; /*!< Structure used for bit access */ @@ -736,7 +736,7 @@ typedef union { #define SERCOM_SPI_INTENCLR_TXC (_U_(0x1) << SERCOM_SPI_INTENCLR_TXC_Pos) #define SERCOM_SPI_INTENCLR_RXC_Pos 2 /**< \brief (SERCOM_SPI_INTENCLR) Receive Complete Interrupt Disable */ #define SERCOM_SPI_INTENCLR_RXC (_U_(0x1) << SERCOM_SPI_INTENCLR_RXC_Pos) -#define SERCOM_SPI_INTENCLR_SSL_Pos 3 /**< \brief (SERCOM_SPI_INTENCLR) Slave Select Low Interrupt Disable */ +#define SERCOM_SPI_INTENCLR_SSL_Pos 3 /**< \brief (SERCOM_SPI_INTENCLR) follower Select Low Interrupt Disable */ #define SERCOM_SPI_INTENCLR_SSL (_U_(0x1) << SERCOM_SPI_INTENCLR_SSL_Pos) #define SERCOM_SPI_INTENCLR_ERROR_Pos 7 /**< \brief (SERCOM_SPI_INTENCLR) Combined Error Interrupt Disable */ #define SERCOM_SPI_INTENCLR_ERROR (_U_(0x1) << SERCOM_SPI_INTENCLR_ERROR_Pos) @@ -783,7 +783,7 @@ typedef union { typedef union { struct { uint8_t MB:1; /*!< bit: 0 Master On Bus Interrupt Enable */ - uint8_t SB:1; /*!< bit: 1 Slave On Bus Interrupt Enable */ + uint8_t SB:1; /*!< bit: 1 follower On Bus Interrupt Enable */ uint8_t :5; /*!< bit: 2.. 6 Reserved */ uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt Enable */ } bit; /*!< Structure used for bit access */ @@ -796,7 +796,7 @@ typedef union { #define SERCOM_I2CM_INTENSET_MB_Pos 0 /**< \brief (SERCOM_I2CM_INTENSET) Master On Bus Interrupt Enable */ #define SERCOM_I2CM_INTENSET_MB (_U_(0x1) << SERCOM_I2CM_INTENSET_MB_Pos) -#define SERCOM_I2CM_INTENSET_SB_Pos 1 /**< \brief (SERCOM_I2CM_INTENSET) Slave On Bus Interrupt Enable */ +#define SERCOM_I2CM_INTENSET_SB_Pos 1 /**< \brief (SERCOM_I2CM_INTENSET) follower On Bus Interrupt Enable */ #define SERCOM_I2CM_INTENSET_SB (_U_(0x1) << SERCOM_I2CM_INTENSET_SB_Pos) #define SERCOM_I2CM_INTENSET_ERROR_Pos 7 /**< \brief (SERCOM_I2CM_INTENSET) Combined Error Interrupt Enable */ #define SERCOM_I2CM_INTENSET_ERROR (_U_(0x1) << SERCOM_I2CM_INTENSET_ERROR_Pos) @@ -836,7 +836,7 @@ typedef union { uint8_t DRE:1; /*!< bit: 0 Data Register Empty Interrupt Enable */ uint8_t TXC:1; /*!< bit: 1 Transmit Complete Interrupt Enable */ uint8_t RXC:1; /*!< bit: 2 Receive Complete Interrupt Enable */ - uint8_t SSL:1; /*!< bit: 3 Slave Select Low Interrupt Enable */ + uint8_t SSL:1; /*!< bit: 3 follower Select Low Interrupt Enable */ uint8_t :3; /*!< bit: 4.. 6 Reserved */ uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt Enable */ } bit; /*!< Structure used for bit access */ @@ -853,7 +853,7 @@ typedef union { #define SERCOM_SPI_INTENSET_TXC (_U_(0x1) << SERCOM_SPI_INTENSET_TXC_Pos) #define SERCOM_SPI_INTENSET_RXC_Pos 2 /**< \brief (SERCOM_SPI_INTENSET) Receive Complete Interrupt Enable */ #define SERCOM_SPI_INTENSET_RXC (_U_(0x1) << SERCOM_SPI_INTENSET_RXC_Pos) -#define SERCOM_SPI_INTENSET_SSL_Pos 3 /**< \brief (SERCOM_SPI_INTENSET) Slave Select Low Interrupt Enable */ +#define SERCOM_SPI_INTENSET_SSL_Pos 3 /**< \brief (SERCOM_SPI_INTENSET) follower Select Low Interrupt Enable */ #define SERCOM_SPI_INTENSET_SSL (_U_(0x1) << SERCOM_SPI_INTENSET_SSL_Pos) #define SERCOM_SPI_INTENSET_ERROR_Pos 7 /**< \brief (SERCOM_SPI_INTENSET) Combined Error Interrupt Enable */ #define SERCOM_SPI_INTENSET_ERROR (_U_(0x1) << SERCOM_SPI_INTENSET_ERROR_Pos) @@ -900,7 +900,7 @@ typedef union { typedef union { // __I to avoid read-modify-write on write-to-clear register struct { __I uint8_t MB:1; /*!< bit: 0 Master On Bus Interrupt */ - __I uint8_t SB:1; /*!< bit: 1 Slave On Bus Interrupt */ + __I uint8_t SB:1; /*!< bit: 1 follower On Bus Interrupt */ __I uint8_t :5; /*!< bit: 2.. 6 Reserved */ __I uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt */ } bit; /*!< Structure used for bit access */ @@ -913,7 +913,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register #define SERCOM_I2CM_INTFLAG_MB_Pos 0 /**< \brief (SERCOM_I2CM_INTFLAG) Master On Bus Interrupt */ #define SERCOM_I2CM_INTFLAG_MB (_U_(0x1) << SERCOM_I2CM_INTFLAG_MB_Pos) -#define SERCOM_I2CM_INTFLAG_SB_Pos 1 /**< \brief (SERCOM_I2CM_INTFLAG) Slave On Bus Interrupt */ +#define SERCOM_I2CM_INTFLAG_SB_Pos 1 /**< \brief (SERCOM_I2CM_INTFLAG) follower On Bus Interrupt */ #define SERCOM_I2CM_INTFLAG_SB (_U_(0x1) << SERCOM_I2CM_INTFLAG_SB_Pos) #define SERCOM_I2CM_INTFLAG_ERROR_Pos 7 /**< \brief (SERCOM_I2CM_INTFLAG) Combined Error Interrupt */ #define SERCOM_I2CM_INTFLAG_ERROR (_U_(0x1) << SERCOM_I2CM_INTFLAG_ERROR_Pos) @@ -953,7 +953,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register __I uint8_t DRE:1; /*!< bit: 0 Data Register Empty Interrupt */ __I uint8_t TXC:1; /*!< bit: 1 Transmit Complete Interrupt */ __I uint8_t RXC:1; /*!< bit: 2 Receive Complete Interrupt */ - __I uint8_t SSL:1; /*!< bit: 3 Slave Select Low Interrupt Flag */ + __I uint8_t SSL:1; /*!< bit: 3 follower Select Low Interrupt Flag */ __I uint8_t :3; /*!< bit: 4.. 6 Reserved */ __I uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt */ } bit; /*!< Structure used for bit access */ @@ -970,7 +970,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register #define SERCOM_SPI_INTFLAG_TXC (_U_(0x1) << SERCOM_SPI_INTFLAG_TXC_Pos) #define SERCOM_SPI_INTFLAG_RXC_Pos 2 /**< \brief (SERCOM_SPI_INTFLAG) Receive Complete Interrupt */ #define SERCOM_SPI_INTFLAG_RXC (_U_(0x1) << SERCOM_SPI_INTFLAG_RXC_Pos) -#define SERCOM_SPI_INTFLAG_SSL_Pos 3 /**< \brief (SERCOM_SPI_INTFLAG) Slave Select Low Interrupt Flag */ +#define SERCOM_SPI_INTFLAG_SSL_Pos 3 /**< \brief (SERCOM_SPI_INTFLAG) follower Select Low Interrupt Flag */ #define SERCOM_SPI_INTFLAG_SSL (_U_(0x1) << SERCOM_SPI_INTFLAG_SSL_Pos) #define SERCOM_SPI_INTFLAG_ERROR_Pos 7 /**< \brief (SERCOM_SPI_INTFLAG) Combined Error Interrupt */ #define SERCOM_SPI_INTFLAG_ERROR (_U_(0x1) << SERCOM_SPI_INTFLAG_ERROR_Pos) @@ -1024,7 +1024,7 @@ typedef union { uint16_t LOWTOUT:1; /*!< bit: 6 SCL Low Timeout */ uint16_t CLKHOLD:1; /*!< bit: 7 Clock Hold */ uint16_t MEXTTOUT:1; /*!< bit: 8 Master SCL Low Extend Timeout */ - uint16_t SEXTTOUT:1; /*!< bit: 9 Slave SCL Low Extend Timeout */ + uint16_t SEXTTOUT:1; /*!< bit: 9 follower SCL Low Extend Timeout */ uint16_t LENERR:1; /*!< bit: 10 Length Error */ uint16_t :5; /*!< bit: 11..15 Reserved */ } bit; /*!< Structure used for bit access */ @@ -1050,7 +1050,7 @@ typedef union { #define SERCOM_I2CM_STATUS_CLKHOLD (_U_(0x1) << SERCOM_I2CM_STATUS_CLKHOLD_Pos) #define SERCOM_I2CM_STATUS_MEXTTOUT_Pos 8 /**< \brief (SERCOM_I2CM_STATUS) Master SCL Low Extend Timeout */ #define SERCOM_I2CM_STATUS_MEXTTOUT (_U_(0x1) << SERCOM_I2CM_STATUS_MEXTTOUT_Pos) -#define SERCOM_I2CM_STATUS_SEXTTOUT_Pos 9 /**< \brief (SERCOM_I2CM_STATUS) Slave SCL Low Extend Timeout */ +#define SERCOM_I2CM_STATUS_SEXTTOUT_Pos 9 /**< \brief (SERCOM_I2CM_STATUS) follower SCL Low Extend Timeout */ #define SERCOM_I2CM_STATUS_SEXTTOUT (_U_(0x1) << SERCOM_I2CM_STATUS_SEXTTOUT_Pos) #define SERCOM_I2CM_STATUS_LENERR_Pos 10 /**< \brief (SERCOM_I2CM_STATUS) Length Error */ #define SERCOM_I2CM_STATUS_LENERR (_U_(0x1) << SERCOM_I2CM_STATUS_LENERR_Pos) @@ -1069,7 +1069,7 @@ typedef union { uint16_t LOWTOUT:1; /*!< bit: 6 SCL Low Timeout */ uint16_t CLKHOLD:1; /*!< bit: 7 Clock Hold */ uint16_t :1; /*!< bit: 8 Reserved */ - uint16_t SEXTTOUT:1; /*!< bit: 9 Slave SCL Low Extend Timeout */ + uint16_t SEXTTOUT:1; /*!< bit: 9 follower SCL Low Extend Timeout */ uint16_t HS:1; /*!< bit: 10 High Speed */ uint16_t LENERR:1; /*!< bit: 11 Transaction Length Error */ uint16_t :4; /*!< bit: 12..15 Reserved */ @@ -1095,7 +1095,7 @@ typedef union { #define SERCOM_I2CS_STATUS_LOWTOUT (_U_(0x1) << SERCOM_I2CS_STATUS_LOWTOUT_Pos) #define SERCOM_I2CS_STATUS_CLKHOLD_Pos 7 /**< \brief (SERCOM_I2CS_STATUS) Clock Hold */ #define SERCOM_I2CS_STATUS_CLKHOLD (_U_(0x1) << SERCOM_I2CS_STATUS_CLKHOLD_Pos) -#define SERCOM_I2CS_STATUS_SEXTTOUT_Pos 9 /**< \brief (SERCOM_I2CS_STATUS) Slave SCL Low Extend Timeout */ +#define SERCOM_I2CS_STATUS_SEXTTOUT_Pos 9 /**< \brief (SERCOM_I2CS_STATUS) follower SCL Low Extend Timeout */ #define SERCOM_I2CS_STATUS_SEXTTOUT (_U_(0x1) << SERCOM_I2CS_STATUS_SEXTTOUT_Pos) #define SERCOM_I2CS_STATUS_HS_Pos 10 /**< \brief (SERCOM_I2CS_STATUS) High Speed */ #define SERCOM_I2CS_STATUS_HS (_U_(0x1) << SERCOM_I2CS_STATUS_HS_Pos) @@ -1594,7 +1594,7 @@ typedef struct { /* I2C Master Mode */ /** \brief SERCOM_I2CS hardware registers */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -typedef struct { /* I2C Slave Mode */ +typedef struct { /* I2C follower Mode */ __IO SERCOM_I2CS_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 32) I2CS Control A */ __IO SERCOM_I2CS_CTRLB_Type CTRLB; /**< \brief Offset: 0x04 (R/W 32) I2CS Control B */ __IO SERCOM_I2CS_CTRLC_Type CTRLC; /**< \brief Offset: 0x08 (R/W 32) I2CS Control C */ @@ -1669,7 +1669,7 @@ typedef struct { /* USART Mode */ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) typedef union { SercomI2cm I2CM; /**< \brief Offset: 0x00 I2C Master Mode */ - SercomI2cs I2CS; /**< \brief Offset: 0x00 I2C Slave Mode */ + SercomI2cs I2CS; /**< \brief Offset: 0x00 I2C follower Mode */ SercomSpi SPI; /**< \brief Offset: 0x00 SPI Mode */ SercomUsart USART; /**< \brief Offset: 0x00 USART Mode */ } Sercom; diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tc.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tc.h index f4c0daf3448f..c6b331bec217 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tc.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tc.h @@ -412,7 +412,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register typedef union { struct { uint8_t STOP:1; /*!< bit: 0 Stop Status Flag */ - uint8_t SLAVE:1; /*!< bit: 1 Slave Status Flag */ + uint8_t follower:1; /*!< bit: 1 follower Status Flag */ uint8_t :1; /*!< bit: 2 Reserved */ uint8_t PERBUFV:1; /*!< bit: 3 Synchronization Busy Status */ uint8_t CCBUFV0:1; /*!< bit: 4 Compare channel buffer 0 valid */ @@ -433,8 +433,8 @@ typedef union { #define TC_STATUS_STOP_Pos 0 /**< \brief (TC_STATUS) Stop Status Flag */ #define TC_STATUS_STOP (_U_(0x1) << TC_STATUS_STOP_Pos) -#define TC_STATUS_SLAVE_Pos 1 /**< \brief (TC_STATUS) Slave Status Flag */ -#define TC_STATUS_SLAVE (_U_(0x1) << TC_STATUS_SLAVE_Pos) +#define TC_STATUS_follower_Pos 1 /**< \brief (TC_STATUS) follower Status Flag */ +#define TC_STATUS_follower (_U_(0x1) << TC_STATUS_follower_Pos) #define TC_STATUS_PERBUFV_Pos 3 /**< \brief (TC_STATUS) Synchronization Busy Status */ #define TC_STATUS_PERBUFV (_U_(0x1) << TC_STATUS_PERBUFV_Pos) #define TC_STATUS_CCBUFV0_Pos 4 /**< \brief (TC_STATUS) Compare channel buffer 0 valid */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tcc.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tcc.h index a32abe964d32..5b9acd50725c 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tcc.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tcc.h @@ -52,7 +52,7 @@ typedef union { uint32_t RUNSTDBY:1; /*!< bit: 11 Run in Standby */ uint32_t PRESCSYNC:2; /*!< bit: 12..13 Prescaler and Counter Synchronization Selection */ uint32_t ALOCK:1; /*!< bit: 14 Auto Lock */ - uint32_t MSYNC:1; /*!< bit: 15 Master Synchronization (only for TCC Slave Instance) */ + uint32_t MSYNC:1; /*!< bit: 15 Master Synchronization (only for TCC follower Instance) */ uint32_t :7; /*!< bit: 16..22 Reserved */ uint32_t DMAOS:1; /*!< bit: 23 DMA One-shot Trigger Mode */ uint32_t CPTEN0:1; /*!< bit: 24 Capture Channel 0 Enable */ @@ -122,7 +122,7 @@ typedef union { #define TCC_CTRLA_PRESCSYNC_RESYNC (TCC_CTRLA_PRESCSYNC_RESYNC_Val << TCC_CTRLA_PRESCSYNC_Pos) #define TCC_CTRLA_ALOCK_Pos 14 /**< \brief (TCC_CTRLA) Auto Lock */ #define TCC_CTRLA_ALOCK (_U_(0x1) << TCC_CTRLA_ALOCK_Pos) -#define TCC_CTRLA_MSYNC_Pos 15 /**< \brief (TCC_CTRLA) Master Synchronization (only for TCC Slave Instance) */ +#define TCC_CTRLA_MSYNC_Pos 15 /**< \brief (TCC_CTRLA) Master Synchronization (only for TCC follower Instance) */ #define TCC_CTRLA_MSYNC (_U_(0x1) << TCC_CTRLA_MSYNC_Pos) #define TCC_CTRLA_DMAOS_Pos 23 /**< \brief (TCC_CTRLA) DMA One-shot Trigger Mode */ #define TCC_CTRLA_DMAOS (_U_(0x1) << TCC_CTRLA_DMAOS_Pos) @@ -1068,7 +1068,7 @@ typedef union { uint32_t IDX:1; /*!< bit: 1 Ramp */ uint32_t UFS:1; /*!< bit: 2 Non-recoverable Update Fault State */ uint32_t DFS:1; /*!< bit: 3 Non-Recoverable Debug Fault State */ - uint32_t SLAVE:1; /*!< bit: 4 Slave */ + uint32_t follower:1; /*!< bit: 4 follower */ uint32_t PATTBUFV:1; /*!< bit: 5 Pattern Buffer Valid */ uint32_t :1; /*!< bit: 6 Reserved */ uint32_t PERBUFV:1; /*!< bit: 7 Period Buffer Valid */ @@ -1117,8 +1117,8 @@ typedef union { #define TCC_STATUS_UFS (_U_(0x1) << TCC_STATUS_UFS_Pos) #define TCC_STATUS_DFS_Pos 3 /**< \brief (TCC_STATUS) Non-Recoverable Debug Fault State */ #define TCC_STATUS_DFS (_U_(0x1) << TCC_STATUS_DFS_Pos) -#define TCC_STATUS_SLAVE_Pos 4 /**< \brief (TCC_STATUS) Slave */ -#define TCC_STATUS_SLAVE (_U_(0x1) << TCC_STATUS_SLAVE_Pos) +#define TCC_STATUS_follower_Pos 4 /**< \brief (TCC_STATUS) follower */ +#define TCC_STATUS_follower (_U_(0x1) << TCC_STATUS_follower_Pos) #define TCC_STATUS_PATTBUFV_Pos 5 /**< \brief (TCC_STATUS) Pattern Buffer Valid */ #define TCC_STATUS_PATTBUFV (_U_(0x1) << TCC_STATUS_PATTBUFV_Pos) #define TCC_STATUS_PERBUFV_Pos 7 /**< \brief (TCC_STATUS) Period Buffer Valid */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc0.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc0.h index 6808fff9da80..b92a3c39ab33 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc0.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc0.h @@ -90,7 +90,7 @@ #define ADC0_DMAC_ID_SEQ 69 // Index of DMA SEQ trigger #define ADC0_EXTCHANNEL_MSB 15 // Number of external channels #define ADC0_GCLK_ID 40 // index of Generic Clock -#define ADC0_MASTER_SLAVE_MODE 1 // ADC Master/Slave Mode +#define ADC0_MASTER_follower_MODE 1 // ADC Master/follower Mode #define ADC0_OPAMP2 0 // MUXPOS value to select OPAMP2 #define ADC0_OPAMP01 0 // MUXPOS value to select OPAMP01 #define ADC0_PTAT 28 // MUXPOS value to select PTAT diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc1.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc1.h index af572c056076..b2a58344b096 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc1.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc1.h @@ -90,7 +90,7 @@ #define ADC1_DMAC_ID_SEQ 71 // Index of DMA SEQ trigger #define ADC1_EXTCHANNEL_MSB 15 // Number of external channels #define ADC1_GCLK_ID 41 // Index of Generic Clock -#define ADC1_MASTER_SLAVE_MODE 2 // ADC Master/Slave Mode +#define ADC1_MASTER_follower_MODE 2 // ADC Master/follower Mode #define ADC1_OPAMP2 0 // MUXPOS value to select OPAMP2 #define ADC1_OPAMP01 0 // MUXPOS value to select OPAMP01 #define ADC1_PTAT 28 // MUXPOS value to select PTAT diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/hmatrix.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/hmatrix.h index 9333d859ed3c..a95abf21dabd 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/hmatrix.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/hmatrix.h @@ -32,93 +32,93 @@ /* ========== Register definition for HMATRIX peripheral ========== */ #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define REG_HMATRIX_PRAS0 (0x4100C080) /**< \brief (HMATRIX) Priority A for Slave 0 */ -#define REG_HMATRIX_PRBS0 (0x4100C084) /**< \brief (HMATRIX) Priority B for Slave 0 */ -#define REG_HMATRIX_PRAS1 (0x4100C088) /**< \brief (HMATRIX) Priority A for Slave 1 */ -#define REG_HMATRIX_PRBS1 (0x4100C08C) /**< \brief (HMATRIX) Priority B for Slave 1 */ -#define REG_HMATRIX_PRAS2 (0x4100C090) /**< \brief (HMATRIX) Priority A for Slave 2 */ -#define REG_HMATRIX_PRBS2 (0x4100C094) /**< \brief (HMATRIX) Priority B for Slave 2 */ -#define REG_HMATRIX_PRAS3 (0x4100C098) /**< \brief (HMATRIX) Priority A for Slave 3 */ -#define REG_HMATRIX_PRBS3 (0x4100C09C) /**< \brief (HMATRIX) Priority B for Slave 3 */ -#define REG_HMATRIX_PRAS4 (0x4100C0A0) /**< \brief (HMATRIX) Priority A for Slave 4 */ -#define REG_HMATRIX_PRBS4 (0x4100C0A4) /**< \brief (HMATRIX) Priority B for Slave 4 */ -#define REG_HMATRIX_PRAS5 (0x4100C0A8) /**< \brief (HMATRIX) Priority A for Slave 5 */ -#define REG_HMATRIX_PRBS5 (0x4100C0AC) /**< \brief (HMATRIX) Priority B for Slave 5 */ -#define REG_HMATRIX_PRAS6 (0x4100C0B0) /**< \brief (HMATRIX) Priority A for Slave 6 */ -#define REG_HMATRIX_PRBS6 (0x4100C0B4) /**< \brief (HMATRIX) Priority B for Slave 6 */ -#define REG_HMATRIX_PRAS7 (0x4100C0B8) /**< \brief (HMATRIX) Priority A for Slave 7 */ -#define REG_HMATRIX_PRBS7 (0x4100C0BC) /**< \brief (HMATRIX) Priority B for Slave 7 */ -#define REG_HMATRIX_PRAS8 (0x4100C0C0) /**< \brief (HMATRIX) Priority A for Slave 8 */ -#define REG_HMATRIX_PRBS8 (0x4100C0C4) /**< \brief (HMATRIX) Priority B for Slave 8 */ -#define REG_HMATRIX_PRAS9 (0x4100C0C8) /**< \brief (HMATRIX) Priority A for Slave 9 */ -#define REG_HMATRIX_PRBS9 (0x4100C0CC) /**< \brief (HMATRIX) Priority B for Slave 9 */ -#define REG_HMATRIX_PRAS10 (0x4100C0D0) /**< \brief (HMATRIX) Priority A for Slave 10 */ -#define REG_HMATRIX_PRBS10 (0x4100C0D4) /**< \brief (HMATRIX) Priority B for Slave 10 */ -#define REG_HMATRIX_PRAS11 (0x4100C0D8) /**< \brief (HMATRIX) Priority A for Slave 11 */ -#define REG_HMATRIX_PRBS11 (0x4100C0DC) /**< \brief (HMATRIX) Priority B for Slave 11 */ -#define REG_HMATRIX_PRAS12 (0x4100C0E0) /**< \brief (HMATRIX) Priority A for Slave 12 */ -#define REG_HMATRIX_PRBS12 (0x4100C0E4) /**< \brief (HMATRIX) Priority B for Slave 12 */ -#define REG_HMATRIX_PRAS13 (0x4100C0E8) /**< \brief (HMATRIX) Priority A for Slave 13 */ -#define REG_HMATRIX_PRBS13 (0x4100C0EC) /**< \brief (HMATRIX) Priority B for Slave 13 */ -#define REG_HMATRIX_PRAS14 (0x4100C0F0) /**< \brief (HMATRIX) Priority A for Slave 14 */ -#define REG_HMATRIX_PRBS14 (0x4100C0F4) /**< \brief (HMATRIX) Priority B for Slave 14 */ -#define REG_HMATRIX_PRAS15 (0x4100C0F8) /**< \brief (HMATRIX) Priority A for Slave 15 */ -#define REG_HMATRIX_PRBS15 (0x4100C0FC) /**< \brief (HMATRIX) Priority B for Slave 15 */ +#define REG_HMATRIX_PRAS0 (0x4100C080) /**< \brief (HMATRIX) Priority A for follower 0 */ +#define REG_HMATRIX_PRBS0 (0x4100C084) /**< \brief (HMATRIX) Priority B for follower 0 */ +#define REG_HMATRIX_PRAS1 (0x4100C088) /**< \brief (HMATRIX) Priority A for follower 1 */ +#define REG_HMATRIX_PRBS1 (0x4100C08C) /**< \brief (HMATRIX) Priority B for follower 1 */ +#define REG_HMATRIX_PRAS2 (0x4100C090) /**< \brief (HMATRIX) Priority A for follower 2 */ +#define REG_HMATRIX_PRBS2 (0x4100C094) /**< \brief (HMATRIX) Priority B for follower 2 */ +#define REG_HMATRIX_PRAS3 (0x4100C098) /**< \brief (HMATRIX) Priority A for follower 3 */ +#define REG_HMATRIX_PRBS3 (0x4100C09C) /**< \brief (HMATRIX) Priority B for follower 3 */ +#define REG_HMATRIX_PRAS4 (0x4100C0A0) /**< \brief (HMATRIX) Priority A for follower 4 */ +#define REG_HMATRIX_PRBS4 (0x4100C0A4) /**< \brief (HMATRIX) Priority B for follower 4 */ +#define REG_HMATRIX_PRAS5 (0x4100C0A8) /**< \brief (HMATRIX) Priority A for follower 5 */ +#define REG_HMATRIX_PRBS5 (0x4100C0AC) /**< \brief (HMATRIX) Priority B for follower 5 */ +#define REG_HMATRIX_PRAS6 (0x4100C0B0) /**< \brief (HMATRIX) Priority A for follower 6 */ +#define REG_HMATRIX_PRBS6 (0x4100C0B4) /**< \brief (HMATRIX) Priority B for follower 6 */ +#define REG_HMATRIX_PRAS7 (0x4100C0B8) /**< \brief (HMATRIX) Priority A for follower 7 */ +#define REG_HMATRIX_PRBS7 (0x4100C0BC) /**< \brief (HMATRIX) Priority B for follower 7 */ +#define REG_HMATRIX_PRAS8 (0x4100C0C0) /**< \brief (HMATRIX) Priority A for follower 8 */ +#define REG_HMATRIX_PRBS8 (0x4100C0C4) /**< \brief (HMATRIX) Priority B for follower 8 */ +#define REG_HMATRIX_PRAS9 (0x4100C0C8) /**< \brief (HMATRIX) Priority A for follower 9 */ +#define REG_HMATRIX_PRBS9 (0x4100C0CC) /**< \brief (HMATRIX) Priority B for follower 9 */ +#define REG_HMATRIX_PRAS10 (0x4100C0D0) /**< \brief (HMATRIX) Priority A for follower 10 */ +#define REG_HMATRIX_PRBS10 (0x4100C0D4) /**< \brief (HMATRIX) Priority B for follower 10 */ +#define REG_HMATRIX_PRAS11 (0x4100C0D8) /**< \brief (HMATRIX) Priority A for follower 11 */ +#define REG_HMATRIX_PRBS11 (0x4100C0DC) /**< \brief (HMATRIX) Priority B for follower 11 */ +#define REG_HMATRIX_PRAS12 (0x4100C0E0) /**< \brief (HMATRIX) Priority A for follower 12 */ +#define REG_HMATRIX_PRBS12 (0x4100C0E4) /**< \brief (HMATRIX) Priority B for follower 12 */ +#define REG_HMATRIX_PRAS13 (0x4100C0E8) /**< \brief (HMATRIX) Priority A for follower 13 */ +#define REG_HMATRIX_PRBS13 (0x4100C0EC) /**< \brief (HMATRIX) Priority B for follower 13 */ +#define REG_HMATRIX_PRAS14 (0x4100C0F0) /**< \brief (HMATRIX) Priority A for follower 14 */ +#define REG_HMATRIX_PRBS14 (0x4100C0F4) /**< \brief (HMATRIX) Priority B for follower 14 */ +#define REG_HMATRIX_PRAS15 (0x4100C0F8) /**< \brief (HMATRIX) Priority A for follower 15 */ +#define REG_HMATRIX_PRBS15 (0x4100C0FC) /**< \brief (HMATRIX) Priority B for follower 15 */ #else -#define REG_HMATRIX_PRAS0 (*(RwReg *)0x4100C080UL) /**< \brief (HMATRIX) Priority A for Slave 0 */ -#define REG_HMATRIX_PRBS0 (*(RwReg *)0x4100C084UL) /**< \brief (HMATRIX) Priority B for Slave 0 */ -#define REG_HMATRIX_PRAS1 (*(RwReg *)0x4100C088UL) /**< \brief (HMATRIX) Priority A for Slave 1 */ -#define REG_HMATRIX_PRBS1 (*(RwReg *)0x4100C08CUL) /**< \brief (HMATRIX) Priority B for Slave 1 */ -#define REG_HMATRIX_PRAS2 (*(RwReg *)0x4100C090UL) /**< \brief (HMATRIX) Priority A for Slave 2 */ -#define REG_HMATRIX_PRBS2 (*(RwReg *)0x4100C094UL) /**< \brief (HMATRIX) Priority B for Slave 2 */ -#define REG_HMATRIX_PRAS3 (*(RwReg *)0x4100C098UL) /**< \brief (HMATRIX) Priority A for Slave 3 */ -#define REG_HMATRIX_PRBS3 (*(RwReg *)0x4100C09CUL) /**< \brief (HMATRIX) Priority B for Slave 3 */ -#define REG_HMATRIX_PRAS4 (*(RwReg *)0x4100C0A0UL) /**< \brief (HMATRIX) Priority A for Slave 4 */ -#define REG_HMATRIX_PRBS4 (*(RwReg *)0x4100C0A4UL) /**< \brief (HMATRIX) Priority B for Slave 4 */ -#define REG_HMATRIX_PRAS5 (*(RwReg *)0x4100C0A8UL) /**< \brief (HMATRIX) Priority A for Slave 5 */ -#define REG_HMATRIX_PRBS5 (*(RwReg *)0x4100C0ACUL) /**< \brief (HMATRIX) Priority B for Slave 5 */ -#define REG_HMATRIX_PRAS6 (*(RwReg *)0x4100C0B0UL) /**< \brief (HMATRIX) Priority A for Slave 6 */ -#define REG_HMATRIX_PRBS6 (*(RwReg *)0x4100C0B4UL) /**< \brief (HMATRIX) Priority B for Slave 6 */ -#define REG_HMATRIX_PRAS7 (*(RwReg *)0x4100C0B8UL) /**< \brief (HMATRIX) Priority A for Slave 7 */ -#define REG_HMATRIX_PRBS7 (*(RwReg *)0x4100C0BCUL) /**< \brief (HMATRIX) Priority B for Slave 7 */ -#define REG_HMATRIX_PRAS8 (*(RwReg *)0x4100C0C0UL) /**< \brief (HMATRIX) Priority A for Slave 8 */ -#define REG_HMATRIX_PRBS8 (*(RwReg *)0x4100C0C4UL) /**< \brief (HMATRIX) Priority B for Slave 8 */ -#define REG_HMATRIX_PRAS9 (*(RwReg *)0x4100C0C8UL) /**< \brief (HMATRIX) Priority A for Slave 9 */ -#define REG_HMATRIX_PRBS9 (*(RwReg *)0x4100C0CCUL) /**< \brief (HMATRIX) Priority B for Slave 9 */ -#define REG_HMATRIX_PRAS10 (*(RwReg *)0x4100C0D0UL) /**< \brief (HMATRIX) Priority A for Slave 10 */ -#define REG_HMATRIX_PRBS10 (*(RwReg *)0x4100C0D4UL) /**< \brief (HMATRIX) Priority B for Slave 10 */ -#define REG_HMATRIX_PRAS11 (*(RwReg *)0x4100C0D8UL) /**< \brief (HMATRIX) Priority A for Slave 11 */ -#define REG_HMATRIX_PRBS11 (*(RwReg *)0x4100C0DCUL) /**< \brief (HMATRIX) Priority B for Slave 11 */ -#define REG_HMATRIX_PRAS12 (*(RwReg *)0x4100C0E0UL) /**< \brief (HMATRIX) Priority A for Slave 12 */ -#define REG_HMATRIX_PRBS12 (*(RwReg *)0x4100C0E4UL) /**< \brief (HMATRIX) Priority B for Slave 12 */ -#define REG_HMATRIX_PRAS13 (*(RwReg *)0x4100C0E8UL) /**< \brief (HMATRIX) Priority A for Slave 13 */ -#define REG_HMATRIX_PRBS13 (*(RwReg *)0x4100C0ECUL) /**< \brief (HMATRIX) Priority B for Slave 13 */ -#define REG_HMATRIX_PRAS14 (*(RwReg *)0x4100C0F0UL) /**< \brief (HMATRIX) Priority A for Slave 14 */ -#define REG_HMATRIX_PRBS14 (*(RwReg *)0x4100C0F4UL) /**< \brief (HMATRIX) Priority B for Slave 14 */ -#define REG_HMATRIX_PRAS15 (*(RwReg *)0x4100C0F8UL) /**< \brief (HMATRIX) Priority A for Slave 15 */ -#define REG_HMATRIX_PRBS15 (*(RwReg *)0x4100C0FCUL) /**< \brief (HMATRIX) Priority B for Slave 15 */ +#define REG_HMATRIX_PRAS0 (*(RwReg *)0x4100C080UL) /**< \brief (HMATRIX) Priority A for follower 0 */ +#define REG_HMATRIX_PRBS0 (*(RwReg *)0x4100C084UL) /**< \brief (HMATRIX) Priority B for follower 0 */ +#define REG_HMATRIX_PRAS1 (*(RwReg *)0x4100C088UL) /**< \brief (HMATRIX) Priority A for follower 1 */ +#define REG_HMATRIX_PRBS1 (*(RwReg *)0x4100C08CUL) /**< \brief (HMATRIX) Priority B for follower 1 */ +#define REG_HMATRIX_PRAS2 (*(RwReg *)0x4100C090UL) /**< \brief (HMATRIX) Priority A for follower 2 */ +#define REG_HMATRIX_PRBS2 (*(RwReg *)0x4100C094UL) /**< \brief (HMATRIX) Priority B for follower 2 */ +#define REG_HMATRIX_PRAS3 (*(RwReg *)0x4100C098UL) /**< \brief (HMATRIX) Priority A for follower 3 */ +#define REG_HMATRIX_PRBS3 (*(RwReg *)0x4100C09CUL) /**< \brief (HMATRIX) Priority B for follower 3 */ +#define REG_HMATRIX_PRAS4 (*(RwReg *)0x4100C0A0UL) /**< \brief (HMATRIX) Priority A for follower 4 */ +#define REG_HMATRIX_PRBS4 (*(RwReg *)0x4100C0A4UL) /**< \brief (HMATRIX) Priority B for follower 4 */ +#define REG_HMATRIX_PRAS5 (*(RwReg *)0x4100C0A8UL) /**< \brief (HMATRIX) Priority A for follower 5 */ +#define REG_HMATRIX_PRBS5 (*(RwReg *)0x4100C0ACUL) /**< \brief (HMATRIX) Priority B for follower 5 */ +#define REG_HMATRIX_PRAS6 (*(RwReg *)0x4100C0B0UL) /**< \brief (HMATRIX) Priority A for follower 6 */ +#define REG_HMATRIX_PRBS6 (*(RwReg *)0x4100C0B4UL) /**< \brief (HMATRIX) Priority B for follower 6 */ +#define REG_HMATRIX_PRAS7 (*(RwReg *)0x4100C0B8UL) /**< \brief (HMATRIX) Priority A for follower 7 */ +#define REG_HMATRIX_PRBS7 (*(RwReg *)0x4100C0BCUL) /**< \brief (HMATRIX) Priority B for follower 7 */ +#define REG_HMATRIX_PRAS8 (*(RwReg *)0x4100C0C0UL) /**< \brief (HMATRIX) Priority A for follower 8 */ +#define REG_HMATRIX_PRBS8 (*(RwReg *)0x4100C0C4UL) /**< \brief (HMATRIX) Priority B for follower 8 */ +#define REG_HMATRIX_PRAS9 (*(RwReg *)0x4100C0C8UL) /**< \brief (HMATRIX) Priority A for follower 9 */ +#define REG_HMATRIX_PRBS9 (*(RwReg *)0x4100C0CCUL) /**< \brief (HMATRIX) Priority B for follower 9 */ +#define REG_HMATRIX_PRAS10 (*(RwReg *)0x4100C0D0UL) /**< \brief (HMATRIX) Priority A for follower 10 */ +#define REG_HMATRIX_PRBS10 (*(RwReg *)0x4100C0D4UL) /**< \brief (HMATRIX) Priority B for follower 10 */ +#define REG_HMATRIX_PRAS11 (*(RwReg *)0x4100C0D8UL) /**< \brief (HMATRIX) Priority A for follower 11 */ +#define REG_HMATRIX_PRBS11 (*(RwReg *)0x4100C0DCUL) /**< \brief (HMATRIX) Priority B for follower 11 */ +#define REG_HMATRIX_PRAS12 (*(RwReg *)0x4100C0E0UL) /**< \brief (HMATRIX) Priority A for follower 12 */ +#define REG_HMATRIX_PRBS12 (*(RwReg *)0x4100C0E4UL) /**< \brief (HMATRIX) Priority B for follower 12 */ +#define REG_HMATRIX_PRAS13 (*(RwReg *)0x4100C0E8UL) /**< \brief (HMATRIX) Priority A for follower 13 */ +#define REG_HMATRIX_PRBS13 (*(RwReg *)0x4100C0ECUL) /**< \brief (HMATRIX) Priority B for follower 13 */ +#define REG_HMATRIX_PRAS14 (*(RwReg *)0x4100C0F0UL) /**< \brief (HMATRIX) Priority A for follower 14 */ +#define REG_HMATRIX_PRBS14 (*(RwReg *)0x4100C0F4UL) /**< \brief (HMATRIX) Priority B for follower 14 */ +#define REG_HMATRIX_PRAS15 (*(RwReg *)0x4100C0F8UL) /**< \brief (HMATRIX) Priority A for follower 15 */ +#define REG_HMATRIX_PRBS15 (*(RwReg *)0x4100C0FCUL) /**< \brief (HMATRIX) Priority B for follower 15 */ #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ /* ========== Instance parameters for HMATRIX peripheral ========== */ #define HMATRIX_CLK_AHB_ID 5 // Index of AHB Clock in MCLK.AHBMASK register (MASK may be tied to 1 depending on chip integration) #define HMATRIX_DEFINED /* ========== Instance parameters for HMATRIX ========== */ -#define HMATRIX_SLAVE_FLASH 0 -#define HMATRIX_SLAVE_FLASH_ALT 1 -#define HMATRIX_SLAVE_SEEPROM 2 -#define HMATRIX_SLAVE_RAMCM4S 3 -#define HMATRIX_SLAVE_RAMPPPDSU 4 -#define HMATRIX_SLAVE_RAMDMAWR 5 -#define HMATRIX_SLAVE_RAMDMACICM 6 -#define HMATRIX_SLAVE_HPB0 7 -#define HMATRIX_SLAVE_HPB1 8 -#define HMATRIX_SLAVE_HPB2 9 -#define HMATRIX_SLAVE_HPB3 10 -#define HMATRIX_SLAVE_SDHC0 12 -#define HMATRIX_SLAVE_SDHC1 13 -#define HMATRIX_SLAVE_QSPI 14 -#define HMATRIX_SLAVE_BKUPRAM 15 -#define HMATRIX_SLAVE_NUM 16 +#define HMATRIX_follower_FLASH 0 +#define HMATRIX_follower_FLASH_ALT 1 +#define HMATRIX_follower_SEEPROM 2 +#define HMATRIX_follower_RAMCM4S 3 +#define HMATRIX_follower_RAMPPPDSU 4 +#define HMATRIX_follower_RAMDMAWR 5 +#define HMATRIX_follower_RAMDMACICM 6 +#define HMATRIX_follower_HPB0 7 +#define HMATRIX_follower_HPB1 8 +#define HMATRIX_follower_HPB2 9 +#define HMATRIX_follower_HPB3 10 +#define HMATRIX_follower_SDHC0 12 +#define HMATRIX_follower_SDHC1 13 +#define HMATRIX_follower_QSPI 14 +#define HMATRIX_follower_BKUPRAM 15 +#define HMATRIX_follower_NUM 16 #define HMATRIX_MASTER_CM4_S 0 #define HMATRIX_MASTER_CMCC 1 diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom0.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom0.h index cd440c5648c7..329b60e18847 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom0.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom0.h @@ -155,12 +155,12 @@ #define SERCOM0_SPI_WAKE_ON_SSL 1 // _SS low detect implemented? #define SERCOM0_TTBIT_EXTENSION 1 // 32-bit extension implemented? #define SERCOM0_TWIM 1 // TWI Master mode implemented? -#define SERCOM0_TWIS 1 // TWI Slave mode implemented? -#define SERCOM0_TWIS_AUTO_ACK 1 // TWI slave automatic acknowledge implemented? -#define SERCOM0_TWIS_GROUP_CMD 1 // TWI slave group command implemented? +#define SERCOM0_TWIS 1 // TWI follower mode implemented? +#define SERCOM0_TWIS_AUTO_ACK 1 // TWI follower automatic acknowledge implemented? +#define SERCOM0_TWIS_GROUP_CMD 1 // TWI follower group command implemented? #define SERCOM0_TWIS_SDASETUP_CNT_SIZE 8 // TWIS sda setup count size #define SERCOM0_TWIS_SDASETUP_SIZE 4 // TWIS sda setup size -#define SERCOM0_TWIS_SUDAT 1 // TWI slave SDA setup implemented? +#define SERCOM0_TWIS_SUDAT 1 // TWI follower SDA setup implemented? #define SERCOM0_TWI_FASTMP 1 // TWI fast mode plus implemented? #define SERCOM0_TWI_HSMODE 1 // USART mode implemented? #define SERCOM0_TWI_SCLSM_MODE 1 // TWI SCL clock stretch mode implemented? diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom1.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom1.h index ebf29a0fa626..d42795cbd647 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom1.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom1.h @@ -155,12 +155,12 @@ #define SERCOM1_SPI_WAKE_ON_SSL 1 // _SS low detect implemented? #define SERCOM1_TTBIT_EXTENSION 1 // 32-bit extension implemented? #define SERCOM1_TWIM 1 // TWI Master mode implemented? -#define SERCOM1_TWIS 1 // TWI Slave mode implemented? -#define SERCOM1_TWIS_AUTO_ACK 1 // TWI slave automatic acknowledge implemented? -#define SERCOM1_TWIS_GROUP_CMD 1 // TWI slave group command implemented? +#define SERCOM1_TWIS 1 // TWI follower mode implemented? +#define SERCOM1_TWIS_AUTO_ACK 1 // TWI follower automatic acknowledge implemented? +#define SERCOM1_TWIS_GROUP_CMD 1 // TWI follower group command implemented? #define SERCOM1_TWIS_SDASETUP_CNT_SIZE 8 // TWIS sda setup count size #define SERCOM1_TWIS_SDASETUP_SIZE 4 // TWIS sda setup size -#define SERCOM1_TWIS_SUDAT 1 // TWI slave SDA setup implemented? +#define SERCOM1_TWIS_SUDAT 1 // TWI follower SDA setup implemented? #define SERCOM1_TWI_FASTMP 1 // TWI fast mode plus implemented? #define SERCOM1_TWI_HSMODE 1 // USART mode implemented? #define SERCOM1_TWI_SCLSM_MODE 1 // TWI SCL clock stretch mode implemented? diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom2.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom2.h index 674e63b70095..bb47e7036023 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom2.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom2.h @@ -155,12 +155,12 @@ #define SERCOM2_SPI_WAKE_ON_SSL 1 // _SS low detect implemented? #define SERCOM2_TTBIT_EXTENSION 1 // 32-bit extension implemented? #define SERCOM2_TWIM 1 // TWI Master mode implemented? -#define SERCOM2_TWIS 1 // TWI Slave mode implemented? -#define SERCOM2_TWIS_AUTO_ACK 1 // TWI slave automatic acknowledge implemented? -#define SERCOM2_TWIS_GROUP_CMD 1 // TWI slave group command implemented? +#define SERCOM2_TWIS 1 // TWI follower mode implemented? +#define SERCOM2_TWIS_AUTO_ACK 1 // TWI follower automatic acknowledge implemented? +#define SERCOM2_TWIS_GROUP_CMD 1 // TWI follower group command implemented? #define SERCOM2_TWIS_SDASETUP_CNT_SIZE 8 // TWIS sda setup count size #define SERCOM2_TWIS_SDASETUP_SIZE 4 // TWIS sda setup size -#define SERCOM2_TWIS_SUDAT 1 // TWI slave SDA setup implemented? +#define SERCOM2_TWIS_SUDAT 1 // TWI follower SDA setup implemented? #define SERCOM2_TWI_FASTMP 1 // TWI fast mode plus implemented? #define SERCOM2_TWI_HSMODE 1 // USART mode implemented? #define SERCOM2_TWI_SCLSM_MODE 1 // TWI SCL clock stretch mode implemented? diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom3.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom3.h index 9edd4e92425d..35c2413f35ef 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom3.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom3.h @@ -155,12 +155,12 @@ #define SERCOM3_SPI_WAKE_ON_SSL 1 // _SS low detect implemented? #define SERCOM3_TTBIT_EXTENSION 1 // 32-bit extension implemented? #define SERCOM3_TWIM 1 // TWI Master mode implemented? -#define SERCOM3_TWIS 1 // TWI Slave mode implemented? -#define SERCOM3_TWIS_AUTO_ACK 1 // TWI slave automatic acknowledge implemented? -#define SERCOM3_TWIS_GROUP_CMD 1 // TWI slave group command implemented? +#define SERCOM3_TWIS 1 // TWI follower mode implemented? +#define SERCOM3_TWIS_AUTO_ACK 1 // TWI follower automatic acknowledge implemented? +#define SERCOM3_TWIS_GROUP_CMD 1 // TWI follower group command implemented? #define SERCOM3_TWIS_SDASETUP_CNT_SIZE 8 // TWIS sda setup count size #define SERCOM3_TWIS_SDASETUP_SIZE 4 // TWIS sda setup size -#define SERCOM3_TWIS_SUDAT 1 // TWI slave SDA setup implemented? +#define SERCOM3_TWIS_SUDAT 1 // TWI follower SDA setup implemented? #define SERCOM3_TWI_FASTMP 1 // TWI fast mode plus implemented? #define SERCOM3_TWI_HSMODE 1 // USART mode implemented? #define SERCOM3_TWI_SCLSM_MODE 1 // TWI SCL clock stretch mode implemented? diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom4.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom4.h index 20665abba041..c068c9406f53 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom4.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom4.h @@ -155,12 +155,12 @@ #define SERCOM4_SPI_WAKE_ON_SSL 1 // _SS low detect implemented? #define SERCOM4_TTBIT_EXTENSION 1 // 32-bit extension implemented? #define SERCOM4_TWIM 1 // TWI Master mode implemented? -#define SERCOM4_TWIS 1 // TWI Slave mode implemented? -#define SERCOM4_TWIS_AUTO_ACK 1 // TWI slave automatic acknowledge implemented? -#define SERCOM4_TWIS_GROUP_CMD 1 // TWI slave group command implemented? +#define SERCOM4_TWIS 1 // TWI follower mode implemented? +#define SERCOM4_TWIS_AUTO_ACK 1 // TWI follower automatic acknowledge implemented? +#define SERCOM4_TWIS_GROUP_CMD 1 // TWI follower group command implemented? #define SERCOM4_TWIS_SDASETUP_CNT_SIZE 8 // TWIS sda setup count size #define SERCOM4_TWIS_SDASETUP_SIZE 4 // TWIS sda setup size -#define SERCOM4_TWIS_SUDAT 1 // TWI slave SDA setup implemented? +#define SERCOM4_TWIS_SUDAT 1 // TWI follower SDA setup implemented? #define SERCOM4_TWI_FASTMP 1 // TWI fast mode plus implemented? #define SERCOM4_TWI_HSMODE 1 // USART mode implemented? #define SERCOM4_TWI_SCLSM_MODE 1 // TWI SCL clock stretch mode implemented? diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom5.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom5.h index 7705b5f5ca58..971e7ff74131 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom5.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom5.h @@ -155,12 +155,12 @@ #define SERCOM5_SPI_WAKE_ON_SSL 1 // _SS low detect implemented? #define SERCOM5_TTBIT_EXTENSION 1 // 32-bit extension implemented? #define SERCOM5_TWIM 1 // TWI Master mode implemented? -#define SERCOM5_TWIS 1 // TWI Slave mode implemented? -#define SERCOM5_TWIS_AUTO_ACK 1 // TWI slave automatic acknowledge implemented? -#define SERCOM5_TWIS_GROUP_CMD 1 // TWI slave group command implemented? +#define SERCOM5_TWIS 1 // TWI follower mode implemented? +#define SERCOM5_TWIS_AUTO_ACK 1 // TWI follower automatic acknowledge implemented? +#define SERCOM5_TWIS_GROUP_CMD 1 // TWI follower group command implemented? #define SERCOM5_TWIS_SDASETUP_CNT_SIZE 8 // TWIS sda setup count size #define SERCOM5_TWIS_SDASETUP_SIZE 4 // TWIS sda setup size -#define SERCOM5_TWIS_SUDAT 1 // TWI slave SDA setup implemented? +#define SERCOM5_TWIS_SUDAT 1 // TWI follower SDA setup implemented? #define SERCOM5_TWI_FASTMP 1 // TWI fast mode plus implemented? #define SERCOM5_TWI_HSMODE 1 // USART mode implemented? #define SERCOM5_TWI_SCLSM_MODE 1 // TWI SCL clock stretch mode implemented? diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom6.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom6.h index 0d86569e8694..2d2393137f64 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom6.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom6.h @@ -155,12 +155,12 @@ #define SERCOM6_SPI_WAKE_ON_SSL 1 // _SS low detect implemented? #define SERCOM6_TTBIT_EXTENSION 1 // 32-bit extension implemented? #define SERCOM6_TWIM 1 // TWI Master mode implemented? -#define SERCOM6_TWIS 1 // TWI Slave mode implemented? -#define SERCOM6_TWIS_AUTO_ACK 1 // TWI slave automatic acknowledge implemented? -#define SERCOM6_TWIS_GROUP_CMD 1 // TWI slave group command implemented? +#define SERCOM6_TWIS 1 // TWI follower mode implemented? +#define SERCOM6_TWIS_AUTO_ACK 1 // TWI follower automatic acknowledge implemented? +#define SERCOM6_TWIS_GROUP_CMD 1 // TWI follower group command implemented? #define SERCOM6_TWIS_SDASETUP_CNT_SIZE 8 // TWIS sda setup count size #define SERCOM6_TWIS_SDASETUP_SIZE 4 // TWIS sda setup size -#define SERCOM6_TWIS_SUDAT 1 // TWI slave SDA setup implemented? +#define SERCOM6_TWIS_SUDAT 1 // TWI follower SDA setup implemented? #define SERCOM6_TWI_FASTMP 1 // TWI fast mode plus implemented? #define SERCOM6_TWI_HSMODE 1 // USART mode implemented? #define SERCOM6_TWI_SCLSM_MODE 1 // TWI SCL clock stretch mode implemented? diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom7.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom7.h index 22bccde20d50..a43f29188d85 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom7.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom7.h @@ -155,12 +155,12 @@ #define SERCOM7_SPI_WAKE_ON_SSL 1 // _SS low detect implemented? #define SERCOM7_TTBIT_EXTENSION 1 // 32-bit extension implemented? #define SERCOM7_TWIM 1 // TWI Master mode implemented? -#define SERCOM7_TWIS 1 // TWI Slave mode implemented? -#define SERCOM7_TWIS_AUTO_ACK 1 // TWI slave automatic acknowledge implemented? -#define SERCOM7_TWIS_GROUP_CMD 1 // TWI slave group command implemented? +#define SERCOM7_TWIS 1 // TWI follower mode implemented? +#define SERCOM7_TWIS_AUTO_ACK 1 // TWI follower automatic acknowledge implemented? +#define SERCOM7_TWIS_GROUP_CMD 1 // TWI follower group command implemented? #define SERCOM7_TWIS_SDASETUP_CNT_SIZE 8 // TWIS sda setup count size #define SERCOM7_TWIS_SDASETUP_SIZE 4 // TWIS sda setup size -#define SERCOM7_TWIS_SUDAT 1 // TWI slave SDA setup implemented? +#define SERCOM7_TWIS_SUDAT 1 // TWI follower SDA setup implemented? #define SERCOM7_TWI_FASTMP 1 // TWI fast mode plus implemented? #define SERCOM7_TWI_HSMODE 1 // USART mode implemented? #define SERCOM7_TWI_SCLSM_MODE 1 // TWI SCL clock stretch mode implemented? diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc0.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc0.h index 7b3d2b85944c..148173df9852 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc0.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc0.h @@ -103,7 +103,7 @@ #define TC0_DMAC_ID_OVF 44 // Indexes of DMA Overflow trigger #define TC0_EXT 0 // Coding of implemented extended features (keep 0 value) #define TC0_GCLK_ID 9 // Index of Generic Clock -#define TC0_MASTER_SLAVE_MODE 1 // TC type 0 : NA, 1 : Master, 2 : Slave +#define TC0_MASTER_follower_MODE 1 // TC type 0 : NA, 1 : Master, 2 : follower #define TC0_OW_NUM 2 // Number of Output Waveforms #endif /* _SAMD51_TC0_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc1.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc1.h index 544a7055aea5..bf5550af8514 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc1.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc1.h @@ -103,7 +103,7 @@ #define TC1_DMAC_ID_OVF 47 // Indexes of DMA Overflow trigger #define TC1_EXT 0 // Coding of implemented extended features (keep 0 value) #define TC1_GCLK_ID 9 // Index of Generic Clock -#define TC1_MASTER_SLAVE_MODE 2 // TC type 0 : NA, 1 : Master, 2 : Slave +#define TC1_MASTER_follower_MODE 2 // TC type 0 : NA, 1 : Master, 2 : follower #define TC1_OW_NUM 2 // Number of Output Waveforms #endif /* _SAMD51_TC1_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc2.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc2.h index 2578fbfdb2d3..200feca525eb 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc2.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc2.h @@ -103,7 +103,7 @@ #define TC2_DMAC_ID_OVF 50 // Indexes of DMA Overflow trigger #define TC2_EXT 0 // Coding of implemented extended features (keep 0 value) #define TC2_GCLK_ID 26 // Index of Generic Clock -#define TC2_MASTER_SLAVE_MODE 1 // TC type 0 : NA, 1 : Master, 2 : Slave +#define TC2_MASTER_follower_MODE 1 // TC type 0 : NA, 1 : Master, 2 : follower #define TC2_OW_NUM 2 // Number of Output Waveforms #endif /* _SAMD51_TC2_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc3.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc3.h index 6ef2009d5d48..32071b7cd60b 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc3.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc3.h @@ -103,7 +103,7 @@ #define TC3_DMAC_ID_OVF 53 // Indexes of DMA Overflow trigger #define TC3_EXT 0 // Coding of implemented extended features (keep 0 value) #define TC3_GCLK_ID 26 // Index of Generic Clock -#define TC3_MASTER_SLAVE_MODE 2 // TC type 0 : NA, 1 : Master, 2 : Slave +#define TC3_MASTER_follower_MODE 2 // TC type 0 : NA, 1 : Master, 2 : follower #define TC3_OW_NUM 2 // Number of Output Waveforms #endif /* _SAMD51_TC3_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc4.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc4.h index 392bc74abd85..8b13a9081580 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc4.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc4.h @@ -103,7 +103,7 @@ #define TC4_DMAC_ID_OVF 56 // Indexes of DMA Overflow trigger #define TC4_EXT 0 // Coding of implemented extended features (keep 0 value) #define TC4_GCLK_ID 30 // Index of Generic Clock -#define TC4_MASTER_SLAVE_MODE 1 // TC type 0 : NA, 1 : Master, 2 : Slave +#define TC4_MASTER_follower_MODE 1 // TC type 0 : NA, 1 : Master, 2 : follower #define TC4_OW_NUM 2 // Number of Output Waveforms #endif /* _SAMD51_TC4_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc5.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc5.h index 7e28247abbea..d308a040cc37 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc5.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc5.h @@ -103,7 +103,7 @@ #define TC5_DMAC_ID_OVF 59 // Indexes of DMA Overflow trigger #define TC5_EXT 0 // Coding of implemented extended features (keep 0 value) #define TC5_GCLK_ID 30 // Index of Generic Clock -#define TC5_MASTER_SLAVE_MODE 2 // TC type 0 : NA, 1 : Master, 2 : Slave +#define TC5_MASTER_follower_MODE 2 // TC type 0 : NA, 1 : Master, 2 : follower #define TC5_OW_NUM 2 // Number of Output Waveforms #endif /* _SAMD51_TC5_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc6.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc6.h index df6718fc8227..e8d35138c4ff 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc6.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc6.h @@ -103,7 +103,7 @@ #define TC6_DMAC_ID_OVF 62 // Indexes of DMA Overflow trigger #define TC6_EXT 0 // Coding of implemented extended features (keep 0 value) #define TC6_GCLK_ID 39 // Index of Generic Clock -#define TC6_MASTER_SLAVE_MODE 1 // TC type 0 : NA, 1 : Master, 2 : Slave +#define TC6_MASTER_follower_MODE 1 // TC type 0 : NA, 1 : Master, 2 : follower #define TC6_OW_NUM 2 // Number of Output Waveforms #endif /* _SAMD51_TC6_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc7.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc7.h index 3de53eeb5dcb..e50ff62bf581 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc7.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc7.h @@ -103,7 +103,7 @@ #define TC7_DMAC_ID_OVF 65 // Indexes of DMA Overflow trigger #define TC7_EXT 0 // Coding of implemented extended features (keep 0 value) #define TC7_GCLK_ID 39 // Index of Generic Clock -#define TC7_MASTER_SLAVE_MODE 2 // TC type 0 : NA, 1 : Master, 2 : Slave +#define TC7_MASTER_follower_MODE 2 // TC type 0 : NA, 1 : Master, 2 : follower #define TC7_OW_NUM 2 // Number of Output Waveforms #endif /* _SAMD51_TC7_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc0.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc0.h index edcfc368ebba..c0b7bc1200a5 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc0.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc0.h @@ -115,7 +115,7 @@ #define TCC0_DTI 1 // Dead-Time-Insertion feature implemented #define TCC0_EXT 31 // Coding of implemented extended features #define TCC0_GCLK_ID 25 // Index of Generic Clock -#define TCC0_MASTER_SLAVE_MODE 1 // TCC type 0 : NA, 1 : Master, 2 : Slave +#define TCC0_MASTER_follower_MODE 1 // TCC type 0 : NA, 1 : Master, 2 : follower #define TCC0_OTMX 1 // Output Matrix feature implemented #define TCC0_OW_NUM 8 // Number of Output Waveforms #define TCC0_PG 1 // Pattern Generation feature implemented diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc1.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc1.h index 0c9ce3e8818c..48561f5422e3 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc1.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc1.h @@ -105,7 +105,7 @@ #define TCC1_DTI 1 // Dead-Time-Insertion feature implemented #define TCC1_EXT 31 // Coding of implemented extended features #define TCC1_GCLK_ID 25 // Index of Generic Clock -#define TCC1_MASTER_SLAVE_MODE 2 // TCC type 0 : NA, 1 : Master, 2 : Slave +#define TCC1_MASTER_follower_MODE 2 // TCC type 0 : NA, 1 : Master, 2 : follower #define TCC1_OTMX 1 // Output Matrix feature implemented #define TCC1_OW_NUM 8 // Number of Output Waveforms #define TCC1_PG 1 // Pattern Generation feature implemented diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc2.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc2.h index 31f86e2de52a..37fd3c125f14 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc2.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc2.h @@ -96,7 +96,7 @@ #define TCC2_DTI 0 // Dead-Time-Insertion feature implemented #define TCC2_EXT 1 // Coding of implemented extended features #define TCC2_GCLK_ID 29 // Index of Generic Clock -#define TCC2_MASTER_SLAVE_MODE 0 // TCC type 0 : NA, 1 : Master, 2 : Slave +#define TCC2_MASTER_follower_MODE 0 // TCC type 0 : NA, 1 : Master, 2 : follower #define TCC2_OTMX 1 // Output Matrix feature implemented #define TCC2_OW_NUM 3 // Number of Output Waveforms #define TCC2_PG 0 // Pattern Generation feature implemented diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc3.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc3.h index f492436f65ad..2e8fbbd6332f 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc3.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc3.h @@ -89,7 +89,7 @@ #define TCC3_DTI 0 // Dead-Time-Insertion feature implemented #define TCC3_EXT 0 // Coding of implemented extended features #define TCC3_GCLK_ID 29 // Index of Generic Clock -#define TCC3_MASTER_SLAVE_MODE 0 // TCC type 0 : NA, 1 : Master, 2 : Slave +#define TCC3_MASTER_follower_MODE 0 // TCC type 0 : NA, 1 : Master, 2 : follower #define TCC3_OTMX 0 // Output Matrix feature implemented #define TCC3_OW_NUM 2 // Number of Output Waveforms #define TCC3_PG 0 // Pattern Generation feature implemented diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc4.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc4.h index 84d55b8c90a2..8f0d7fcc4cda 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc4.h +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc4.h @@ -89,7 +89,7 @@ #define TCC4_DTI 0 // Dead-Time-Insertion feature implemented #define TCC4_EXT 0 // Coding of implemented extended features #define TCC4_GCLK_ID 38 // Index of Generic Clock -#define TCC4_MASTER_SLAVE_MODE 0 // TCC type 0 : NA, 1 : Master, 2 : Slave +#define TCC4_MASTER_follower_MODE 0 // TCC type 0 : NA, 1 : Master, 2 : follower #define TCC4_OTMX 0 // Output Matrix feature implemented #define TCC4_OW_NUM 2 // Number of Output Waveforms #define TCC4_PG 0 // Pattern Generation feature implemented diff --git a/quantum/encoder.c b/quantum/encoder.c index 81ec1bb376c8..5373f4fe1bfd 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -111,12 +111,12 @@ void encoder_read(void) { } #ifdef SPLIT_KEYBOARD -void encoder_state_raw(uint8_t* slave_state) { memcpy(slave_state, &encoder_value[thisHand], sizeof(uint8_t) * NUMBER_OF_ENCODERS); } +void encoder_state_raw(uint8_t* follower_state) { memcpy(follower_state, &encoder_value[thisHand], sizeof(uint8_t) * NUMBER_OF_ENCODERS); } -void encoder_update_raw(uint8_t* slave_state) { +void encoder_update_raw(uint8_t* follower_state) { for (uint8_t i = 0; i < NUMBER_OF_ENCODERS; i++) { uint8_t index = i + thatHand; - int8_t delta = slave_state[i] - encoder_value[index]; + int8_t delta = follower_state[i] - encoder_value[index]; while (delta > 0) { delta--; encoder_value[index]++; diff --git a/quantum/encoder.h b/quantum/encoder.h index ec09a8cc475a..912cfeb3194f 100644 --- a/quantum/encoder.h +++ b/quantum/encoder.h @@ -26,6 +26,6 @@ void encoder_update_kb(int8_t index, bool clockwise); void encoder_update_user(int8_t index, bool clockwise); #ifdef SPLIT_KEYBOARD -void encoder_state_raw(uint8_t* slave_state); -void encoder_update_raw(uint8_t* slave_state); +void encoder_state_raw(uint8_t* follower_state); +void encoder_update_raw(uint8_t* follower_state); #endif diff --git a/quantum/rgblight.c b/quantum/rgblight.c index d33484ccfdf2..af05c996ab94 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -608,11 +608,11 @@ void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, #ifndef RGBLIGHT_SPLIT void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb_range(r, g, b, 0, (uint8_t)RGBLED_NUM / 2); } -void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb_range(r, g, b, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } +void rgblight_setrgb_follower(uint8_t r, uint8_t g, uint8_t b) { rgblight_setrgb_range(r, g, b, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, 0, (uint8_t)RGBLED_NUM / 2); } -void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } +void rgblight_sethsv_follower(uint8_t hue, uint8_t sat, uint8_t val) { rgblight_sethsv_range(hue, sat, val, (uint8_t)RGBLED_NUM / 2, (uint8_t)RGBLED_NUM); } #endif // ifndef RGBLIGHT_SPLIT #ifdef RGBLIGHT_LAYERS @@ -756,7 +756,7 @@ void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo) { syncinfo->status = rgblight_status; } -/* for split keyboard slave side */ +/* for split keyboard follower side */ void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom) { # ifdef RGBLIGHT_LAYERS if (syncinfo->status.change_flags & RGBLIGHT_STATUS_CHANGE_LAYERS) { @@ -942,7 +942,7 @@ void rgblight_task(void) { tick_flag = false; if (timer_elapsed(report_last_timer) >= 30000) { report_last_timer = timer_read(); - dprintf("rgblight animation tick report to slave\n"); + dprintf("rgblight animation tick report to follower\n"); RGBLIGHT_SPLIT_ANIMATION_TICK; } } diff --git a/quantum/rgblight.h b/quantum/rgblight.h index c36b328a35f8..4f8d1a819c05 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -299,9 +299,9 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); # ifndef RGBLIGHT_SPLIT void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b); -void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b); +void rgblight_setrgb_follower(uint8_t r, uint8_t g, uint8_t b); void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val); -void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val); +void rgblight_sethsv_follower(uint8_t hue, uint8_t sat, uint8_t val); # endif /* effect mode change */ @@ -402,7 +402,7 @@ typedef struct _rgblight_syncinfo_t { uint8_t rgblight_get_change_flags(void); void rgblight_clear_change_flags(void); void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo); -/* for split keyboard slave side */ +/* for split keyboard follower side */ void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom); # endif diff --git a/quantum/serial_link/protocol/transport.c b/quantum/serial_link/protocol/transport.c index 73b8dc62e9e6..99bfd85f201b 100644 --- a/quantum/serial_link/protocol/transport.c +++ b/quantum/serial_link/protocol/transport.c @@ -38,16 +38,16 @@ void add_remote_objects(remote_object_t** _remote_objects, uint32_t _num_remote_ for (i = 0; i < _num_remote_objects; i++) { remote_object_t* obj = _remote_objects[i]; remote_objects[num_remote_objects++] = obj; - if (obj->object_type == MASTER_TO_ALL_SLAVES) { + if (obj->object_type == MASTER_TO_ALL_followerS) { triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; triple_buffer_init(tb); uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); tb = (triple_buffer_object_t*)start; triple_buffer_init(tb); - } else if (obj->object_type == MASTER_TO_SINGLE_SLAVE) { + } else if (obj->object_type == MASTER_TO_SINGLE_follower) { uint8_t* start = obj->buffer; unsigned int j; - for (j = 0; j < NUM_SLAVES; j++) { + for (j = 0; j < NUM_followerS; j++) { triple_buffer_object_t* tb = (triple_buffer_object_t*)start; triple_buffer_init(tb); start += LOCAL_OBJECT_SIZE(obj->object_size); @@ -60,7 +60,7 @@ void add_remote_objects(remote_object_t** _remote_objects, uint32_t _num_remote_ triple_buffer_init(tb); start += LOCAL_OBJECT_SIZE(obj->object_size); unsigned int j; - for (j = 0; j < NUM_SLAVES; j++) { + for (j = 0; j < NUM_followerS; j++) { tb = (triple_buffer_object_t*)start; triple_buffer_init(tb); start += REMOTE_OBJECT_SIZE(obj->object_size); @@ -75,13 +75,13 @@ void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { remote_object_t* obj = remote_objects[id]; if (obj->object_size == size - 1) { uint8_t* start; - if (obj->object_type == MASTER_TO_ALL_SLAVES) { + if (obj->object_type == MASTER_TO_ALL_followerS) { start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); - } else if (obj->object_type == SLAVE_TO_MASTER) { + } else if (obj->object_type == follower_TO_MASTER) { start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); start += (from - 1) * REMOTE_OBJECT_SIZE(obj->object_size); } else { - start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size); + start = obj->buffer + NUM_followerS * LOCAL_OBJECT_SIZE(obj->object_size); } triple_buffer_object_t* tb = (triple_buffer_object_t*)start; void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); @@ -95,18 +95,18 @@ void update_transport(void) { unsigned int i; for (i = 0; i < num_remote_objects; i++) { remote_object_t* obj = remote_objects[i]; - if (obj->object_type == MASTER_TO_ALL_SLAVES || obj->object_type == SLAVE_TO_MASTER) { + if (obj->object_type == MASTER_TO_ALL_followerS || obj->object_type == follower_TO_MASTER) { triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; uint8_t* ptr = (uint8_t*)triple_buffer_read_internal(obj->object_size + LOCAL_OBJECT_EXTRA, tb); if (ptr) { ptr[obj->object_size] = i; - uint8_t dest = obj->object_type == MASTER_TO_ALL_SLAVES ? 0xFF : 0; + uint8_t dest = obj->object_type == MASTER_TO_ALL_followerS ? 0xFF : 0; router_send_frame(dest, ptr, obj->object_size + 1); } } else { uint8_t* start = obj->buffer; unsigned int j; - for (j = 0; j < NUM_SLAVES; j++) { + for (j = 0; j < NUM_followerS; j++) { triple_buffer_object_t* tb = (triple_buffer_object_t*)start; uint8_t* ptr = (uint8_t*)triple_buffer_read_internal(obj->object_size + LOCAL_OBJECT_EXTRA, tb); if (ptr) { diff --git a/quantum/serial_link/protocol/transport.h b/quantum/serial_link/protocol/transport.h index 309a56b000a2..245674cfe3cd 100644 --- a/quantum/serial_link/protocol/transport.h +++ b/quantum/serial_link/protocol/transport.h @@ -28,16 +28,16 @@ SOFTWARE. #include "serial_link/protocol/triple_buffered_object.h" #include "serial_link/system/serial_link.h" -#define NUM_SLAVES 8 +#define NUM_followerS 8 #define LOCAL_OBJECT_EXTRA 16 -// master -> slave = 1 local(target all), 1 remote object -// slave -> master = 1 local(target 0), multiple remote objects -// master -> single slave (multiple local, target id), 1 remote object +// master -> follower = 1 local(target all), 1 remote object +// follower -> master = 1 local(target 0), multiple remote objects +// master -> single follower (multiple local, target id), 1 remote object typedef enum { - MASTER_TO_ALL_SLAVES, - MASTER_TO_SINGLE_SLAVE, - SLAVE_TO_MASTER, + MASTER_TO_ALL_followerS, + MASTER_TO_SINGLE_follower, + follower_TO_MASTER, } remote_object_type; typedef struct { @@ -55,10 +55,10 @@ typedef struct { uint8_t buffer[num_remote * REMOTE_OBJECT_SIZE(sizeof(type)) + num_local * LOCAL_OBJECT_SIZE(sizeof(type))]; \ } remote_object_##name##_t; -#define MASTER_TO_ALL_SLAVES_OBJECT(name, type) \ +#define MASTER_TO_ALL_followerS_OBJECT(name, type) \ REMOTE_OBJECT_HELPER(name, type, 1, 1) \ remote_object_##name##_t remote_object_##name = {.object = { \ - .object_type = MASTER_TO_ALL_SLAVES, \ + .object_type = MASTER_TO_ALL_followerS, \ .object_size = sizeof(type), \ }}; \ type* begin_write_##name(void) { \ @@ -79,38 +79,38 @@ typedef struct { return (type*)triple_buffer_read_internal(obj->object_size, tb); \ } -#define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ - REMOTE_OBJECT_HELPER(name, type, NUM_SLAVES, 1) \ +#define MASTER_TO_SINGLE_follower_OBJECT(name, type) \ + REMOTE_OBJECT_HELPER(name, type, NUM_followerS, 1) \ remote_object_##name##_t remote_object_##name = {.object = { \ - .object_type = MASTER_TO_SINGLE_SLAVE, \ + .object_type = MASTER_TO_SINGLE_follower, \ .object_size = sizeof(type), \ }}; \ - type* begin_write_##name(uint8_t slave) { \ + type* begin_write_##name(uint8_t follower) { \ remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ uint8_t* start = obj->buffer; \ - start += slave * LOCAL_OBJECT_SIZE(obj->object_size); \ + start += follower * LOCAL_OBJECT_SIZE(obj->object_size); \ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ } \ - void end_write_##name(uint8_t slave) { \ + void end_write_##name(uint8_t follower) { \ remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ uint8_t* start = obj->buffer; \ - start += slave * LOCAL_OBJECT_SIZE(obj->object_size); \ + start += follower * LOCAL_OBJECT_SIZE(obj->object_size); \ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ triple_buffer_end_write_internal(tb); \ signal_data_written(); \ } \ type* read_##name() { \ remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - uint8_t* start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size); \ + uint8_t* start = obj->buffer + NUM_followerS * LOCAL_OBJECT_SIZE(obj->object_size); \ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ return (type*)triple_buffer_read_internal(obj->object_size, tb); \ } -#define SLAVE_TO_MASTER_OBJECT(name, type) \ - REMOTE_OBJECT_HELPER(name, type, 1, NUM_SLAVES) \ +#define follower_TO_MASTER_OBJECT(name, type) \ + REMOTE_OBJECT_HELPER(name, type, 1, NUM_followerS) \ remote_object_##name##_t remote_object_##name = {.object = { \ - .object_type = SLAVE_TO_MASTER, \ + .object_type = follower_TO_MASTER, \ .object_size = sizeof(type), \ }}; \ type* begin_write_##name(void) { \ @@ -124,10 +124,10 @@ typedef struct { triple_buffer_end_write_internal(tb); \ signal_data_written(); \ } \ - type* read_##name(uint8_t slave) { \ + type* read_##name(uint8_t follower) { \ remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); \ - start += slave * REMOTE_OBJECT_SIZE(obj->object_size); \ + start += follower * REMOTE_OBJECT_SIZE(obj->object_size); \ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ return (type*)triple_buffer_read_internal(obj->object_size, tb); \ } diff --git a/quantum/serial_link/system/serial_link.c b/quantum/serial_link/system/serial_link.c index c59c06894423..d052d011ecc4 100644 --- a/quantum/serial_link/system/serial_link.c +++ b/quantum/serial_link/system/serial_link.c @@ -157,8 +157,8 @@ typedef struct { static matrix_object_t last_matrix = {}; -SLAVE_TO_MASTER_OBJECT(keyboard_matrix, matrix_object_t); -MASTER_TO_ALL_SLAVES_OBJECT(serial_link_connected, bool); +follower_TO_MASTER_OBJECT(keyboard_matrix, matrix_object_t); +MASTER_TO_ALL_followerS_OBJECT(serial_link_connected, bool); static remote_object_t* remote_objects[] = { REMOTE_OBJECT(serial_link_connected), diff --git a/quantum/serial_link/tests/transport_tests.cpp b/quantum/serial_link/tests/transport_tests.cpp index cfd11104609b..f73b4bc3c94a 100644 --- a/quantum/serial_link/tests/transport_tests.cpp +++ b/quantum/serial_link/tests/transport_tests.cpp @@ -42,14 +42,14 @@ struct test_object2 { uint32_t test2; }; -MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1); -MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1); -SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1); +MASTER_TO_ALL_followerS_OBJECT(master_to_follower, test_object1); +MASTER_TO_SINGLE_follower_OBJECT(master_to_single_follower, test_object1); +follower_TO_MASTER_OBJECT(follower_to_master, test_object1); static remote_object_t* test_remote_objects[] = { - REMOTE_OBJECT(master_to_slave), - REMOTE_OBJECT(master_to_single_slave), - REMOTE_OBJECT(slave_to_master), + REMOTE_OBJECT(master_to_follower), + REMOTE_OBJECT(master_to_single_follower), + REMOTE_OBJECT(follower_to_master), }; class Transport : public testing::Test { @@ -86,99 +86,99 @@ void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { Tran } TEST_F(Transport, write_to_local_signals_an_event) { - begin_write_master_to_slave(); + begin_write_master_to_follower(); EXPECT_CALL(*this, signal_data_written()); - end_write_master_to_slave(); - begin_write_slave_to_master(); + end_write_master_to_follower(); + begin_write_follower_to_master(); EXPECT_CALL(*this, signal_data_written()); - end_write_slave_to_master(); - begin_write_master_to_single_slave(1); + end_write_follower_to_master(); + begin_write_master_to_single_follower(1); EXPECT_CALL(*this, signal_data_written()); - end_write_master_to_single_slave(1); + end_write_master_to_single_follower(1); } -TEST_F(Transport, writes_from_master_to_all_slaves) { +TEST_F(Transport, writes_from_master_to_all_followers) { update_transport(); - test_object1* obj = begin_write_master_to_slave(); + test_object1* obj = begin_write_master_to_follower(); obj->test = 5; EXPECT_CALL(*this, signal_data_written()); - end_write_master_to_slave(); + end_write_master_to_follower(); EXPECT_CALL(*this, router_send_frame(0xFF)); update_transport(); transport_recv_frame(0, sent_data.data(), sent_data.size()); - test_object1* obj2 = read_master_to_slave(); + test_object1* obj2 = read_master_to_follower(); EXPECT_NE(obj2, nullptr); EXPECT_EQ(obj2->test, 5); } -TEST_F(Transport, writes_from_slave_to_master) { +TEST_F(Transport, writes_from_follower_to_master) { update_transport(); - test_object1* obj = begin_write_slave_to_master(); + test_object1* obj = begin_write_follower_to_master(); obj->test = 7; EXPECT_CALL(*this, signal_data_written()); - end_write_slave_to_master(); + end_write_follower_to_master(); EXPECT_CALL(*this, router_send_frame(0)); update_transport(); transport_recv_frame(3, sent_data.data(), sent_data.size()); - test_object1* obj2 = read_slave_to_master(2); - EXPECT_EQ(read_slave_to_master(0), nullptr); + test_object1* obj2 = read_follower_to_master(2); + EXPECT_EQ(read_follower_to_master(0), nullptr); EXPECT_NE(obj2, nullptr); EXPECT_EQ(obj2->test, 7); } -TEST_F(Transport, writes_from_master_to_single_slave) { +TEST_F(Transport, writes_from_master_to_single_follower) { update_transport(); - test_object1* obj = begin_write_master_to_single_slave(3); + test_object1* obj = begin_write_master_to_single_follower(3); obj->test = 7; EXPECT_CALL(*this, signal_data_written()); - end_write_master_to_single_slave(3); + end_write_master_to_single_follower(3); EXPECT_CALL(*this, router_send_frame(4)); update_transport(); transport_recv_frame(0, sent_data.data(), sent_data.size()); - test_object1* obj2 = read_master_to_single_slave(); + test_object1* obj2 = read_master_to_single_follower(); EXPECT_NE(obj2, nullptr); EXPECT_EQ(obj2->test, 7); } TEST_F(Transport, ignores_object_with_invalid_id) { update_transport(); - test_object1* obj = begin_write_master_to_single_slave(3); + test_object1* obj = begin_write_master_to_single_follower(3); obj->test = 7; EXPECT_CALL(*this, signal_data_written()); - end_write_master_to_single_slave(3); + end_write_master_to_single_follower(3); EXPECT_CALL(*this, router_send_frame(4)); update_transport(); sent_data[sent_data.size() - 1] = 44; transport_recv_frame(0, sent_data.data(), sent_data.size()); - test_object1* obj2 = read_master_to_single_slave(); + test_object1* obj2 = read_master_to_single_follower(); EXPECT_EQ(obj2, nullptr); } TEST_F(Transport, ignores_object_with_size_too_small) { update_transport(); - test_object1* obj = begin_write_master_to_slave(); + test_object1* obj = begin_write_master_to_follower(); obj->test = 7; EXPECT_CALL(*this, signal_data_written()); - end_write_master_to_slave(); + end_write_master_to_follower(); EXPECT_CALL(*this, router_send_frame(_)); update_transport(); sent_data[sent_data.size() - 2] = 0; transport_recv_frame(0, sent_data.data(), sent_data.size() - 1); - test_object1* obj2 = read_master_to_slave(); + test_object1* obj2 = read_master_to_follower(); EXPECT_EQ(obj2, nullptr); } TEST_F(Transport, ignores_object_with_size_too_big) { update_transport(); - test_object1* obj = begin_write_master_to_slave(); + test_object1* obj = begin_write_master_to_follower(); obj->test = 7; EXPECT_CALL(*this, signal_data_written()); - end_write_master_to_slave(); + end_write_master_to_follower(); EXPECT_CALL(*this, router_send_frame(_)); update_transport(); sent_data.resize(sent_data.size() + 22); sent_data[sent_data.size() - 1] = 0; transport_recv_frame(0, sent_data.data(), sent_data.size()); - test_object1* obj2 = read_master_to_slave(); + test_object1* obj2 = read_master_to_follower(); EXPECT_EQ(obj2, nullptr); } diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 5bad9db08f8a..6aef1f9be2d8 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -43,7 +43,7 @@ extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values uint8_t thisHand, thatHand; // user-defined overridable functions -__attribute__((weak)) void matrix_slave_scan_user(void) {} +__attribute__((weak)) void matrix_follower_scan_user(void) {} // matrix code @@ -259,9 +259,9 @@ void matrix_post_scan(void) { matrix_scan_quantum(); } else { - transport_slave(matrix + thisHand); + transport_follower(matrix + thisHand); - matrix_slave_scan_user(); + matrix_follower_scan_user(); } } diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index afcd9d2aa586..5bafcbfcf5dc 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -97,11 +97,11 @@ __attribute__((weak)) bool is_keyboard_left(void) { } __attribute__((weak)) bool is_keyboard_master(void) { - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; + static enum { UNKNOWN, MASTER, follower } usbstate = UNKNOWN; // only check once, as this is called often if (usbstate == UNKNOWN) { - usbstate = usbIsActive() ? MASTER : SLAVE; + usbstate = usbIsActive() ? MASTER : follower; } return (usbstate == MASTER); @@ -129,10 +129,10 @@ void split_pre_init(void) { } // this code runs after the keyboard is fully initialized -// - avoids race condition during matrix_init_quantum where slave can start +// - avoids race condition during matrix_init_quantum where follower can start // receiving before the init process has completed void split_post_init(void) { if (!is_keyboard_master()) { - transport_slave_init(); + transport_follower_init(); } } diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index 467ff81a97cf..f5526c21c53c 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -24,9 +24,9 @@ static pin_t encoders_pad[] = ENCODERS_PAD_A; #if defined(USE_I2C) # include "i2c_master.h" -# include "i2c_slave.h" +# include "i2c_follower.h" -typedef struct _I2C_slave_buffer_t { +typedef struct _I2C_follower_buffer_t { matrix_row_t smatrix[ROWS_PER_HAND]; uint8_t backlight_level; # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) @@ -38,31 +38,31 @@ typedef struct _I2C_slave_buffer_t { # ifdef WPM_ENABLE uint8_t current_wpm; # endif -} I2C_slave_buffer_t; +} I2C_follower_buffer_t; -static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg; +static I2C_follower_buffer_t *const i2c_buffer = (I2C_follower_buffer_t *)i2c_follower_reg; -# define I2C_BACKLIGHT_START offsetof(I2C_slave_buffer_t, backlight_level) -# define I2C_RGB_START offsetof(I2C_slave_buffer_t, rgblight_sync) -# define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, smatrix) -# define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state) -# define I2C_WPM_START offsetof(I2C_slave_buffer_t, current_wpm) +# define I2C_BACKLIGHT_START offsetof(I2C_follower_buffer_t, backlight_level) +# define I2C_RGB_START offsetof(I2C_follower_buffer_t, rgblight_sync) +# define I2C_KEYMAP_START offsetof(I2C_follower_buffer_t, smatrix) +# define I2C_ENCODER_START offsetof(I2C_follower_buffer_t, encoder_state) +# define I2C_WPM_START offsetof(I2C_follower_buffer_t, current_wpm) # define TIMEOUT 100 -# ifndef SLAVE_I2C_ADDRESS -# define SLAVE_I2C_ADDRESS 0x32 +# ifndef follower_I2C_ADDRESS +# define follower_I2C_ADDRESS 0x32 # endif // Get rows from other half over i2c bool transport_master(matrix_row_t matrix[]) { - i2c_readReg(SLAVE_I2C_ADDRESS, I2C_KEYMAP_START, (void *)matrix, sizeof(i2c_buffer->smatrix), TIMEOUT); + i2c_readReg(follower_I2C_ADDRESS, I2C_KEYMAP_START, (void *)matrix, sizeof(i2c_buffer->smatrix), TIMEOUT); // write backlight info # ifdef BACKLIGHT_ENABLE uint8_t level = is_backlight_enabled() ? get_backlight_level() : 0; if (level != i2c_buffer->backlight_level) { - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_BACKLIGHT_START, (void *)&level, sizeof(level), TIMEOUT) >= 0) { + if (i2c_writeReg(follower_I2C_ADDRESS, I2C_BACKLIGHT_START, (void *)&level, sizeof(level), TIMEOUT) >= 0) { i2c_buffer->backlight_level = level; } } @@ -72,21 +72,21 @@ bool transport_master(matrix_row_t matrix[]) { if (rgblight_get_change_flags()) { rgblight_syncinfo_t rgblight_sync; rgblight_get_syncinfo(&rgblight_sync); - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_RGB_START, (void *)&rgblight_sync, sizeof(rgblight_sync), TIMEOUT) >= 0) { + if (i2c_writeReg(follower_I2C_ADDRESS, I2C_RGB_START, (void *)&rgblight_sync, sizeof(rgblight_sync), TIMEOUT) >= 0) { rgblight_clear_change_flags(); } } # endif # ifdef ENCODER_ENABLE - i2c_readReg(SLAVE_I2C_ADDRESS, I2C_ENCODER_START, (void *)i2c_buffer->encoder_state, sizeof(i2c_buffer->encoder_state), TIMEOUT); + i2c_readReg(follower_I2C_ADDRESS, I2C_ENCODER_START, (void *)i2c_buffer->encoder_state, sizeof(i2c_buffer->encoder_state), TIMEOUT); encoder_update_raw(i2c_buffer->encoder_state); # endif # ifdef WPM_ENABLE uint8_t current_wpm = get_current_wpm(); if (current_wpm != i2c_buffer->current_wpm) { - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_WPM_START, (void *)¤t_wpm, sizeof(current_wpm), TIMEOUT) >= 0) { + if (i2c_writeReg(follower_I2C_ADDRESS, I2C_WPM_START, (void *)¤t_wpm, sizeof(current_wpm), TIMEOUT) >= 0) { i2c_buffer->current_wpm = current_wpm; } } @@ -94,7 +94,7 @@ bool transport_master(matrix_row_t matrix[]) { return true; } -void transport_slave(matrix_row_t matrix[]) { +void transport_follower(matrix_row_t matrix[]) { // Copy matrix to I2C buffer memcpy((void *)i2c_buffer->smatrix, (void *)matrix, sizeof(i2c_buffer->smatrix)); @@ -122,7 +122,7 @@ void transport_slave(matrix_row_t matrix[]) { void transport_master_init(void) { i2c_init(); } -void transport_slave_init(void) { i2c_slave_init(SLAVE_I2C_ADDRESS); } +void transport_follower_init(void) { i2c_follower_init(follower_I2C_ADDRESS); } #else // USE_SERIAL @@ -169,14 +169,14 @@ volatile Serial_m2s_buffer_t serial_m2s_buffer = {}; uint8_t volatile status0 = 0; enum serial_transaction_id { - GET_SLAVE_MATRIX = 0, + GET_follower_MATRIX = 0, # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) PUT_RGBLIGHT, # endif }; SSTD_t transactions[] = { - [GET_SLAVE_MATRIX] = + [GET_follower_MATRIX] = { (uint8_t *)&status0, sizeof(serial_m2s_buffer), @@ -187,14 +187,14 @@ SSTD_t transactions[] = { # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) [PUT_RGBLIGHT] = { - (uint8_t *)&status_rgblight, sizeof(serial_rgblight), (uint8_t *)&serial_rgblight, 0, NULL // no slave to master transfer + (uint8_t *)&status_rgblight, sizeof(serial_rgblight), (uint8_t *)&serial_rgblight, 0, NULL // no follower to master transfer }, # endif }; void transport_master_init(void) { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } -void transport_slave_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } +void transport_follower_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); } # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) @@ -209,7 +209,7 @@ void transport_rgblight_master(void) { } } -void transport_rgblight_slave(void) { +void transport_rgblight_follower(void) { if (status_rgblight == TRANSACTION_ACCEPTED) { rgblight_update_sync((rgblight_syncinfo_t *)&serial_rgblight.rgblight_sync, false); status_rgblight = TRANSACTION_END; @@ -218,7 +218,7 @@ void transport_rgblight_slave(void) { # else # define transport_rgblight_master() -# define transport_rgblight_slave() +# define transport_rgblight_follower() # endif bool transport_master(matrix_row_t matrix[]) { @@ -228,7 +228,7 @@ bool transport_master(matrix_row_t matrix[]) { } # else transport_rgblight_master(); - if (soft_serial_transaction(GET_SLAVE_MATRIX) != TRANSACTION_END) { + if (soft_serial_transaction(GET_follower_MATRIX) != TRANSACTION_END) { return false; } # endif @@ -239,7 +239,7 @@ bool transport_master(matrix_row_t matrix[]) { } # ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read + // Write backlight level for follower to read serial_m2s_buffer.backlight_level = is_backlight_enabled() ? get_backlight_level() : 0; # endif @@ -248,14 +248,14 @@ bool transport_master(matrix_row_t matrix[]) { # endif # ifdef WPM_ENABLE - // Write wpm to slave + // Write wpm to follower serial_m2s_buffer.current_wpm = get_current_wpm(); # endif return true; } -void transport_slave(matrix_row_t matrix[]) { - transport_rgblight_slave(); +void transport_follower(matrix_row_t matrix[]) { + transport_rgblight_follower(); // TODO: if MATRIX_COLS > 8 change to pack() for (int i = 0; i < ROWS_PER_HAND; ++i) { serial_s2m_buffer.smatrix[i] = matrix[i]; diff --git a/quantum/split_common/transport.h b/quantum/split_common/transport.h index ccce57e444d5..7c3774aa2515 100644 --- a/quantum/split_common/transport.h +++ b/quantum/split_common/transport.h @@ -3,8 +3,8 @@ #include void transport_master_init(void); -void transport_slave_init(void); +void transport_follower_init(void); -// returns false if valid data not received from slave +// returns false if valid data not received from follower bool transport_master(matrix_row_t matrix[]); -void transport_slave(matrix_row_t matrix[]); +void transport_follower(matrix_row_t matrix[]); diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c index 9e9cb6d41057..80ba6929669b 100644 --- a/quantum/visualizer/visualizer.c +++ b/quantum/visualizer/visualizer.c @@ -90,7 +90,7 @@ static uint8_t user_data[VISUALIZER_USER_DATA_SIZE]; static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {}; #ifdef SERIAL_LINK_ENABLE -MASTER_TO_ALL_SLAVES_OBJECT(current_status, visualizer_keyboard_status_t); +MASTER_TO_ALL_followerS_OBJECT(current_status, visualizer_keyboard_status_t); static remote_object_t* remote_objects[] = { REMOTE_OBJECT(current_status), diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 488d130decdb..4e65397e398e 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -135,7 +135,7 @@ void stop_keyframe_animation(keyframe_animation_t* animation); // Useful for crossfades for example void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state); -// The master can set userdata which will be transferred to the slave +// The master can set userdata which will be transferred to the follower #ifdef VISUALIZER_USER_DATA_SIZE void visualizer_set_user_data(void* user_data); #endif diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 714c3d048f07..0f51c122dcea 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -222,7 +222,7 @@ __attribute__((weak)) bool is_keyboard_master(void) { return true; } /** \brief should_process_keypress * * Override this function if you have a condition where keypresses processing should change: - * - splits where the slave side needs to process for rgb/oled functionality + * - splits where the follower side needs to process for rgb/oled functionality */ __attribute__((weak)) bool should_process_keypress(void) { return is_keyboard_master(); } diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h index 98ceca49b1a6..32845ad4cfa2 100644 --- a/tmk_core/common/keyboard.h +++ b/tmk_core/common/keyboard.h @@ -61,7 +61,7 @@ void keyboard_init(void); void keyboard_task(void); /* it runs when host LED status is updated */ void keyboard_set_leds(uint8_t leds); -/* it runs whenever code has to behave differently on a slave */ +/* it runs whenever code has to behave differently on a follower */ bool is_keyboard_master(void); void keyboard_pre_init_kb(void); diff --git a/tmk_core/protocol/arm_atsam/i2c_master.c b/tmk_core/protocol/arm_atsam/i2c_master.c index d3319ab447d2..a2c9054f9891 100644 --- a/tmk_core/protocol/arm_atsam/i2c_master.c +++ b/tmk_core/protocol/arm_atsam/i2c_master.c @@ -299,7 +299,7 @@ uint8_t I2C3733_Init_Drivers(void) { i2c_led_select_page(0, 3); i2c_led_send_mode_op_gcr(0, 0, ISSI3733_CR_SSD_NORMAL); // No SYNC due to brightness mismatch with second driver - // Set up slave device + // Set up follower device i2c_led_send_CRWL(1); i2c_led_select_page(1, 3); i2c_led_send_mode_op_gcr(1, 0, ISSI3733_CR_SSD_NORMAL); // No SYNC due to brightness mismatch with first driver and slight flicker at rgb values 1,2 diff --git a/tmk_core/protocol/arm_atsam/issi3733_driver.h b/tmk_core/protocol/arm_atsam/issi3733_driver.h index bd29fe76b6b5..7c1e37027b11 100644 --- a/tmk_core/protocol/arm_atsam/issi3733_driver.h +++ b/tmk_core/protocol/arm_atsam/issi3733_driver.h @@ -55,7 +55,7 @@ along with this program. If not, see . // PG3: Configuration Register: Synchronize Configuration #define ISSI3733_CR_SYNC_MASTER 0x40 // Master -#define ISSI3733_CR_SYNC_SLAVE 0x80 // Slave +#define ISSI3733_CR_SYNC_follower 0x80 // follower #define ISSI3733_CR_SYNC_HIGH_IMP 0xC0 // High Impedance // PG3: Configuration Register: Open/Short Detection Enable Bit diff --git a/tmk_core/protocol/arm_atsam/led_matrix.h b/tmk_core/protocol/arm_atsam/led_matrix.h index 8eaa5623bda5..6983eccb063f 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.h +++ b/tmk_core/protocol/arm_atsam/led_matrix.h @@ -43,7 +43,7 @@ along with this program. If not, see . #define ISSI3733_PG_FN_BYTES ISSI3733_PG3_BYTES typedef struct issi3733_driver_s { - uint8_t addr; // Address of the driver according to wiring "ISSI3733: Table 1 Slave Address" + uint8_t addr; // Address of the driver according to wiring "ISSI3733: Table 1 follower Address" uint8_t onoff[ISSI3733_PG_ONOFF_BYTES]; // PG0 - LED Control Register - LED On/Off Register uint8_t open[ISSI3733_PG_OR_BYTES]; // PG0 - LED Control Register - LED Open Register uint8_t shrt[ISSI3733_PG_SR_BYTES]; // PG0 - LED Control Register - LED Short Register diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h index 505db47b06cf..ade4d4f531fb 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h @@ -669,7 +669,7 @@ typedef struct { uint8_t bDescriptorType; uint8_t bDescriptorSubtype; uint8_t bMasterInterface; - uint8_t bSlaveInterface0; + uint8_t bfollowerInterface0; } usb_cdc_union_desc_t; typedef struct { @@ -733,7 +733,7 @@ typedef struct { .bDescriptorType = CDC_CS_INTERFACE, \ .bDescriptorSubtype = CDC_SCS_UNION, \ .bMasterInterface = CDC_STATUS_INTERFACE, \ - .bSlaveInterface0 = CDC_DATA_INTERFACE \ + .bfollowerInterface0 = CDC_DATA_INTERFACE \ }, \ .ep_c = { \ .bLength = sizeof(usb_ep_desc_t), \ diff --git a/tmk_core/protocol/lufa/adafruit_ble.cpp b/tmk_core/protocol/lufa/adafruit_ble.cpp index b07407f38775..b2b6ce06bdf2 100644 --- a/tmk_core/protocol/lufa/adafruit_ble.cpp +++ b/tmk_core/protocol/lufa/adafruit_ble.cpp @@ -118,8 +118,8 @@ enum sdep_type { SdepResponse = 0x20, SdepAlert = 0x40, SdepError = 0x80, - SdepSlaveNotReady = 0xfe, // Try again later - SdepSlaveOverflow = 0xff, // You read more data than is available + SdepfollowerNotReady = 0xfe, // Try again later + SdepfollowerOverflow = 0xff, // You read more data than is available }; enum ble_cmd { @@ -152,7 +152,7 @@ static bool sdep_send_pkt(const struct sdep_msg *msg, uint16_t timeout) { bool ready = false; do { - ready = spi_write(msg->type) != SdepSlaveNotReady; + ready = spi_write(msg->type) != SdepfollowerNotReady; if (ready) { break; } @@ -164,7 +164,7 @@ static bool sdep_send_pkt(const struct sdep_msg *msg, uint16_t timeout) { } while (timer_elapsed(timerStart) < timeout); if (ready) { - // Slave is ready; send the rest of the packet + // follower is ready; send the rest of the packet spi_transmit(&msg->cmd_low, sizeof(*msg) - (1 + sizeof(msg->payload)) + msg->len); success = true; } @@ -206,7 +206,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) { do { // Read the command type, waiting for the data to be ready msg->type = spi_read(); - if (msg->type == SdepSlaveNotReady || msg->type == SdepSlaveOverflow) { + if (msg->type == SdepfollowerNotReady || msg->type == SdepfollowerOverflow) { // Release it and let it initialize spi_stop(); wait_us(SdepBackOff); diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index 8c71dd1dda77..bcd20f58cc4c 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c @@ -767,7 +767,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { }, .Subtype = 0x06, .MasterInterfaceNumber = CCI_INTERFACE, - .SlaveInterfaceNumber = CDI_INTERFACE, + .followerInterfaceNumber = CDI_INTERFACE, }, .CDC_NotificationEndpoint = { .Header = { diff --git a/tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/CDC.cpp b/tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/CDC.cpp index 1ee3a488a5ed..fb54061b78ae 100644 --- a/tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/CDC.cpp +++ b/tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/CDC.cpp @@ -61,7 +61,7 @@ const CDCDescriptor _cdcInterface = D_CDCCS(CDC_HEADER,0x10,0x01), // Header (1.10 bcd) D_CDCCS(CDC_CALL_MANAGEMENT,1,1), // Device handles call management (not) D_CDCCS4(CDC_ABSTRACT_CONTROL_MANAGEMENT,6), // SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported - D_CDCCS(CDC_UNION,CDC_ACM_INTERFACE,CDC_DATA_INTERFACE), // Communication interface is master, data interface is slave 0 + D_CDCCS(CDC_UNION,CDC_ACM_INTERFACE,CDC_DATA_INTERFACE), // Communication interface is master, data interface is follower 0 D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_ACM),USB_ENDPOINT_TYPE_INTERRUPT,0x10,0x40), // CDC data interface