You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

589 lines
16 KiB

Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h
5 years ago
  1. /*
  2. * WARNING: be careful changing this code, it is very timing dependent
  3. *
  4. * 2018-10-28 checked
  5. * avr-gcc 4.9.2
  6. * avr-gcc 5.4.0
  7. * avr-gcc 7.3.0
  8. */
  9. #ifndef F_CPU
  10. #define F_CPU 16000000
  11. #endif
  12. #include <avr/io.h>
  13. #include <avr/interrupt.h>
  14. #include <util/delay.h>
  15. #include <stddef.h>
  16. #include <stdbool.h>
  17. #include "serial.h"
  18. #ifdef SOFT_SERIAL_PIN
  19. #ifdef __AVR_ATmega32U4__
  20. // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial.
  21. #ifdef USE_I2C
  22. #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1
  23. #error Using ATmega32U4 I2C, so can not use PD0, PD1
  24. #endif
  25. #endif
  26. #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3
  27. #define SERIAL_PIN_DDR DDRD
  28. #define SERIAL_PIN_PORT PORTD
  29. #define SERIAL_PIN_INPUT PIND
  30. #if SOFT_SERIAL_PIN == D0
  31. #define SERIAL_PIN_MASK _BV(PD0)
  32. #define EIMSK_BIT _BV(INT0)
  33. #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01)))
  34. #define SERIAL_PIN_INTERRUPT INT0_vect
  35. #elif SOFT_SERIAL_PIN == D1
  36. #define SERIAL_PIN_MASK _BV(PD1)
  37. #define EIMSK_BIT _BV(INT1)
  38. #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11)))
  39. #define SERIAL_PIN_INTERRUPT INT1_vect
  40. #elif SOFT_SERIAL_PIN == D2
  41. #define SERIAL_PIN_MASK _BV(PD2)
  42. #define EIMSK_BIT _BV(INT2)
  43. #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21)))
  44. #define SERIAL_PIN_INTERRUPT INT2_vect
  45. #elif SOFT_SERIAL_PIN == D3
  46. #define SERIAL_PIN_MASK _BV(PD3)
  47. #define EIMSK_BIT _BV(INT3)
  48. #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31)))
  49. #define SERIAL_PIN_INTERRUPT INT3_vect
  50. #endif
  51. #elif SOFT_SERIAL_PIN == E6
  52. #define SERIAL_PIN_DDR DDRE
  53. #define SERIAL_PIN_PORT PORTE
  54. #define SERIAL_PIN_INPUT PINE
  55. #define SERIAL_PIN_MASK _BV(PE6)
  56. #define EIMSK_BIT _BV(INT6)
  57. #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61)))
  58. #define SERIAL_PIN_INTERRUPT INT6_vect
  59. #else
  60. #error invalid SOFT_SERIAL_PIN value
  61. #endif
  62. #else
  63. #error serial.c now support ATmega32U4 only
  64. #endif
  65. //////////////// for backward compatibility ////////////////////////////////
  66. #if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION)
  67. /* --- USE OLD API (compatible with let's split serial.c) */
  68. #if SERIAL_SLAVE_BUFFER_LENGTH > 0
  69. uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
  70. #endif
  71. #if SERIAL_MASTER_BUFFER_LENGTH > 0
  72. uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
  73. #endif
  74. uint8_t volatile status0 = 0;
  75. SSTD_t transactions[] = {
  76. { (uint8_t *)&status0,
  77. #if SERIAL_MASTER_BUFFER_LENGTH > 0
  78. sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer,
  79. #else
  80. 0, (uint8_t *)NULL,
  81. #endif
  82. #if SERIAL_SLAVE_BUFFER_LENGTH > 0
  83. sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer
  84. #else
  85. 0, (uint8_t *)NULL,
  86. #endif
  87. }
  88. };
  89. void serial_master_init(void)
  90. { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); }
  91. void serial_slave_init(void)
  92. { soft_serial_target_init(transactions, TID_LIMIT(transactions)); }
  93. // 0 => no error
  94. // 1 => slave did not respond
  95. // 2 => checksum error
  96. int serial_update_buffers()
  97. {
  98. int result;
  99. result = soft_serial_transaction();
  100. return result;
  101. }
  102. #endif // end of OLD API (compatible with let's split serial.c)
  103. ////////////////////////////////////////////////////////////////////////////
  104. #define ALWAYS_INLINE __attribute__((always_inline))
  105. #define NO_INLINE __attribute__((noinline))
  106. #define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
  107. // parity check
  108. #define ODD_PARITY 1
  109. #define EVEN_PARITY 0
  110. #define PARITY EVEN_PARITY
  111. #ifdef SERIAL_DELAY
  112. // custom setup in config.h
  113. // #define TID_SEND_ADJUST 2
  114. // #define SERIAL_DELAY 6 // micro sec
  115. // #define READ_WRITE_START_ADJUST 30 // cycles
  116. // #define READ_WRITE_WIDTH_ADJUST 8 // cycles
  117. #else
  118. // ============ Standard setups ============
  119. #ifndef SELECT_SOFT_SERIAL_SPEED
  120. #define SELECT_SOFT_SERIAL_SPEED 1
  121. // 0: about 189kbps
  122. // 1: about 137kbps (default)
  123. // 2: about 75kbps
  124. // 3: about 39kbps
  125. // 4: about 26kbps
  126. // 5: about 20kbps
  127. #endif
  128. #if __GNUC__ < 6
  129. #define TID_SEND_ADJUST 14
  130. #else
  131. #define TID_SEND_ADJUST 2
  132. #endif
  133. #if SELECT_SOFT_SERIAL_SPEED == 0
  134. // Very High speed
  135. #define SERIAL_DELAY 4 // micro sec
  136. #if __GNUC__ < 6
  137. #define READ_WRITE_START_ADJUST 33 // cycles
  138. #define READ_WRITE_WIDTH_ADJUST 3 // cycles
  139. #else
  140. #define READ_WRITE_START_ADJUST 34 // cycles
  141. #define READ_WRITE_WIDTH_ADJUST 7 // cycles
  142. #endif
  143. #elif SELECT_SOFT_SERIAL_SPEED == 1
  144. // High speed
  145. #define SERIAL_DELAY 6 // micro sec
  146. #if __GNUC__ < 6
  147. #define READ_WRITE_START_ADJUST 30 // cycles
  148. #define READ_WRITE_WIDTH_ADJUST 3 // cycles
  149. #else
  150. #define READ_WRITE_START_ADJUST 33 // cycles
  151. #define READ_WRITE_WIDTH_ADJUST 7 // cycles
  152. #endif
  153. #elif SELECT_SOFT_SERIAL_SPEED == 2
  154. // Middle speed
  155. #define SERIAL_DELAY 12 // micro sec
  156. #define READ_WRITE_START_ADJUST 30 // cycles
  157. #if __GNUC__ < 6
  158. #define READ_WRITE_WIDTH_ADJUST 3 // cycles
  159. #else
  160. #define READ_WRITE_WIDTH_ADJUST 7 // cycles
  161. #endif
  162. #elif SELECT_SOFT_SERIAL_SPEED == 3
  163. // Low speed
  164. #define SERIAL_DELAY 24 // micro sec
  165. #define READ_WRITE_START_ADJUST 30 // cycles
  166. #if __GNUC__ < 6
  167. #define READ_WRITE_WIDTH_ADJUST 3 // cycles
  168. #else
  169. #define READ_WRITE_WIDTH_ADJUST 7 // cycles
  170. #endif
  171. #elif SELECT_SOFT_SERIAL_SPEED == 4
  172. // Very Low speed
  173. #define SERIAL_DELAY 36 // micro sec
  174. #define READ_WRITE_START_ADJUST 30 // cycles
  175. #if __GNUC__ < 6
  176. #define READ_WRITE_WIDTH_ADJUST 3 // cycles
  177. #else
  178. #define READ_WRITE_WIDTH_ADJUST 7 // cycles
  179. #endif
  180. #elif SELECT_SOFT_SERIAL_SPEED == 5
  181. // Ultra Low speed
  182. #define SERIAL_DELAY 48 // micro sec
  183. #define READ_WRITE_START_ADJUST 30 // cycles
  184. #if __GNUC__ < 6
  185. #define READ_WRITE_WIDTH_ADJUST 3 // cycles
  186. #else
  187. #define READ_WRITE_WIDTH_ADJUST 7 // cycles
  188. #endif
  189. #else
  190. #error invalid SELECT_SOFT_SERIAL_SPEED value
  191. #endif /* SELECT_SOFT_SERIAL_SPEED */
  192. #endif /* SERIAL_DELAY */
  193. #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2)
  194. #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2)
  195. #define SLAVE_INT_WIDTH_US 1
  196. #ifndef SERIAL_USE_MULTI_TRANSACTION
  197. #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY
  198. #else
  199. #define SLAVE_INT_ACK_WIDTH_UNIT 2
  200. #define SLAVE_INT_ACK_WIDTH 4
  201. #endif
  202. static SSTD_t *Transaction_table = NULL;
  203. static uint8_t Transaction_table_size = 0;
  204. inline static void serial_delay(void) ALWAYS_INLINE;
  205. inline static
  206. void serial_delay(void) {
  207. _delay_us(SERIAL_DELAY);
  208. }
  209. inline static void serial_delay_half1(void) ALWAYS_INLINE;
  210. inline static
  211. void serial_delay_half1(void) {
  212. _delay_us(SERIAL_DELAY_HALF1);
  213. }
  214. inline static void serial_delay_half2(void) ALWAYS_INLINE;
  215. inline static
  216. void serial_delay_half2(void) {
  217. _delay_us(SERIAL_DELAY_HALF2);
  218. }
  219. inline static void serial_output(void) ALWAYS_INLINE;
  220. inline static
  221. void serial_output(void) {
  222. SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
  223. }
  224. // make the serial pin an input with pull-up resistor
  225. inline static void serial_input_with_pullup(void) ALWAYS_INLINE;
  226. inline static
  227. void serial_input_with_pullup(void) {
  228. SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
  229. SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
  230. }
  231. inline static uint8_t serial_read_pin(void) ALWAYS_INLINE;
  232. inline static
  233. uint8_t serial_read_pin(void) {
  234. return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
  235. }
  236. inline static void serial_low(void) ALWAYS_INLINE;
  237. inline static
  238. void serial_low(void) {
  239. SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
  240. }
  241. inline static void serial_high(void) ALWAYS_INLINE;
  242. inline static
  243. void serial_high(void) {
  244. SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
  245. }
  246. void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size)
  247. {
  248. Transaction_table = sstd_table;
  249. Transaction_table_size = (uint8_t)sstd_table_size;
  250. serial_output();
  251. serial_high();
  252. }
  253. void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size)
  254. {
  255. Transaction_table = sstd_table;
  256. Transaction_table_size = (uint8_t)sstd_table_size;
  257. serial_input_with_pullup();
  258. // Enable INT0-INT3,INT6
  259. EIMSK |= EIMSK_BIT;
  260. #if SERIAL_PIN_MASK == _BV(PE6)
  261. // Trigger on falling edge of INT6
  262. EICRB &= EICRx_BIT;
  263. #else
  264. // Trigger on falling edge of INT0-INT3
  265. EICRA &= EICRx_BIT;
  266. #endif
  267. }
  268. // Used by the sender to synchronize timing with the reciver.
  269. static void sync_recv(void) NO_INLINE;
  270. static
  271. void sync_recv(void) {
  272. for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) {
  273. }
  274. // This shouldn't hang if the target disconnects because the
  275. // serial line will float to high if the target does disconnect.
  276. while (!serial_read_pin());
  277. }
  278. // Used by the reciver to send a synchronization signal to the sender.
  279. static void sync_send(void) NO_INLINE;
  280. static
  281. void sync_send(void) {
  282. serial_low();
  283. serial_delay();
  284. serial_high();
  285. }
  286. // Reads a byte from the serial line
  287. static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE;
  288. static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) {
  289. uint8_t byte, i, p, pb;
  290. _delay_sub_us(READ_WRITE_START_ADJUST);
  291. for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) {
  292. serial_delay_half1(); // read the middle of pulses
  293. if( serial_read_pin() ) {
  294. byte = (byte << 1) | 1; p ^= 1;
  295. } else {
  296. byte = (byte << 1) | 0; p ^= 0;
  297. }
  298. _delay_sub_us(READ_WRITE_WIDTH_ADJUST);
  299. serial_delay_half2();
  300. }
  301. /* recive parity bit */
  302. serial_delay_half1(); // read the middle of pulses
  303. pb = serial_read_pin();
  304. _delay_sub_us(READ_WRITE_WIDTH_ADJUST);
  305. serial_delay_half2();
  306. *pterrcount += (p != pb)? 1 : 0;
  307. return byte;
  308. }
  309. // Sends a byte with MSB ordering
  310. void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE;
  311. void serial_write_chunk(uint8_t data, uint8_t bit) {
  312. uint8_t b, p;
  313. for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) {
  314. if(data & b) {
  315. serial_high(); p ^= 1;
  316. } else {
  317. serial_low(); p ^= 0;
  318. }
  319. serial_delay();
  320. }
  321. /* send parity bit */
  322. if(p & 1) { serial_high(); }
  323. else { serial_low(); }
  324. serial_delay();
  325. serial_low(); // sync_send() / senc_recv() need raise edge
  326. }
  327. static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE;
  328. static
  329. void serial_send_packet(uint8_t *buffer, uint8_t size) {
  330. for (uint8_t i = 0; i < size; ++i) {
  331. uint8_t data;
  332. data = buffer[i];
  333. sync_send();
  334. serial_write_chunk(data,8);
  335. }
  336. }
  337. static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE;
  338. static
  339. uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) {
  340. uint8_t pecount = 0;
  341. for (uint8_t i = 0; i < size; ++i) {
  342. uint8_t data;
  343. sync_recv();
  344. data = serial_read_chunk(&pecount, 8);
  345. buffer[i] = data;
  346. }
  347. return pecount == 0;
  348. }
  349. inline static
  350. void change_sender2reciver(void) {
  351. sync_send(); //0
  352. serial_delay_half1(); //1
  353. serial_low(); //2
  354. serial_input_with_pullup(); //2
  355. serial_delay_half1(); //3
  356. }
  357. inline static
  358. void change_reciver2sender(void) {
  359. sync_recv(); //0
  360. serial_delay(); //1
  361. serial_low(); //3
  362. serial_output(); //3
  363. serial_delay_half1(); //4
  364. }
  365. static inline uint8_t nibble_bits_count(uint8_t bits)
  366. {
  367. bits = (bits & 0x5) + (bits >> 1 & 0x5);
  368. bits = (bits & 0x3) + (bits >> 2 & 0x3);
  369. return bits;
  370. }
  371. // interrupt handle to be used by the target device
  372. ISR(SERIAL_PIN_INTERRUPT) {
  373. #ifndef SERIAL_USE_MULTI_TRANSACTION
  374. serial_low();
  375. serial_output();
  376. SSTD_t *trans = Transaction_table;
  377. #else
  378. // recive transaction table index
  379. uint8_t tid, bits;
  380. uint8_t pecount = 0;
  381. sync_recv();
  382. bits = serial_read_chunk(&pecount,7);
  383. tid = bits>>3;
  384. bits = (bits&7) != nibble_bits_count(tid);
  385. if( bits || pecount> 0 || tid > Transaction_table_size ) {
  386. return;
  387. }
  388. serial_delay_half1();
  389. serial_high(); // response step1 low->high
  390. serial_output();
  391. _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH);
  392. SSTD_t *trans = &Transaction_table[tid];
  393. serial_low(); // response step2 ack high->low
  394. #endif
  395. // target send phase
  396. if( trans->target2initiator_buffer_size > 0 )
  397. serial_send_packet((uint8_t *)trans->target2initiator_buffer,
  398. trans->target2initiator_buffer_size);
  399. // target switch to input
  400. change_sender2reciver();
  401. // target recive phase
  402. if( trans->initiator2target_buffer_size > 0 ) {
  403. if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer,
  404. trans->initiator2target_buffer_size) ) {
  405. *trans->status = TRANSACTION_ACCEPTED;
  406. } else {
  407. *trans->status = TRANSACTION_DATA_ERROR;
  408. }
  409. } else {
  410. *trans->status = TRANSACTION_ACCEPTED;
  411. }
  412. sync_recv(); //weit initiator output to high
  413. }
  414. /////////
  415. // start transaction by initiator
  416. //
  417. // int soft_serial_transaction(int sstd_index)
  418. //
  419. // Returns:
  420. // TRANSACTION_END
  421. // TRANSACTION_NO_RESPONSE
  422. // TRANSACTION_DATA_ERROR
  423. // this code is very time dependent, so we need to disable interrupts
  424. #ifndef SERIAL_USE_MULTI_TRANSACTION
  425. int soft_serial_transaction(void) {
  426. SSTD_t *trans = Transaction_table;
  427. #else
  428. int soft_serial_transaction(int sstd_index) {
  429. if( sstd_index > Transaction_table_size )
  430. return TRANSACTION_TYPE_ERROR;
  431. SSTD_t *trans = &Transaction_table[sstd_index];
  432. #endif
  433. cli();
  434. // signal to the target that we want to start a transaction
  435. serial_output();
  436. serial_low();
  437. _delay_us(SLAVE_INT_WIDTH_US);
  438. #ifndef SERIAL_USE_MULTI_TRANSACTION
  439. // wait for the target response
  440. serial_input_with_pullup();
  441. _delay_us(SLAVE_INT_RESPONSE_TIME);
  442. // check if the target is present
  443. if (serial_read_pin()) {
  444. // target failed to pull the line low, assume not present
  445. serial_output();
  446. serial_high();
  447. *trans->status = TRANSACTION_NO_RESPONSE;
  448. sei();
  449. return TRANSACTION_NO_RESPONSE;
  450. }
  451. #else
  452. // send transaction table index
  453. int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index));
  454. sync_send();
  455. _delay_sub_us(TID_SEND_ADJUST);
  456. serial_write_chunk(tid, 7);
  457. serial_delay_half1();
  458. // wait for the target response (step1 low->high)
  459. serial_input_with_pullup();
  460. while( !serial_read_pin() ) {
  461. _delay_sub_us(2);
  462. }
  463. // check if the target is present (step2 high->low)
  464. for( int i = 0; serial_read_pin(); i++ ) {
  465. if (i > SLAVE_INT_ACK_WIDTH + 1) {
  466. // slave failed to pull the line low, assume not present
  467. serial_output();
  468. serial_high();
  469. *trans->status = TRANSACTION_NO_RESPONSE;
  470. sei();
  471. return TRANSACTION_NO_RESPONSE;
  472. }
  473. _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT);
  474. }
  475. #endif
  476. // initiator recive phase
  477. // if the target is present syncronize with it
  478. if( trans->target2initiator_buffer_size > 0 ) {
  479. if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer,
  480. trans->target2initiator_buffer_size) ) {
  481. serial_output();
  482. serial_high();
  483. *trans->status = TRANSACTION_DATA_ERROR;
  484. sei();
  485. return TRANSACTION_DATA_ERROR;
  486. }
  487. }
  488. // initiator switch to output
  489. change_reciver2sender();
  490. // initiator send phase
  491. if( trans->initiator2target_buffer_size > 0 ) {
  492. serial_send_packet((uint8_t *)trans->initiator2target_buffer,
  493. trans->initiator2target_buffer_size);
  494. }
  495. // always, release the line when not in use
  496. sync_send();
  497. *trans->status = TRANSACTION_END;
  498. sei();
  499. return TRANSACTION_END;
  500. }
  501. #ifdef SERIAL_USE_MULTI_TRANSACTION
  502. int soft_serial_get_and_clean_status(int sstd_index) {
  503. SSTD_t *trans = &Transaction_table[sstd_index];
  504. cli();
  505. int retval = *trans->status;
  506. *trans->status = 0;;
  507. sei();
  508. return retval;
  509. }
  510. #endif
  511. #endif
  512. // Helix serial.c history
  513. // 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc)
  514. // 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4)
  515. // (adjusted with avr-gcc 4.9.2)
  516. // 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78)
  517. // (adjusted with avr-gcc 4.9.2)
  518. // 2018-8-11 add support multi-type transaction (#3608, feb5e4aae)
  519. // (adjusted with avr-gcc 4.9.2)
  520. // 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff)
  521. // (adjusted with avr-gcc 7.3.0)
  522. // 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66)
  523. // (adjusted with avr-gcc 5.4.0, 7.3.0)