-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to rtm_check_presence function to board specific directory
- Loading branch information
1 parent
8ed196b
commit d7c579f
Showing
8 changed files
with
45 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "port.h" | ||
#include "rtm_i2c_mapping.h" | ||
#include "eeprom_24xx64.h" | ||
#include "hotswap.h" | ||
|
||
void rtm_check_presence( uint8_t *status ) | ||
{ | ||
/* Due to a hardware limitation in the AFC board, we can't rely on reading the PS signal | ||
since this pin doesn't have a pull-up resistor, it's always read as 0. | ||
A very dirty workaround is to 'ping' the RTM EEPROM, if it responds, then the board is connected */ | ||
|
||
uint8_t dumb; | ||
*status = HOTSWAP_STATE_URTM_ABSENT; | ||
|
||
if(eeprom_24xx64_read(CHIP_ID_RTM_EEPROM, 0, &dumb, 1, 100)) { | ||
*status = HOTSWAP_STATE_URTM_PRSENT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "i2c_mapping.h" | ||
#include "port.h" | ||
#include "hotswap.h" | ||
|
||
void rtm_check_presence( uint8_t *status ) | ||
{ | ||
*status = HOTSWAP_STATE_URTM_ABSENT; | ||
|
||
if (!gpio_read_pin(PIN_PORT(GPIO_RTM_PS), PIN_NUMBER(GPIO_RTM_PS))) { | ||
*status = HOTSWAP_STATE_URTM_PRSENT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters