developer | e0cea0f | 2021-12-16 16:08:26 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * $Id: SPI.h 109 2008-10-22 19:45:09Z lajordan@SILABS.COM $ |
| 4 | * |
| 5 | * This file is system specific and should be edited for your hardware platform |
| 6 | * |
| 7 | * This file is used by proslic_timer_intf.h and proslic_spiGci.h |
| 8 | */ |
| 9 | #ifndef SPI_TYPE_H |
| 10 | #define SPI_TYPE_H |
| 11 | |
| 12 | /* |
| 13 | ** SPI/GCI structure |
| 14 | */ |
| 15 | typedef struct{ |
| 16 | unsigned short portID; |
| 17 | } ctrl_S; |
| 18 | |
| 19 | /* |
| 20 | ** Function: SPI_Init |
| 21 | ** |
| 22 | ** Description: |
| 23 | ** Initializes the SPI interface |
| 24 | */ |
| 25 | int SPI_Init (ctrl_S *hSpi); |
| 26 | |
| 27 | |
| 28 | /* |
| 29 | ** Function: ctrl_ResetWrapper |
| 30 | ** |
| 31 | ** Description: |
| 32 | ** Sets the reset pin of the ProSLIC |
| 33 | */ |
| 34 | int ctrl_ResetWrapper (void *hCtrl, int status); |
| 35 | |
| 36 | /* |
| 37 | ** register read |
| 38 | ** |
| 39 | ** Description: |
| 40 | ** Reads ProSLIC registers |
| 41 | */ |
| 42 | unsigned char ctrl_ReadRegisterWrapper (void *hCtrl, unsigned char channel, unsigned char regAddr); |
| 43 | |
| 44 | /* |
| 45 | ** Function: ctrl_WriteRegisterWrapper |
| 46 | ** |
| 47 | ** Description: |
| 48 | ** Writes ProSLIC registers |
| 49 | */ |
| 50 | int ctrl_WriteRegisterWrapper (void *hSpiGci, unsigned char channel, unsigned char regAddr, unsigned char data); |
| 51 | |
| 52 | /* |
| 53 | ** Function: ctrl_WriteRAMWrapper |
| 54 | ** |
| 55 | ** Description: |
| 56 | ** Writes ProSLIC RAM |
| 57 | */ |
| 58 | int ctrl_WriteRAMWrapper (void *hSpiGci, unsigned char channel, unsigned short ramAddr, ramData data); |
| 59 | |
| 60 | /* |
| 61 | ** Function: ctrl_ReadRAMWrapper |
| 62 | ** |
| 63 | ** Description: |
| 64 | ** Reads ProSLIC RAM |
| 65 | */ |
| 66 | ramData ctrl_ReadRAMWrapper (void *hSpiGci, unsigned char channel, unsigned short ramAddr); |
| 67 | |
| 68 | #endif |
| 69 | /* |
| 70 | ** $Log: SPI.h,v $ |
| 71 | ** Revision 1.2 2007/02/21 16:53:07 lajordan |
| 72 | ** no message |
| 73 | ** |
| 74 | ** Revision 1.1 2007/02/16 23:55:15 lajordan |
| 75 | ** no message |
| 76 | ** |
| 77 | ** Revision 1.2 2007/02/15 23:33:25 lajordan |
| 78 | ** no message |
| 79 | ** |
| 80 | ** Revision 1.1.1.1 2006/07/13 20:26:08 lajordan |
| 81 | ** no message |
| 82 | ** |
| 83 | */ |