Implement Multi-Bus CAN Interfaces
This commit is contained in:
@@ -5,13 +5,13 @@
|
||||
|
||||
const uint8_t null_buffer[32] = {0};
|
||||
|
||||
void MCP2521_Hardware_Handle_ESP::spi_transmit(spi_transaction_t *t) {
|
||||
void MCP2521_HardwareHandle_ESP::spi_transmit(spi_transaction_t *t) {
|
||||
xSemaphoreTake(spiMutex, portMAX_DELAY);
|
||||
spi_device_transmit(this->spi_device_handle, t);
|
||||
xSemaphoreGive(spiMutex);
|
||||
}
|
||||
|
||||
void MCP2521_Hardware_Handle_ESP::execute(uint8_t cmd) {
|
||||
void MCP2521_HardwareHandle_ESP::execute(uint8_t cmd) {
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
.flags = SPI_TRANS_VARIABLE_CMD | SPI_TRANS_VARIABLE_ADDR,
|
||||
@@ -30,7 +30,7 @@ void MCP2521_Hardware_Handle_ESP::execute(uint8_t cmd) {
|
||||
spi_transmit((spi_transaction_t*)(&t));
|
||||
}
|
||||
|
||||
void MCP2521_Hardware_Handle_ESP::execute(uint8_t cmd, uint8_t address) {
|
||||
void MCP2521_HardwareHandle_ESP::execute(uint8_t cmd, uint8_t address) {
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
.flags = SPI_TRANS_VARIABLE_CMD | SPI_TRANS_VARIABLE_ADDR,
|
||||
@@ -49,7 +49,7 @@ void MCP2521_Hardware_Handle_ESP::execute(uint8_t cmd, uint8_t address) {
|
||||
spi_transmit((spi_transaction_t*)(&t));
|
||||
}
|
||||
|
||||
void MCP2521_Hardware_Handle_ESP::read(uint8_t cmd, uint8_t *data, size_t length, uint8_t address) {
|
||||
void MCP2521_HardwareHandle_ESP::read(uint8_t cmd, uint8_t *data, size_t length, uint8_t address) {
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
.flags = SPI_TRANS_VARIABLE_CMD | SPI_TRANS_VARIABLE_ADDR,
|
||||
@@ -68,7 +68,7 @@ void MCP2521_Hardware_Handle_ESP::read(uint8_t cmd, uint8_t *data, size_t length
|
||||
spi_transmit((spi_transaction_t*)(&t));
|
||||
}
|
||||
|
||||
void MCP2521_Hardware_Handle_ESP::read(uint8_t cmd, uint8_t *data, size_t length) {
|
||||
void MCP2521_HardwareHandle_ESP::read(uint8_t cmd, uint8_t *data, size_t length) {
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
.flags = SPI_TRANS_VARIABLE_CMD | SPI_TRANS_VARIABLE_ADDR,
|
||||
@@ -87,7 +87,7 @@ void MCP2521_Hardware_Handle_ESP::read(uint8_t cmd, uint8_t *data, size_t length
|
||||
spi_transmit((spi_transaction_t*)(&t));
|
||||
}
|
||||
|
||||
uint8_t MCP2521_Hardware_Handle_ESP::read(uint8_t cmd, uint8_t address) {
|
||||
uint8_t MCP2521_HardwareHandle_ESP::read(uint8_t cmd, uint8_t address) {
|
||||
uint8_t result = 0;
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
@@ -108,7 +108,7 @@ uint8_t MCP2521_Hardware_Handle_ESP::read(uint8_t cmd, uint8_t address) {
|
||||
return result;
|
||||
}
|
||||
|
||||
uint8_t MCP2521_Hardware_Handle_ESP::read(uint8_t cmd) {
|
||||
uint8_t MCP2521_HardwareHandle_ESP::read(uint8_t cmd) {
|
||||
uint8_t result;
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
@@ -129,7 +129,7 @@ uint8_t MCP2521_Hardware_Handle_ESP::read(uint8_t cmd) {
|
||||
return result;
|
||||
}
|
||||
|
||||
void MCP2521_Hardware_Handle_ESP::write(uint8_t cmd, uint8_t *data, size_t length, uint8_t address) {
|
||||
void MCP2521_HardwareHandle_ESP::write(uint8_t cmd, uint8_t *data, size_t length, uint8_t address) {
|
||||
uint8_t result;
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
@@ -149,7 +149,7 @@ void MCP2521_Hardware_Handle_ESP::write(uint8_t cmd, uint8_t *data, size_t lengt
|
||||
spi_transmit((spi_transaction_t*)(&t));
|
||||
}
|
||||
|
||||
void MCP2521_Hardware_Handle_ESP::write(uint8_t cmd, uint8_t *data, size_t length) {
|
||||
void MCP2521_HardwareHandle_ESP::write(uint8_t cmd, uint8_t *data, size_t length) {
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
.flags = SPI_TRANS_VARIABLE_CMD | SPI_TRANS_VARIABLE_ADDR,
|
||||
@@ -168,7 +168,7 @@ void MCP2521_Hardware_Handle_ESP::write(uint8_t cmd, uint8_t *data, size_t lengt
|
||||
spi_transmit((spi_transaction_t*)(&t));
|
||||
}
|
||||
|
||||
void MCP2521_Hardware_Handle_ESP::write(uint8_t cmd, uint8_t data, uint8_t address) {
|
||||
void MCP2521_HardwareHandle_ESP::write(uint8_t cmd, uint8_t data, uint8_t address) {
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
.flags = SPI_TRANS_VARIABLE_CMD | SPI_TRANS_VARIABLE_ADDR,
|
||||
@@ -187,7 +187,7 @@ void MCP2521_Hardware_Handle_ESP::write(uint8_t cmd, uint8_t data, uint8_t addre
|
||||
spi_transmit((spi_transaction_t*)(&t));
|
||||
}
|
||||
|
||||
void MCP2521_Hardware_Handle_ESP::write(uint8_t cmd, uint8_t data) {
|
||||
void MCP2521_HardwareHandle_ESP::write(uint8_t cmd, uint8_t data) {
|
||||
spi_transaction_ext_t t = {
|
||||
.base = {
|
||||
.flags = SPI_TRANS_VARIABLE_CMD | SPI_TRANS_VARIABLE_ADDR,
|
||||
|
||||
Reference in New Issue
Block a user