BLE_API v2.1.3

Functions
MCU SPI Function Definition
Porting » MCU Porting Related » MCU SPI Porting Definition

## Functions
void | setBLE_SpiInit (void)
void | setBLE_SpiPDMAInit (void)
void | setBLE_SpiSSHigh (void)
void | setBLE_SpiSSLow (void)
void | setBLE_SpiWaitAndSSHigh (void)
uint8_t | setBLE_SpiOneByteRx (uint8_t regAddr)
uint8_t | setBLE_SpiOneByteRxIsr (uint8_t regAddr)
void | setBLE_SpiOneByteTx (uint8_t regAddr, uint8_t u8SrcData)
void | setBLE_SpiOneByteTxIsr (uint8_t regAddr, uint8_t u8SrcData)
void | setBLE_SpiTwoByteTxIsr (uint8_t regAddr, uint8_t *u8SrcAddr)
void | setBLE_SpiPDMARxIsr (uint8_t regAddr, uint32_t u32DstAddr, uint32_t u32TransCount)
void | setBLE_SpiPDMATx (uint8_t regAddr, uint32_t u32SrcAddr, uint32_t u32TransCount)
uint32_t | setBLE_SpiPDMAWaitFinish (void)

## Detailed Description

Here shows the MCU SPI related functions.

## Function Documentation

## ◆ setBLE_SpiInit()

void setBLE_SpiInit | ( | void |  | ) |

This function is used to initial MCU SPI.

Returns
  none

## ◆ setBLE_SpiOneByteRx()

uint8_t setBLE_SpiOneByteRx | ( | uint8_t | regAddr | ) |

This function is used to read RF 1 byte register.

Parameters

  [in] | regAddr | : register address

Returns
  1 byte RX data.

## ◆ setBLE_SpiOneByteRxIsr()

uint8_t setBLE_SpiOneByteRxIsr | ( | uint8_t | regAddr | ) |

This function is used to read RF 1 byte register or RX_FIFO in ISR.

Parameters

  [in] | regAddr | : register address

Returns
  1 byte RX data.

## ◆ setBLE_SpiOneByteTx()

void setBLE_SpiOneByteTx | ( | uint8_t | regAddr,
|  | uint8_t | u8SrcData
| ) |  |

This function is used to write RF 1 byte register.

Note
  Not use for writing TX buffer.

Parameters

  [in] | regAddr | : register address
  [in] | u8SrcData | : data which user attempt to transfer through SPI bus

Returns
  none

## ◆ setBLE_SpiOneByteTxIsr()

void setBLE_SpiOneByteTxIsr | ( | uint8_t | regAddr,
|  | uint8_t | u8SrcData
| ) |  |

This function is used to write RF 1 byte register in ISR.

Note
  Not use for writing TX buffer.

Parameters

  [in] | regAddr | : register address
  [in] | u8SrcData | : data which user attempt to transfer through SPI bus

Returns
  none

## ◆ setBLE_SpiPDMAInit()

void setBLE_SpiPDMAInit | ( | void |  | ) |

This function is used to initial MCU SPI PDMA.

Returns
  none

## ◆ setBLE_SpiPDMARxIsr()

void setBLE_SpiPDMARxIsr | ( | uint8_t | regAddr,
|  | uint32_t | u32DstAddr,
|  | uint32_t | u32TransCount
| ) |  |

This function is used to using SPI PDMA read RF in ISR.

Attention
  Because of the set-and-forget SPI DMA behavior, user should avoid modification of the source data.

Parameters

  [in] | regAddr | : register address
  [in] | u8SrcData | : data which user attempt to transfer through SPI bus
  [in] | u32TransCount | : transfer count

Returns
  none

## ◆ setBLE_SpiPDMATx()

void setBLE_SpiPDMATx | ( | uint8_t | regAddr,
|  | uint32_t | u32SrcAddr,
|  | uint32_t | u32TransCount
| ) |  |

This function is used to using SPI PDMA write RF in ISR.

Attention
  Because of the set-and-forget SPI DMA behavior, user should avoid modification of the source data.

Parameters

  [in] | regAddr | : register address
  [in] | u8SrcData | : data which user attempt to transfer through SPI bus
  [in] | u32TransCount | : transfer count

Returns
  none

## ◆ setBLE_SpiPDMAWaitFinish()

uint32_t setBLE_SpiPDMAWaitFinish | ( | void |  | ) |

This function is used to wait PDMA complete the operation.

Returns
  SPI PDMA Result success or not.

Return values

  0 | Success
  1 | FAIL

## ◆ setBLE_SpiSSHigh()

void setBLE_SpiSSHigh | ( | void |  | ) |

This function is used to manual set SPI SS pin to high state immediately.

Returns
  none

## ◆ setBLE_SpiSSLow()

void setBLE_SpiSSLow | ( | void |  | ) |

This function is used to manual set SPI SS pin to low state immediately.

Returns
  none

## ◆ setBLE_SpiTwoByteTxIsr()

void setBLE_SpiTwoByteTxIsr | ( | uint8_t | regAddr,
|  | uint8_t * | u8SrcAddr
| ) |  |

This function is used to write RF 2 byte register in ISR.

Parameters

  [in] | regAddr | : register address
  [in] | u8SrcData | : data which user attempt to transfer through SPI bus

Returns
  none

## ◆ setBLE_SpiWaitAndSSHigh()

void setBLE_SpiWaitAndSSHigh | ( | void |  | ) |

This function is used to manual set SPI SS pin to high state until SPI is not in busy state.

Note
  If SPI_SS_CONTROL is set to AUTO_SPI_SS then user do not have to wait and manual set SS pin to hight state.

Returns
  none