Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ATSHA204 Component Example - USART

logging functions

Functions

uint8_t convert_nibble_to_hexascii (uint8_t nibble)
 This function converts a nibble to Hex-ASCII. More...
 
void display_status (uint8_t device_present_mask, uint8_t sha204_revision)
 This function displays information using LEDs about the SHA204 devices on the Security Xplained board. More...
 
void led_display_number (uint8_t value)
 This function displays a byte value using the Xplained LEDs. More...
 
void log_init (void)
 This function initializes the logging hardware. More...
 
void log_sha204 (uint8_t length, uint8_t *buffer, bool is_rx)
 This function logs rx or tx data as hex-ascii. More...
 
void log_sha204_title (char *title)
 This function logs the title of a SHA204 transaction. More...
 
void usart_send (uint8_t length, uint8_t *buffer)
 

uint8_t convert_nibble_to_hexascii ( uint8_t  nibble)

This function converts a nibble to Hex-ASCII.

Parameters
[in]nibblenibble value to be converted
Returns
ASCII value

Referenced by log_sha204().

void display_status ( uint8_t  device_present_mask,
uint8_t  sha204_revision 
)

This function displays information using LEDs about the SHA204 devices on the Security Xplained board.

Parameters
[in]device_present_maskThe high nibble represents the four SHA204 devices.
[in]sha204_revisionrevision of the SHA204 devices

References led_display_number(), SHA204_DEVICE_COUNT, and sha204h_delay_ms().

void led_display_number ( uint8_t  value)

This function displays a byte value using the Xplained LEDs.

Parameters
[in]valuebyte to display

References LED0_GPIO, LED1_GPIO, LED2_GPIO, LED3_GPIO, LED4_GPIO, LED5_GPIO, LED6_GPIO, LED7_GPIO, LED_Off, and LED_On.

Referenced by display_status(), and main().

void log_init ( void  )
void log_sha204 ( uint8_t  length,
uint8_t *  buffer,
bool  is_rx 
)

This function logs rx or tx data as hex-ascii.

Parameters
[in]lengthnumber of characters
[in]bufferpointer to data
[in]is_rxtrue if rx buffer, false if tx_buffer is logged

References convert_nibble_to_hexascii(), usart_putchar(), usart_serial_write_packet(), USART_SHA204, and usart_write_crlf().

Referenced by main().

void log_sha204_title ( char *  title)

This function logs the title of a SHA204 transaction.

Parameters
[in]titlepointer to title string

References usart_serial_write_packet(), USART_SHA204, and usart_write_crlf().

Referenced by main().

void usart_send ( uint8_t  length,
uint8_t *  buffer 
)