24 lines
901 B
C
24 lines
901 B
C
#pragma once
|
|
|
|
/**
|
|
* Register a new SPI peripheral.
|
|
* @param pin_number The pin number of the device's chip select pin.
|
|
*/
|
|
void peripheral_register(int pin_number);
|
|
|
|
/**
|
|
* Allows the device with the given chip select pin to talk on the SPI bus.
|
|
* @param pin_number The pin number of the chip select pin of the device to allow to talk.
|
|
*/
|
|
void peripheral_unsilence(int pin_number);
|
|
/**
|
|
* Stops the device with the given chip select pin from talking on the SPI bus.
|
|
* @param pin_number The chip-select pin number of the device to stop.
|
|
*/
|
|
void peripheral_silence(int pin_number);
|
|
/**
|
|
* Switches the active device from one to another on the SPI bus.
|
|
* @param pin_number_old The chip-select pin number of the old device to switch out from.
|
|
* @param pin_number_new The chip-select pin number of the new device to switch in to.
|
|
*/
|
|
void peripheral_switch(int pin_number_old, int pin_number_new);
|