Carmel (MAXREFDES18#) Code Documentation
V01.00
High Accuracy Analog Current/Voltage Output
|
Go to the source code of this file.
Functions | |
void | print_asterisks (int nQuantity) |
Print nQuantity of asterisks to the default Hyperterminal UART. | |
int | SpiRW (u32 unPeripheralAddressSPI, unsigned int unCPHA, unsigned int unCPOL, u8 *auchWriteBuf, u8 *auchReadBuf, int unNumBytes, u8 uchCsActiveHigh, u32 unSpiSS) |
Perform a SPI read or write. | |
void | delay (int nStopValue) |
Loop for nStopValue iterations to provide a delay. | |
void | led_knight_rider (XGpio *pLED_GPIO, int nNumberOfTimes) |
Blink a row of LEDs nNumberOfTimes times. | |
void | max_configure_PMOD_port (u8 uchPmodPortA, u8 uchPmodPortB, u8 uchPmodPortC, u8 uchPmodPortD) |
Configure driving peripherals on each Pmod port. | |
int | number_raised_to_power (int nBase, int nExponent) |
Raise nBase to the nExponent power (operates with integers only). | |
int | receive_byte_with_timeout (u32 unUartAddress, int nTimeoutInTenthsOfSeconds, u8 *uchRxData) |
Receive a byte from the UART located at *pUartAddress. | |
int | GetLine (char *sInputString, unsigned int unMaxSize) |
Retrieve a line of characters from the default Hyperterminal UART (DEFAULT_HYPERTERMINAL_UART). | |
Project: Carmel (MAXREFDES18) Filename: utilities.c Description: This module contains the utility functions for the ZedBoard implementation of the example program for the MAXREFDES18.
Revision History:
08-19-2013 Rev 01.00 MG Initial release.
This code follows the following naming conventions:
char chPmodValue
char (array) sPmodString[16]
float fPmodValue
int nPmodValue
int (array) anPmodValue[16]
u16 uPmodValue
u16 (array) auPmodValue[16]
u8 uchPmodValue
u8 (array) auchPmodBuffer[16]
unsigned int unPmodValue
int * punPmodValue
Definition in file utilities.c.
void delay | ( | int | nStopValue | ) |
Loop for nStopValue iterations to provide a delay.
[in] | nStopValue | - number of iterations to loop |
None |
Definition at line 166 of file utilities.c.
int GetLine | ( | char * | sInputString, |
unsigned int | unMaxSize | ||
) |
Retrieve a line of characters from the default Hyperterminal UART (DEFAULT_HYPERTERMINAL_UART).
[in] | sInputString | - pointer to buffer for input string |
[in] | unMaxSize | - maximum number of characters to input |
TRUE | if operation succeeded |
Definition at line 347 of file utilities.c.
void led_knight_rider | ( | XGpio * | pLED_GPIO, |
int | nNumberOfTimes | ||
) |
Blink a row of LEDs nNumberOfTimes times.
[in] | *pLED_GPIO | - address of the GPIO peripheral driving the LEDs in the memory map |
None |
Definition at line 187 of file utilities.c.
void max_configure_PMOD_port | ( | u8 | uchPmodPortA, |
u8 | uchPmodPortB, | ||
u8 | uchPmodPortC, | ||
u8 | uchPmodPortD | ||
) |
Configure driving peripherals on each Pmod port.
[in] | uchPmodPortA | - 2-bit number to define configuration for Pmod port A |
[in] | uchPmodPortB | - 2-bit number to define configuration for Pmod port B |
[in] | uchPmodPortC | - 2-bit number to define configuration for Pmod port C |
[in] | uchPmodPortD | - 2-bit number to define configuration for Pmod port D |
TRUE | if operation succeeded |
Definition at line 222 of file utilities.c.
int number_raised_to_power | ( | int | nBase, |
int | nExponent | ||
) |
Raise nBase to the nExponent power (operates with integers only).
[in] | nBase | - base |
[in] | nExponent | - exponent |
Base^Exponent |
Definition at line 262 of file utilities.c.
void print_asterisks | ( | int | nQuantity | ) |
Print nQuantity of asterisks to the default Hyperterminal UART.
[in] | nQuantity | - number of asterisks to print |
None |
Definition at line 64 of file utilities.c.
int receive_byte_with_timeout | ( | u32 | unUartAddress, |
int | nTimeoutInTenthsOfSeconds, | ||
u8 * | uchRxData | ||
) |
Receive a byte from the UART located at *pUartAddress.
[in] | unUartAddress | - address of the UART peripheral in the memory map |
[in] | nTimeoutInTenthsOfSeconds | - amount of time to allow before TIMEOUT |
[out] | *uchRxData | - received data is stored at uchRxData |
TRUE | if operation succeeded |
Definition at line 291 of file utilities.c.
int SpiRW | ( | u32 | unPeripheralAddressSPI, |
unsigned int | unCPHA, | ||
unsigned int | unCPOL, | ||
u8 * | auchWriteBuf, | ||
u8 * | auchReadBuf, | ||
int | unNumBytes, | ||
u8 | uchCsActiveHigh, | ||
u32 | unSpiSS | ||
) |
Perform a SPI read or write.
[in] | unPeripheralAddressSPI | - |
[in] | unCPHA | - phase of SCK (edge to trigger on). 0=Leading edge, 1=Trailing edge |
[in] | unCPOL | - polarity of SCK. 0=Active high, 1=Active low |
[in] | auchWriteBuf | - pointer to write data buffer |
[in] | auchReadBuf | - pointer to read data buffer |
[in] | unNumBytes | - number of bytes to transfer |
[in] | uchCsActiveHigh | - polarity of slave select 0=active low, 1=active high |
[in] | unSpiSS | - one-hot 32-bit slave select register value. 0x1 = MAX15500, 0x2= MAX5316. |
Always | returns 0 |
Definition at line 78 of file utilities.c.