OpenCores
URL https://opencores.org/ocsvn/amber/amber/trunk

Subversion Repositories amber

[/] [amber/] [trunk/] [sw/] [boot-loader-ethmac/] [utilities.c] - Diff between revs 61 and 80

Show entire file | Details | Blame | View Log

Rev 61 Rev 80
Line 115... Line 115...
{
{
    *(unsigned int *) ADR_AMBER_TEST_PHY_RST = value;
    *(unsigned int *) ADR_AMBER_TEST_PHY_RST = value;
}
}
 
 
 
 
/* turn off all leds */
 
void led_clear()
 
{
 
    *(unsigned int *) ADR_AMBER_TEST_LED = 0;
 
}
 
 
 
 
 
/* led is either 0,1,2 or 3 */
 
void led_flip(int led)
 
{
 
    int current_value;
 
    current_value = *(unsigned int *) ADR_AMBER_TEST_LED;
 
    *(unsigned int *) ADR_AMBER_TEST_LED = current_value ^ (1<<led);
 
}
 
 
 
 
 
 
 
/* led is either 0,1,2 or 3 */
 
void led_on(int led)
 
{
 
    int current_value;
 
    current_value = *(unsigned int *) ADR_AMBER_TEST_LED;
 
    *(unsigned int *) ADR_AMBER_TEST_LED = current_value | (1<<led);
 
}
 
 
 
 
 
 
 
/* led is either 0,1,2 or 3 */
 
void led_off(int led)
 
{
 
    int current_value;
 
    current_value = *(unsigned int *) ADR_AMBER_TEST_LED;
 
    *(unsigned int *) ADR_AMBER_TEST_LED = current_value & ~(1<<led);
 
}
 
 
 
 
 
/* led is either 0,1,2 or 3 */
 
void led_123(int value)
 
{
 
    int current_value;
 
    current_value = *(unsigned int *) ADR_AMBER_TEST_LED;
 
    *(unsigned int *) ADR_AMBER_TEST_LED = (current_value & 1) | value<<1;
 
}
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.