Bsongis/power control chip (#6445)

FRSK files support added
This commit is contained in:
Bertrand Songis
2019-05-27 12:23:34 +02:00
committed by GitHub
parent 2eb88cb909
commit 8edf77286d
26 changed files with 438 additions and 51 deletions
@@ -83,12 +83,24 @@ void telemetryPortSetDirectionOutput()
TELEMETRY_USART->CR1 &= ~USART_CR1_RE; // turn off receiver
}
void sportWaitTransmissionComplete()
{
while (!(TELEMETRY_USART->SR & USART_SR_TC));
}
void telemetryPortSetDirectionInput()
{
sportWaitTransmissionComplete();
TELEMETRY_DIR_INPUT();
TELEMETRY_USART->CR1 |= USART_CR1_RE; // turn on receiver
}
void sportSendByte(uint8_t byte)
{
while (!(TELEMETRY_USART->SR & USART_SR_TXE));
USART_SendData(TELEMETRY_USART, byte);
}
void sportSendBuffer(const uint8_t * buffer, uint32_t count)
{
telemetryPortSetDirectionOutput();