Go to the documentation of this file.
64 #define SSP_CR0_DSS(n) ((uint32_t) ((n) & 0xF))
66 #define SSP_CR0_FRF_SPI ((uint32_t) (0 << 4))
68 #define SSP_CR0_FRF_TI ((uint32_t) (1 << 4))
70 #define SSP_CR0_FRF_MICROWIRE ((uint32_t) (2 << 4))
73 #define SSP_CR0_CPOL_LO ((uint32_t) (0))
74 #define SSP_CR0_CPOL_HI ((uint32_t) (1 << 6))
77 #define SSP_CR0_CPHA_FIRST ((uint32_t) (0))
78 #define SSP_CR0_CPHA_SECOND ((uint32_t) (1 << 7))
81 #define SSP_CR0_SCR(n) ((uint32_t) ((n & 0xFF) << 8))
83 #define SSP_CR0_BITMASK ((uint32_t) (0xFFFF))
85 #define SSP_CR0_BITMASK ((uint32_t) (0xFFFF))
88 #define SSP_CR0_SCR(n) ((uint32_t) ((n & 0xFF) << 8))
95 #define SSP_CR1_LBM_EN ((uint32_t) (1 << 0))
97 #define SSP_CR1_SSP_EN ((uint32_t) (1 << 1))
99 #define SSP_CR1_SLAVE_EN ((uint32_t) (1 << 2))
100 #define SSP_CR1_MASTER_EN ((uint32_t) (0))
103 #define SSP_CR1_SO_DISABLE ((uint32_t) (1 << 3))
105 #define SSP_CR1_BITMASK ((uint32_t) (0x0F))
108 #define SSP_CPSR_BITMASK ((uint32_t) (0xFF))
114 #define SSP_DR_BITMASK(n) ((n) & 0xFFFF)
121 #define SSP_SR_BITMASK ((uint32_t) (0x1F))
124 #define SSP_ICR_BITMASK ((uint32_t) (0x03))
336 pSSP->
ICR = IntClear;
408 pSSP->
CR0 = (pSSP->
CR0 & ~0xFF) | bits | frameFormat | clockMode;
421 pSSP->
CR1 = (pSSP->
CR1 & ~(1 << 2)) | mode;
453 #define SSP_CPHA_FIRST SSP_CR0_CPHA_FIRST
454 #define SSP_CPHA_SECOND SSP_CR0_CPHA_SECOND
463 #define SSP_CPOL_HI SSP_CR0_CPOL_LO
464 #define SSP_CPOL_LO SSP_CR0_CPOL_HI
467 #define SSP_SLAVE_MODE SSP_CR1_SLAVE_EN
468 #define SSP_MASTER_MODE SSP_CR1_MASTER_EN
STATIC INLINE void Chip_SSP_SendFrame(LPC_SSP_T *pSSP, uint16_t tx_data)
Send SSP 16-bit data.
void Chip_SSP_SetBitRate(LPC_SSP_T *pSSP, uint32_t bitRate)
Set the clock frequency for SSP interface.
STATIC INLINE IntStatus Chip_SSP_GetRawIntStatus(LPC_SSP_T *pSSP, SSP_RAWINTSTATUS_T RawInt)
Get the raw interrupt status.
void Chip_SSP_DeInit(LPC_SSP_T *pSSP)
Deinitialise the SSP.
STATIC INLINE void Chip_SSP_ClearIntPending(LPC_SSP_T *pSSP, SSP_INTCLEAR_T IntClear)
Clear the corresponding interrupt condition(s) in the SSP controller.
STATIC INLINE FlagStatus Chip_SSP_GetStatus(LPC_SSP_T *pSSP, SSP_STATUS_T Stat)
Get the current status of SSP controller.
Status Chip_SSP_Int_RWFrames16Bits(LPC_SSP_T *pSSP, Chip_SSP_DATA_SETUP_T *xf_setup)
SSP Interrupt Read/Write with 16-bit frame width.
STATIC INLINE uint32_t Chip_SSP_GetIntStatus(LPC_SSP_T *pSSP)
Get the masked interrupt status.
enum _SSP_MASKINTSTATUS SSP_MASKINTSTATUS_T
SSP Type of Mask Interrupt Status.
uint32_t Chip_SSP_WriteFrames_Blocking(LPC_SSP_T *pSSP, uint8_t *buffer, uint32_t buffer_len)
SSP Polling Write in blocking mode.
_SSP_RAWINTSTATUS
SSP Type of Raw Interrupt Status.
SSP register block structure.
void Chip_SSP_SetClockRate(LPC_SSP_T *pSSP, uint32_t clk_rate, uint32_t prescale)
Set up output clocks per bit for SSP bus.
enum CHIP_SSP_CLOCK_FORMAT CHIP_SSP_CLOCK_MODE_T
_SSP_STATUS
SSP Type of Status.
void Chip_SSP_Init(LPC_SSP_T *pSSP)
Initialize the SSP.
_SSP_INTMASK
SSP Type of Interrupt Mask.
enum _SSP_STATUS SSP_STATUS_T
SSP Type of Status.
enum _SSP_RAWINTSTATUS SSP_RAWINTSTATUS_T
SSP Type of Raw Interrupt Status.
_SSP_MASKINTSTATUS
SSP Type of Mask Interrupt Status.
struct SSP_ConfigFormat SSP_ConfigFormat
@ SSP_MASK_INT_STAT_BITMASK
uint32_t Chip_SSP_ReadFrames_Blocking(LPC_SSP_T *pSSP, uint8_t *buffer, uint32_t buffer_len)
SSP Polling Read in blocking mode.
enum _SSP_INTCLEAR SSP_INTCLEAR_T
void Chip_SSP_SetMaster(LPC_SSP_T *pSSP, bool master)
Set the SSP operating modes, master or slave.
STATIC INLINE void Chip_SSP_SetFormat(LPC_SSP_T *pSSP, uint32_t bits, uint32_t frameFormat, uint32_t clockMode)
Set up the SSP frame format.
enum CHIP_SSP_BITS CHIP_SSP_BITS_T
STATIC INLINE uint8_t Chip_SSP_GetDataSize(LPC_SSP_T *pSSP)
Get the number of bits transferred in each frame.
STATIC INLINE void Chip_SSP_Enable(LPC_SSP_T *pSSP)
Enable SSP operation.
void Chip_SSP_Int_FlushData(LPC_SSP_T *pSSP)
Clean all data in RX FIFO of SSP.
STATIC INLINE void Chip_SSP_DisableLoopBack(LPC_SSP_T *pSSP)
Disable loopback mode.
@ CHIP_SSP_FRAME_FORMAT_TI
#define SSP_DR_BITMASK(n)
STATIC INLINE void Chip_SSP_Int_Enable(LPC_SSP_T *pSSP)
Enable interrupt for the SSP.
FlagStatus
Boolean Type definition.
Status Chip_SSP_Int_RWFrames8Bits(LPC_SSP_T *pSSP, Chip_SSP_DATA_SETUP_T *xf_setup)
SSP Interrupt Read/Write with 8-bit frame width.
enum CHIP_SSP_MODE CHIP_SSP_MODE_T
enum FlagStatus IntStatus
STATIC INLINE uint16_t Chip_SSP_ReceiveFrame(LPC_SSP_T *pSSP)
Get received SSP data.
@ SSP_RAW_INT_STAT_BITMASK
STATIC INLINE void Chip_SSP_Set_Mode(LPC_SSP_T *pSSP, uint32_t mode)
Set the SSP working as master or slave mode.
STATIC INLINE void Chip_SSP_Disable(LPC_SSP_T *pSSP)
Disable SSP operation.
STATIC INLINE void Chip_SSP_EnableLoopBack(LPC_SSP_T *pSSP)
Enable loopback mode.
enum CHIP_SSP_FRAME_FORMAT CHIP_SSP_FRAME_FORMAT_T
STATIC INLINE void Chip_SSP_Int_Disable(LPC_SSP_T *pSSP)
Disable interrupt for the SSP.
@ SSP_FRAMEFORMAT_MICROWIRE
enum _SSP_INTMASK SSP_INTMASK_T
SSP Type of Interrupt Mask.
uint32_t Chip_SSP_RWFrames_Blocking(LPC_SSP_T *pSSP, Chip_SSP_DATA_SETUP_T *xf_setup)
SSP Polling Read/Write in blocking mode.