LibDriver APA102C
Loading...
Searching...
No Matches
apa102c base driver function

apa102c base driver modules More...

Collaboration diagram for apa102c base driver function:

Data Structures

struct  apa102c_handle_s
 apa102c handle structure definition More...
struct  apa102c_info_s
 apa102c information structure definition More...

Macros

#define APA102C_COLOR(RED, GREEN, BLUE, BRIGHTNESS)
 make color

Typedefs

typedef struct apa102c_handle_s apa102c_handle_t
 apa102c handle structure definition
typedef struct apa102c_info_s apa102c_info_t
 apa102c information structure definition

Functions

uint8_t apa102c_info (apa102c_info_t *info)
 get chip's information
uint8_t apa102c_init (apa102c_handle_t *handle)
 initialize the chip
uint8_t apa102c_deinit (apa102c_handle_t *handle)
 close the chip
uint8_t apa102c_write (apa102c_handle_t *handle, uint32_t *color, uint32_t len, uint8_t *temp, uint32_t temp_len)
 write color frame
uint8_t apa102c_write_off (apa102c_handle_t *handle, uint32_t len, uint8_t *temp, uint32_t temp_len)
 write off frame

Detailed Description

apa102c base driver modules

Macro Definition Documentation

◆ APA102C_COLOR

#define APA102C_COLOR ( RED,
GREEN,
BLUE,
BRIGHTNESS )
Value:
((uint32_t)(0xE | ((BRIGHTNESS) & 0x1F)) << 24) | \
((uint32_t)((BLUE) & 0xFF) << 16) | \
((uint32_t)((GREEN) & 0xFF) << 8) | \
((uint32_t)((RED) & 0xFF) << 0)

make color

Parameters
[in]REDred color
[in]GREENgreen color
[in]BLUEblue color
[in]BRIGHTNESSbrightness
Note
0<= RED <= 255 0<= GREEN <= 255 0<= BLUE <= 255 0<= BRIGHTNESS <= 31

Definition at line 169 of file driver_apa102c.h.

Typedef Documentation

◆ apa102c_handle_t

apa102c handle structure definition

◆ apa102c_info_t

apa102c information structure definition

Function Documentation

◆ apa102c_deinit()

uint8_t apa102c_deinit ( apa102c_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an apa102c handle structure
Returns
status code
  • 0 success
  • 1 spi deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 261 of file driver_apa102c.c.

◆ apa102c_info()

uint8_t apa102c_info ( apa102c_info_t * info)

get chip's information

Parameters
[out]*infopointer to an apa102c info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 320 of file driver_apa102c.c.

◆ apa102c_init()

uint8_t apa102c_init ( apa102c_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an apa102c handle structure
Returns
status code
  • 0 success
  • 1 spi initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 61 of file driver_apa102c.c.

◆ apa102c_write()

uint8_t apa102c_write ( apa102c_handle_t * handle,
uint32_t * color,
uint32_t len,
uint8_t * temp,
uint32_t temp_len )

write color frame

Parameters
[in]*handlepointer to an apa102c handle structure
[in]*colorpointer to a color buffer
[in]lencolor length
[in]*temppointer to a temp buffer
[in]temp_lentemp buffer length
Returns
status code
  • 0 success
  • 1 write failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 color is null
  • 5 temp is null
  • 6 temp buffer is too small
Note
none

Definition at line 124 of file driver_apa102c.c.

◆ apa102c_write_off()

uint8_t apa102c_write_off ( apa102c_handle_t * handle,
uint32_t len,
uint8_t * temp,
uint32_t temp_len )

write off frame

Parameters
[in]*handlepointer to an apa102c handle structure
[in]lencolor length
[in]*temppointer to a temp buffer
[in]temp_lentemp buffer length
Returns
status code
  • 0 success
  • 1 write failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 temp is null
  • 5 temp buffer is too small
Note
none

Definition at line 198 of file driver_apa102c.c.