mirror of
https://github.com/BertoldVdb/ms-tools.git
synced 2025-12-10 07:44:46 +01:00
Use GPIO interface to enable SPI GPIOs
This commit is contained in:
parent
92d32344a7
commit
366a18a6cb
1 changed files with 4 additions and 1 deletions
|
|
@ -12,9 +12,12 @@ func (h *HAL) ms2130enableSPI(enable bool) error {
|
|||
}
|
||||
|
||||
/* Configure GPIO */
|
||||
if _, err := h.MemoryRegionGet(MemoryRegionSFR).Access(true, 0xb0-0x80, []byte{0xe1}); err != nil {
|
||||
output := byte(1<<2 | 1<<3 | 1<<4)
|
||||
input := byte(1 << 5)
|
||||
if _, _, err := h.GPIOUpdate(output, 0, output, input); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
value = byte(0x10)
|
||||
} else {
|
||||
if h.ms2130spiEnabled == 0 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue