AN633
Rev. 0.7
35
9.4.4. Programmable Counter Array Module
The programmable counter array (PCA)-related source files, called pca.h and pca.c, are located in the /src/driver/
folder. This module initializes the PCA, which creates beeping sounds from the buzzer. The time-base source of
the PCA can be selected. Interrupts can be generated when the lower byte of the counter overflows. PWM-mod
cycle length also can be selected to modify the frequency of the tweeting sound.
9.4.5. Serial Peripheral Interface Module
The serial peripheral interface (SPI)-related source files, called spi.h and spi.c, are located in the /src/driver/ folder.
This module is the most essential because it enables a connection to the radio via the SPI bus. The radio can be
controlled by its built-in application programming interface. Communication with the radio is based on sending
commands to the API and receiving responses from the API. To enable the SPI interface, the SPI port must be
enabled and associated to the crossbar. The directions of the SCK, MISO, and MOSI ports have to be configured
properly on the IO port. Finally, the default states of the pins have to be set correctly. Since several devices can be
connected to the same SPI bus, the NSEL pin of the selected device is activated during communication. Because
the commands to be sent to the API are sequences of bytes, the module has to be able to send and receive
continuous byte stream. There are some cases when either reading a single byte directly from the MISO or writing
specified number of bits directly to the MOSI is necessary. In order to cover these kinds of cases, bitbang
read/write methods have been also implemented.
Function Name:
void
vPca_InitPcaTmr
(U8 biPulseSelect, U8 biPcaTmrItEnable, U8 biCy-
cleLengthSelect)
Description:
This function is used to start Timer 2 in the specified mode.
Input Parameter(s):
biPulseSelect Selects time-base source of PCA .
(use predefined constants: bPca_PcaCps_000_c etc.)
biPcaTmrItEnable : Enables PCA timer IT if TRUE, disables it if FALSE.
biCycleLengthSelect :PWM-mode cycle length select
(use predefined constants: bPca_PwmClsel_00_c, etc.).
Return Value
None
Function Name:
U8
bSpi_ReadWriteSpi0
(U8 biDataIn)
Description:
This function is used to read/write one byte from/to SPI0.
Input Parameter(s):
biDataIn : Data to be sent.
Return Value:
Read value of the SPI port after writing on it.
Function Name:
U8
bSpi_ReadWriteSpi1
(U8 biDataIn)
Description:
This function is used to read/write one byte from/to SPI1.
Input Parameter(s):
biDataIn : Data to be sent.
Return Value:
Read value of the SPI port after writing on it.
Function Name:
void
vSpi_WriteDataSpi0
(U8 biDataInLength, U8 *pabiDataIn)
Description:
This function is used to send data over SPI0 no response expected.
Input Parameter(s):
biDataInLength : The length of the data.
*pabiDataIn : Pointer to the first element of the data.
Return Value:
None
Содержание EZRADIOPRO Si4060
Страница 24: ...AN633 24 Rev 0 7 Figure 20 Supply Current versus Time Diagram from Shutdown to RX State...
Страница 67: ...AN633 Rev 0 7 67 Figure 48 Variable Length Packet Reception Flowchart...
Страница 69: ...AN633 Rev 0 7 69 Figure 50 Packet Matching Reception Flowchart...
Страница 73: ...AN633 Rev 0 7 73 Figure 54 Packet Reception with Automatic RX Hopping Flowchart...
Страница 75: ...AN633 Rev 0 7 75 Figure 56 Packet Reception with Manual Rx Hopping...
Страница 80: ...AN633 80 Rev 0 7 Figure 62 Long Packet Transmission Workflow...
Страница 81: ...AN633 Rev 0 7 81 Figure 63 Long Packet RX Flowchart...