libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
Synchronous Serial Port

Defined Constants and Types for the LPC43xx Synchronous Serial Port More...

Collaboration diagram for Synchronous Serial Port:

Macros

#define SSP0   SSP0_BASE
 
#define SSP1   SSP1_BASE
 
#define SSP_CR0(port)   MMIO32((port) + 0x000)
 
#define SSP0_CR0   SSP_CR0(SSP0)
 
#define SSP1_CR0   SSP_CR0(SSP1)
 
#define SSP_CR1(port)   MMIO32((port) + 0x004)
 
#define SSP0_CR1   SSP_CR1(SSP0)
 
#define SSP1_CR1   SSP_CR1(SSP1)
 
#define SSP_DR(port)   MMIO32((port) + 0x008)
 
#define SSP0_DR   SSP_DR(SSP0)
 
#define SSP1_DR   SSP_DR(SSP1)
 
#define SSP_SR(port)   MMIO32((port) + 0x00C)
 
#define SSP0_SR   SSP_SR(SSP0)
 
#define SSP1_SR   SSP_SR(SSP1)
 
#define SSP_SR_TFE   BIT0
 
#define SSP_SR_TNF   BIT1
 
#define SSP_SR_RNE   BIT2
 
#define SSP_SR_RFF   BIT3
 
#define SSP_SR_BSY   BIT4
 
#define SSP_CPSR(port)   MMIO32((port) + 0x010)
 
#define SSP0_CPSR   SSP_CPSR(SSP0)
 
#define SSP1_CPSR   SSP_CPSR(SSP1)
 
#define SSP_IMSC(port)   MMIO32((port) + 0x014)
 
#define SSP0_IMSC   SSP_IMSC(SSP0)
 
#define SSP1_IMSC   SSP_IMSC(SSP1)
 
#define SSP_RIS(port)   MMIO32((port) + 0x018)
 
#define SSP0_RIS   SSP_RIS(SSP0)
 
#define SSP1_RIS   SSP_RIS(SSP1)
 
#define SSP_MIS(port)   MMIO32((port) + 0x01C)
 
#define SSP0_MIS   SSP_MIS(SSP0)
 
#define SSP1_MIS   SSP_MIS(SSP1)
 
#define SSP_ICR(port)   MMIO32((port) + 0x020)
 
#define SSP0_ICR   SSP_ICR(SSP0)
 
#define SSP1_ICR   SSP_ICR(SSP1)
 
#define SSP_DMACR(port)   MMIO32((port) + 0x024)
 
#define SSP0_DMACR   SSP_DMACR(SSP0)
 
#define SSP1_DMACR   SSP_DMACR(SSP1)
 
#define SSP_DMACR_RXDMAE   0x1
 
#define SSP_DMACR_TXDMAE   0x2
 
#define SSP_ENABLE   BIT1
 

Enumerations

enum  ssp_num_t { SSP0_NUM = 0x0 , SSP1_NUM = 0x1 }
 
enum  ssp_datasize_t {
  SSP_DATA_4BITS = 0x3 , SSP_DATA_5BITS = 0x4 , SSP_DATA_6BITS = 0x5 , SSP_DATA_7BITS = 0x6 ,
  SSP_DATA_8BITS = 0x7 , SSP_DATA_9BITS = 0x8 , SSP_DATA_10BITS = 0x9 , SSP_DATA_11BITS = 0xA ,
  SSP_DATA_12BITS = 0xB , SSP_DATA_13BITS = 0xC , SSP_DATA_14BITS = 0xD , SSP_DATA_15BITS = 0xE ,
  SSP_DATA_16BITS = 0xF
}
 
enum  ssp_frame_format_t { SSP_FRAME_SPI = 0x00 , SSP_FRAME_TI = BIT4 , SSP_FRAM_MICROWIRE = BIT5 }
 
enum  ssp_cpol_cpha_t { SSP_CPOL_0_CPHA_0 = 0x0 , SSP_CPOL_1_CPHA_0 = BIT6 , SSP_CPOL_0_CPHA_1 = BIT7 , SSP_CPOL_1_CPHA_1 = (BIT6|BIT7) }
 
enum  ssp_mode_t { SSP_MODE_NORMAL = 0x0 , SSP_MODE_LOOPBACK = BIT0 }
 
enum  ssp_master_slave_t { SSP_MASTER = 0x0 , SSP_SLAVE = BIT2 }
 
