Sample SPI drivers for a number of the Adesto Technologies flash devices.
Macros | Enumerations | Functions
user_config.h File Reference

Detailed Description

Project declarations exist here.

Definition in file user_config.h.

Go to the source code of this file.

Macros

#define PARTNO   ATxxxx /* <- Replace with the device being used. */
 
#define ALL   1 /* <- Replace with 0 if selecting a part above. */
 
#define USER_CONFIG_CSB_PORT   GPIO3_BASE
 Base register used for CSb control. More...
 
#define USER_CONFIG_TRIGGER_PORT   GPIO3_BASE
 Base register used for TRIGGER control. More...
 
#define USER_CONFIG_SCK_PORT   GPIO3_BASE
 Base register used for SCK control. More...
 
#define USER_CONFIG_MOSI_PORT   GPIO3_BASE
 Base register used for MOSI control. More...
 
#define USER_CONFIG_MISO_PORT   GPIO3_BASE
 Base register used for MISO control. More...
 
#define USER_CONFIG_IO2_PORT   GPIO3_BASE
 Base register used for IO2 control. More...
 
#define USER_CONFIG_IO3_PORT   GPIO3_BASE
 Base register used for IO3 control. More...
 
#define USER_CONFIG_CSB_PIN   6U
 
#define USER_CONFIG_TRIGGER_PIN   2U
 Pin number for TRIGGER. More...
 
#define USER_CONFIG_SCK_PIN   7U
 Pin number for SCK. More...
 
#define USER_CONFIG_MOSI_PIN   8U
 Pin number for MOSI. More...
 
#define USER_CONFIG_MISO_PIN   9U
 Pin number for MISO. More...
 
#define USER_CONFIG_IO2_PIN   10U
 Pin number for IO2. More...
 
#define USER_CONFIG_IO3_PIN   11U
 Pin number for IO3. More...
 
#define DELAY   5U
 Half clock period delay interval. More...
 

Enumerations

enum  directionIO { OUTPUT, INPUT }
 Enumeration used when initializing pins as inputs or outputs. OUTPUT = 0, INPUT = 1. See USER_CONFIG_PinInit(). More...
 

Functions

void USER_CONFIG_PinInit (uint32_t port, uint32_t pin, enum directionIO direction)
 Initializes a given pin as either an input or output. When porting, this function must be redefined. More...
 
void USER_CONFIG_PinClear (uint32_t port, uint32_t pin)
 Clears a given pin on a port to LOW. More...
 
void USER_CONFIG_PinSet (uint32_t port, uint32_t pin)
 Sets a given pin on a port to HIGH. More...
 
uint8_t USER_CONFIG_PinRead (uint32_t port, uint32_t pin)
 Reads the voltage on a given pin. More...
 
void USER_CONFIG_BoardInit ()
 Configures the board for program usage. Initializes the requisite ports/pins for use as GPIOs. Starts the various clocks, and enables UART via USB connection. More...
 

Macro Definition Documentation

◆ ALL

#define ALL   1 /* <- Replace with 0 if selecting a part above. */

Definition at line 87 of file user_config.h.

◆ DELAY

#define DELAY   5U

Half clock period delay interval.

Definition at line 191 of file user_config.h.

◆ PARTNO

#define PARTNO   ATxxxx /* <- Replace with the device being used. */

Definition of part number.

Definition at line 86 of file user_config.h.

◆ USER_CONFIG_CSB_PIN

#define USER_CONFIG_CSB_PIN   6U

Pin number for CSb

Warning
Don't forget to update USER_CONFIG_BoardInit() called from main! As is, both CSb pins are configured as outputs so the changes above and below in this file are the only things needed (pin and port numbers for CSb).

Definition at line 177 of file user_config.h.

◆ USER_CONFIG_CSB_PORT

#define USER_CONFIG_CSB_PORT   GPIO3_BASE

Base register used for CSb control.

Definition at line 146 of file user_config.h.

◆ USER_CONFIG_IO2_PIN

#define USER_CONFIG_IO2_PIN   10U

Pin number for IO2.

