Component: SPI (Peripheral CAL)

From Flowcode Help
Revision as of 12:12, 17 August 2016 by BenR (talk | contribs)
Jump to navigationJump to search


Author Matrix Ltd
Version 1.1 (Release)
Category Peripheral CAL


Image SPI component

A low level implementation giving direct access to the CAL


Examples

Example template program for creating a new component using the CAL SPI. Contains all the code to allow the dynamic SPI channel population, re-mappable I/O functionality and Injector functionality.

FC6 Icon.png SPI CAL Demo


Downloadable macro reference

Slave_Uninit

Uninitialise the Slave

Parameters

This macro has no parameters


Return value

This call does not return a value


Slave_Init

Initialise the Slave

Parameters

This macro has no parameters


Return value

This call does not return a value


Master_Uninit

Uninitialise the Master

Parameters

This macro has no parameters


Return value

This call does not return a value


Master_Byte

Sends and receives a data byte

Parameters

BYTE DataOut


Return value

BYTE


Slave_TxByte

Sets the data to be transmitted

Parameters

BYTE Data


Return value

This call does not return a value


Slave_RxByte

Returns the data received

Parameters

This macro has no parameters


Return value

BYTE


SetPrescaler

Sets the prescaler value for the clock divider chain

Parameters

BYTE Prescaler


Return value

This call does not return a value


Master_Init

Initialise the Master

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

ChangeMode

No additional information


Parameters

This macro has no parameters


Return value

This call does not return a value


GetValue

Reads Named property Value.

Parameters

<- STRING Name
This parameter may be returned back to the caller


Return value

STRING


GetConsoleHandle

Returns a handle to the console used by this component

Parameters

This macro has no parameters


Return value

HANDLE


SetValue

Change Named property to new Value.

Parameters

<- STRING Name
This parameter may be returned back to the caller
<- STRING Value
This parameter may be returned back to the caller


Return value

This call does not return a value


GetList

returns Named property list

Parameters

<- STRING Name
This parameter may be returned back to the caller


Return value

STRING



Property reference

Component Enable

This property is of type True or false and can be referenced with the variable name ENABLED.

No additional information


Channel

This property is of type Fixed list of ints and can be referenced with the variable name CHANNEL.

SPI Channel selector

MOSI

This property is of type Single digital pin and can be referenced with the variable name MOSI.

No additional information


MISO

This property is of type Single digital pin and can be referenced with the variable name MISO.

No additional information


CLK

This property is of type Single digital pin and can be referenced with the variable name CLK.

No additional information


Prescale

This property is of type Fixed list of ints and can be referenced with the variable name PR_SCALE.

Prescale option selector

Clock Polarity

This property is of type Fixed list of ints and can be referenced with the variable name CKP.

Clock Polarity setting, inactive (idle) state

Clock Phase

This property is of type Fixed list of ints and can be referenced with the variable name CKE.

Clock Phase (data change edge) selection

Sample Point

This property is of type Fixed list of ints and can be referenced with the variable name SMP.

Data bit read sample point

Scope Traces

This property is of type True or false and can be referenced with the variable name ScopeTraces.

Selects if the scope traces are automatically generated or not

Console Data

This property is of type True or false and can be referenced with the variable name ConsoleData.

Selects if the console data is automatically generated or not