enum  ssp_slave_option_t { SSP_SLAVE_OUT_ENABLE = 0x0 , SSP_SLAVE_OUT_DISABLE = BIT3 }
 

Functions

void ssp_disable (ssp_num_t ssp_num)
 
void ssp_init (ssp_num_t ssp_num, ssp_datasize_t data_size, ssp_frame_format_t frame_format, ssp_cpol_cpha_t cpol_cpha_format, uint8_t serial_clock_rate, uint8_t clk_prescale, ssp_mode_t mode, ssp_master_slave_t master_slave, ssp_slave_option_t slave_option)
 
uint16_t ssp_transfer (ssp_num_t ssp_num, uint16_t data)
 

Detailed Description

Defined Constants and Types for the LPC43xx Synchronous Serial Port

Version
1.0.0
Author
© 2012 Michael Ossmann mike@.nosp@m.ossm.nosp@m.ann.c.nosp@m.om
Date
10 March 2013

LGPL License Terms libopencm3 License

Macro Definition Documentation

◆ SSP0

#define SSP0   SSP0_BASE

Definition at line 46 of file ssp.h.

◆ SSP0_CPSR

#define SSP0_CPSR   SSP_CPSR(SSP0)

Definition at line 80 of file ssp.h.

◆ SSP0_CR0

#define SSP0_CR0   SSP_CR0(SSP0)

Definition at line 54 of file ssp.h.

◆ SSP0_CR1

#define SSP0_CR1   SSP_CR1(SSP0)

Definition at line 59 of file ssp.h.

◆ SSP0_DMACR

#define SSP0_DMACR   SSP_DMACR(SSP0)

Definition at line 105 of file ssp.h.

◆ SSP0_DR

#define SSP0_DR   SSP_DR(SSP0)

Definition at line 64 of file ssp.h.

◆ SSP0_ICR

#define SSP0_ICR   SSP_ICR(SSP0)

Definition at line 100 of file ssp.h.

◆ SSP0_IMSC

#define SSP0_IMSC   SSP_IMSC(SSP0)

Definition at line 85 of file ssp.h.

◆ SSP0_MIS

#define SSP0_MIS   SSP_MIS(SSP0)

Definition at line 95 of file ssp.h.

◆ SSP0_RIS

#define SSP0_RIS   SSP_RIS(SSP0)

Definition at line 90 of file ssp.h.

◆ SSP0_SR

#define SSP0_SR   SSP_SR(SSP0)

Definition at line 69 of file ssp.h.

◆ SSP1

#define SSP1   SSP1_BASE

Definition at line 47 of file ssp.h.

◆ SSP1_CPSR

#define SSP1_CPSR   SSP_CPSR(SSP1)

Definition at line 81 of file ssp.h.

◆ SSP1_CR0

#define SSP1_CR0   SSP_CR0(SSP1)

Definition at line 55 of file ssp.h.

◆ SSP1_CR1

#define SSP1_CR1   SSP_CR1(SSP1)

Definition at line 60 of file ssp.h.

◆ SSP1_DMACR

#define SSP1_DMACR   SSP_DMACR(SSP1)

Definition at line 106 of file ssp.h.

◆ SSP1_DR

#define SSP1_DR   SSP_DR(SSP1)

Definition at line 65 of file ssp.h.

◆ SSP1_ICR

#define SSP1_ICR   SSP_ICR(SSP1)

Definition at line 101 of file ssp.h.

◆ SSP1_IMSC

#define SSP1_IMSC   SSP_IMSC(SSP1)

Definition at line 86 of file ssp.h.

◆ SSP1_MIS

#define SSP1_MIS   SSP_MIS(SSP1)

Definition at line 96 of file ssp.h.

◆ SSP1_RIS

#define SSP1_RIS   SSP_RIS(SSP1)

Definition at line 91 of file ssp.h.

◆ SSP1_SR

#define SSP1_SR   SSP_SR(SSP1)

Definition at line 70 of file ssp.h.

◆ SSP_CPSR

#define SSP_CPSR (   port)    MMIO32((port) + 0x010)

Definition at line 79 of file ssp.h.

◆ SSP_CR0

#define SSP_CR0 (   port)    MMIO32((port) + 0x000)

Definition at line 53 of file ssp.h.

◆ SSP_CR1

#define SSP_CR1 (   port)    MMIO32((port) + 0x004)

Definition at line 58 of file ssp.h.

◆ SSP_DMACR

