openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
lpc17_ssp.h File Reference
#include "chip_lpc175x_6x.h"
#include "ssp_17xx_40xx.h"
#include "FreeRTOS.h"
#include "task.h"
Include dependency graph for lpc17_ssp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ssp_config
 SSP Interface config struct. More...
 

Macros

#define MAX_SSP_INTERFACES   2
 SSP Interfaces count in LPC17xx.
 
#define SSP(n)   LPC_SSP##n
 Macro to retrieve the pointer to LPC_SSP registers based on id number.
 
#define SSP_SLAVE   0
 
#define SSP_MASTER   1
 
#define SSP_INTERRUPT   0
 
#define SSP_POLLING   1
 
#define ssp_chip_init(id)   Chip_SSP_Init(SSP(id))
 
#define ssp_chip_deinit(id)   Chip_SSP_DeInit(SSP(id))
 
#define ssp_flush_rx(id)   Chip_SSP_Int_FlushData(SSP(id))
 
#define ssp_set_bitrate(id, bitrate)   Chip_SSP_SetBitRate(SSP(id), bitrate)
 
#define ssp_write(id, buffer, buffer_len)   ssp_write_read(id, buffer, buffer_len, NULL, 0, 0)
 
#define ssp_read(id, buffer, buffer_len, timeout)   ssp_write_read(id, NULL, 0, buffer, buffer_len, timeout)
 

Typedefs

typedef struct ssp_config ssp_config_t
 SSP Interface config struct.
 

Enumerations

enum  ssel_state { ASSERT = 0 , DEASSERT }
 Slave select states. More...
 

Functions

void ssp_init (uint8_t id, uint32_t bitrate, uint8_t frame_sz, bool master_mode, bool poll)
 
void ssp_ssel_control (uint8_t id, uint8_t state)
 Function that controls the Slave Select (SSEL) signal This pin is controlled manually because the internal SSP driver resets the SSEL pin every 8 bits that are transfered.
 
void ssp_write_read (uint8_t id, uint8_t *tx_buf, uint32_t tx_len, uint8_t *rx_buf, uint32_t rx_len, uint32_t timeout)
 

Macro Definition Documentation

◆ MAX_SSP_INTERFACES

#define MAX_SSP_INTERFACES   2

SSP Interfaces count in LPC17xx.

◆ SSP

#define SSP ( n)    LPC_SSP##n

Macro to retrieve the pointer to LPC_SSP registers based on id number.

◆ ssp_chip_deinit

#define ssp_chip_deinit ( id)    Chip_SSP_DeInit(SSP(id))

◆ ssp_chip_init

#define ssp_chip_init ( id)    Chip_SSP_Init(SSP(id))

◆ ssp_flush_rx

#define ssp_flush_rx ( id)    Chip_SSP_Int_FlushData(SSP(id))

◆ SSP_INTERRUPT

#define SSP_INTERRUPT   0

◆ SSP_MASTER

#define SSP_MASTER   1

◆ SSP_POLLING

#define SSP_POLLING   1

◆ ssp_read

#define ssp_read ( id,
buffer,
buffer_len,
timeout )   ssp_write_read(id, NULL, 0, buffer, buffer_len, timeout)

◆ ssp_set_bitrate

#define ssp_set_bitrate ( id,
bitrate )   Chip_SSP_SetBitRate(SSP(id), bitrate)

◆ SSP_SLAVE

#define SSP_SLAVE   0

◆ ssp_write

#define ssp_write ( id,
buffer,
buffer_len )   ssp_write_read(id, buffer, buffer_len, NULL, 0, 0)

Typedef Documentation

◆ ssp_config_t

typedef struct ssp_config ssp_config_t

SSP Interface config struct.

Enumeration Type Documentation

◆ ssel_state

enum ssel_state

Slave select states.

Enumerator
ASSERT 
DEASSERT 

Function Documentation

◆ ssp_init()

void ssp_init ( uint8_t id,
uint32_t bitrate,
uint8_t frame_sz,
bool master_mode,
bool poll )

◆ ssp_ssel_control()

void ssp_ssel_control ( uint8_t id,
uint8_t state )

Function that controls the Slave Select (SSEL) signal This pin is controlled manually because the internal SSP driver resets the SSEL pin every 8 bits that are transfered.

◆ ssp_write_read()

void ssp_write_read ( uint8_t id,
uint8_t * tx_buf,
uint32_t tx_len,
uint8_t * rx_buf,
uint32_t rx_len,
uint32_t timeout )