Page 1 of 1

How to read a data from a bus of 8-bit width

Posted: Mon Sep 24, 2018 3:20 am
by whoyoume
Hello People,

Please tell me a sample or fragment of source code to do that, like below.

//--------------------------------------------------------
uint8_t buff[1000];
uint32_t i = 0;
void my_func_init() {
???
}
uint8_t my_func_read_bus() {
uint8_t data;
???
return data;
}
void my_func_handler() {
buff[i++] = my_func_read_bus();
}
void main() {
set_interrupt_handler(my_func_handler, PIN_X);
my_func_init();
}
//--------------------------------------------------------

I would like to connect the ESP32-DevKitC to an external device with a bus of 8-bit width.

Thank you.