#define SSP_DMACR (   port)    MMIO32((port) + 0x024)

Definition at line 104 of file ssp.h.

◆ SSP_DMACR_RXDMAE

#define SSP_DMACR_RXDMAE   0x1

Definition at line 109 of file ssp.h.

◆ SSP_DMACR_TXDMAE

#define SSP_DMACR_TXDMAE   0x2

Definition at line 112 of file ssp.h.

◆ SSP_DR

#define SSP_DR (   port)    MMIO32((port) + 0x008)

Definition at line 63 of file ssp.h.

◆ SSP_ENABLE

#define SSP_ENABLE   BIT1

Definition at line 164 of file ssp.h.

◆ SSP_ICR

#define SSP_ICR (   port)    MMIO32((port) + 0x020)

Definition at line 99 of file ssp.h.

◆ SSP_IMSC

#define SSP_IMSC (   port)    MMIO32((port) + 0x014)

Definition at line 84 of file ssp.h.

◆ SSP_MIS

#define SSP_MIS (   port)    MMIO32((port) + 0x01C)

Definition at line 94 of file ssp.h.

◆ SSP_RIS

#define SSP_RIS (   port)    MMIO32((port) + 0x018)

Definition at line 89 of file ssp.h.

◆ SSP_SR

#define SSP_SR (   port)    MMIO32((port) + 0x00C)

Definition at line 68 of file ssp.h.

◆ SSP_SR_BSY

#define SSP_SR_BSY   BIT4

Definition at line 76 of file ssp.h.

◆ SSP_SR_RFF

#define SSP_SR_RFF   BIT3

Definition at line 75 of file ssp.h.

◆ SSP_SR_RNE

#define SSP_SR_RNE   BIT2

Definition at line 74 of file ssp.h.

◆ SSP_SR_TFE

#define SSP_SR_TFE   BIT0

Definition at line 72 of file ssp.h.

◆ SSP_SR_TNF

#define SSP_SR_TNF   BIT1

Definition at line 73 of file ssp.h.

Enumeration Type Documentation

◆ ssp_cpol_cpha_t

Enumerator
SSP_CPOL_0_CPHA_0 
SSP_CPOL_1_CPHA_0 
SSP_CPOL_0_CPHA_1 
SSP_CPOL_1_CPHA_1 

Definition at line 147 of file ssp.h.

◆ ssp_datasize_t

Enumerator
SSP_DATA_4BITS 
SSP_DATA_5BITS 
SSP_DATA_6BITS 
SSP_DATA_7BITS 
SSP_DATA_8BITS 
SSP_DATA_9BITS 
SSP_DATA_10BITS 
SSP_DATA_11BITS 
SSP_DATA_12BITS 
SSP_DATA_13BITS 
SSP_DATA_14BITS 
SSP_DATA_15BITS 
SSP_DATA_16BITS 

Definition at line 123 of file ssp.h.

◆ ssp_frame_format_t

Enumerator
SSP_FRAME_SPI 
SSP_FRAME_TI 
SSP_FRAM_MICROWIRE 

Definition at line 140 of file ssp.h.

◆ ssp_master_slave_t

Enumerator
SSP_MASTER 
SSP_SLAVE 

Definition at line 167 of file ssp.h.

◆ ssp_mode_t

enum ssp_mode_t
Enumerator
SSP_MODE_NORMAL 
SSP_MODE_LOOPBACK 

Definition at line 158 of file ssp.h.

◆ ssp_num_t

enum ssp_num_t
Enumerator
SSP0_NUM 
SSP1_NUM 

Definition at line 114 of file ssp.h.

◆ ssp_slave_option_t

Enumerator
SSP_SLAVE_OUT_ENABLE 
SSP_SLAVE_OUT_DISABLE 

Definition at line 178 of file ssp.h.

Function Documentation

◆ ssp_disable()

void ssp_disable ( ssp_num_t  ssp_num)

◆ ssp_init()

void ssp_init ( ssp_num_t  ssp_num,
ssp_datasize_t  data_size,
ssp_frame_format_t  frame_format,
ssp_cpol_cpha_t  cpol_cpha_format,
uint8_t  serial_clock_rate,
uint8_t  clk_prescale,
ssp_mode_t  mode,
ssp_master_slave_t  master_slave,
ssp_slave_option_t  slave_option 
)

◆ ssp_transfer()

uint16_t ssp_transfer ( ssp_num_t  ssp_num,
uint16_t  data 
)