\r
#if defined(ENABLE_PDI_PROTOCOL) || defined(__DOXYGEN__)\r
\r
+/** Flag to indicate if the USART is currently in Tx or Rx mode. */\r
volatile bool IsSending;\r
\r
#if !defined(PDI_VIA_HARDWARE_USART)\r
+/** Software USART raw frame bits for transmission/reception. */\r
volatile uint16_t SoftUSART_Data;\r
+\r
+/** Bits remaining to be sent or received via the software USART. */\r
volatile uint8_t SoftUSART_BitCount;\r
\r
+\r
+/** ISR to manage the software USART when bit-banged USART mode is selected. */\r
ISR(TIMER1_COMPA_vect, ISR_BLOCK)\r
{\r
/* Toggle CLOCK pin in a single cycle (see AVR datasheet) */\r
}\r
#endif\r
\r
+/** Enables the target's PDI interface, holding the target in reset until PDI mode is exited. */\r
void PDITarget_EnableTargetPDI(void)\r
{\r
#if defined(PDI_VIA_HARDWARE_USART)\r
#endif\r
}\r
\r
+/** Disables the target's PDI interface, exits programming mode and starts the target's application. */\r
void PDITarget_DisableTargetPDI(void)\r
{\r
#if defined(PDI_VIA_HARDWARE_USART)\r
#endif\r
}\r
\r
+/** Sends a byte via the USART.\r
+ *\r
+ * \param[in] Byte Byte to send through the USART\r
+ */\r
void PDITarget_SendByte(uint8_t Byte)\r
{\r
#if defined(PDI_VIA_HARDWARE_USART)\r
#endif\r
}\r
\r
+/** Receives a byte via the software USART, blocking until data is received.\r
+ *\r
+ * \return Received byte from the USART\r
+ */\r
uint8_t PDITarget_ReceiveByte(void)\r
{\r
#if defined(PDI_VIA_HARDWARE_USART)\r
#endif\r
}\r
\r
+/** Sends a BREAK via the USART to the attached target, consisting of a full frame of idle bits. */\r
void PDITarget_SendBreak(void)\r
{\r
#if defined(PDI_VIA_HARDWARE_USART)\r
#endif\r
}\r
\r
+/** Busy-waits while the NVM controller is busy performing a NVM operation, such as a FLASH page read or CRC\r
+ * calculation.\r
+ *\r
+ * \return Boolean true if the NVM controller became ready within the timeout period, false otherwise\r
+ */\r
bool PDITarget_WaitWhileNVMBusBusy(void)\r
{\r
TCNT0 = 0;\r