Definition at line 187 of file user_config.h.

◆ USER_CONFIG_IO2_PORT

#define USER_CONFIG_IO2_PORT   GPIO3_BASE

Base register used for IO2 control.

Definition at line 166 of file user_config.h.

◆ USER_CONFIG_IO3_PIN

#define USER_CONFIG_IO3_PIN   11U

Pin number for IO3.

Definition at line 189 of file user_config.h.

◆ USER_CONFIG_IO3_PORT

#define USER_CONFIG_IO3_PORT   GPIO3_BASE

Base register used for IO3 control.

Definition at line 170 of file user_config.h.

◆ USER_CONFIG_MISO_PIN

#define USER_CONFIG_MISO_PIN   9U

Pin number for MISO.

Definition at line 185 of file user_config.h.

◆ USER_CONFIG_MISO_PORT

#define USER_CONFIG_MISO_PORT   GPIO3_BASE

Base register used for MISO control.

Definition at line 162 of file user_config.h.

◆ USER_CONFIG_MOSI_PIN

#define USER_CONFIG_MOSI_PIN   8U

Pin number for MOSI.

Definition at line 183 of file user_config.h.

◆ USER_CONFIG_MOSI_PORT

#define USER_CONFIG_MOSI_PORT   GPIO3_BASE

Base register used for MOSI control.

Definition at line 158 of file user_config.h.

◆ USER_CONFIG_SCK_PIN

#define USER_CONFIG_SCK_PIN   7U

Pin number for SCK.

Definition at line 181 of file user_config.h.

◆ USER_CONFIG_SCK_PORT

#define USER_CONFIG_SCK_PORT   GPIO3_BASE

Base register used for SCK control.

Definition at line 154 of file user_config.h.

◆ USER_CONFIG_TRIGGER_PIN

#define USER_CONFIG_TRIGGER_PIN   2U

Pin number for TRIGGER.

Definition at line 179 of file user_config.h.

◆ USER_CONFIG_TRIGGER_PORT

#define USER_CONFIG_TRIGGER_PORT   GPIO3_BASE

Base register used for TRIGGER control.

Definition at line 150 of file user_config.h.

Enumeration Type Documentation

◆ directionIO

Enumeration used when initializing pins as inputs or outputs. OUTPUT = 0, INPUT = 1. See USER_CONFIG_PinInit().

Enumerator
OUTPUT 
INPUT 

Definition at line 205 of file user_config.h.

Function Documentation

◆ USER_CONFIG_BoardInit()

void USER_CONFIG_BoardInit ( )

Configures the board for program usage. Initializes the requisite ports/pins for use as GPIOs. Starts the various clocks, and enables UART via USB connection.

Return values
void

Definition at line 82 of file user_config.c.

◆ USER_CONFIG_PinClear()

void USER_CONFIG_PinClear ( uint32_t  port,
uint32_t  pin 
)

Clears a given pin on a port to LOW.

Parameters
portThe port number.
pinThe pin number.
Return values
void

Definition at line 64 of file user_config.c.

◆ USER_CONFIG_PinInit()

void USER_CONFIG_PinInit ( uint32_t  port,
uint32_t  pin,
enum directionIO  direction 
)

Initializes a given pin as either an input or output. When porting, this function must be redefined.

Parameters
portThe port number.
pinThe pin number.
directionINPUT or OUTPUT. See the directionIO enum type.
Return values
void

Definition at line 44 of file user_config.c.

◆ USER_CONFIG_PinRead()

uint8_t USER_CONFIG_PinRead ( uint32_t  port,
uint32_t  pin 
)

Reads the voltage on a given pin.

Parameters
portThe port number.
pinThe pin number.
Return values
uint32_t0 = LOW, 1 = HIGH.

Definition at line 76 of file user_config.c.

◆ USER_CONFIG_PinSet()

void USER_CONFIG_PinSet ( uint32_t  port,
uint32_t  pin 
)

Sets a given pin on a port to HIGH.

Parameters
portThe port number.
pinThe pin number.
Return values
void

Definition at line 70 of file user_config.c.