mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
Add CS down/up for device type detection
This commit is contained in:
parent
70723bdcfe
commit
a9d6c7840b
1 changed files with 4 additions and 0 deletions
|
@ -435,6 +435,8 @@ bool max7456Init(const max7456Config_t *max7456Config, const vcdProfile_t *pVcdP
|
||||||
// Do this at half the speed for safety.
|
// Do this at half the speed for safety.
|
||||||
spiSetDivisor(busdev->busdev_u.spi.instance, MAX7456_SPI_CLK * 2);
|
spiSetDivisor(busdev->busdev_u.spi.instance, MAX7456_SPI_CLK * 2);
|
||||||
|
|
||||||
|
__spiBusTransactionBegin(busdev);
|
||||||
|
|
||||||
max7456Send(MAX7456ADD_CMAL, (1 << 6)); // CA[8] bit
|
max7456Send(MAX7456ADD_CMAL, (1 << 6)); // CA[8] bit
|
||||||
|
|
||||||
if (max7456Send(MAX7456ADD_CMAL|MAX7456ADD_READ, 0xff) & (1 << 6)) {
|
if (max7456Send(MAX7456ADD_CMAL|MAX7456ADD_READ, 0xff) & (1 << 6)) {
|
||||||
|
@ -443,6 +445,8 @@ bool max7456Init(const max7456Config_t *max7456Config, const vcdProfile_t *pVcdP
|
||||||
max7456DeviceType = MAX7456_DEVICE_TYPE_MAX;
|
max7456DeviceType = MAX7456_DEVICE_TYPE_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__spiBusTransactionEnd(busdev);
|
||||||
|
|
||||||
#if defined(USE_OVERCLOCK)
|
#if defined(USE_OVERCLOCK)
|
||||||
// Determine SPI clock divisor based on config and the device type.
|
// Determine SPI clock divisor based on config and the device type.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue